CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 1999
    Posts
    14

    Splitter Window and CScrollView

    Experts:

    My application needs a horizontal splitter window with two views (view A and view B). These two views have different style and content. View A will
    show some messages by edit box and combo box, so I make View A derived from CFormView. View B will display a bunch of messages and data
    in the loop line by line. I am thinking to derive it from CScrollView because I only want to display messages not edit them and I need the scroll bar
    when message is over 1 screen.
    My questions are: (1). Is that a good choice to make view B derived from CScrollView. Is there any choice better than this to implement view B's
    functionality ? (2). I tried a simple example to display a bunch information on a CScrollView (by TextOut()). But the Scroll Bar didn't show on the right side. How should I do to bring up the scroll bar? (3). How to implement the splitter window who has two different views with different content ?


  2. #2
    Join Date
    May 1999
    Posts
    69

    Re: Splitter Window and CScrollView

    Hi
    (1) sounds reasonable
    (2) did u use SetScrollSizes (maybe in OnInitialUpdate)
    (3) if i remember correctly CreatePane takes a runtime class argument, so just use the right one

    gree(n)things


    chrislaw

  3. #3
    Join Date
    Apr 1999
    Posts
    63

    Re: Splitter Window and CScrollView

    I just worked on this problem myself. In terms of making a splitter window take content from two different views try the following:

    BOOL CMainFrame::OnCreateClient(LPCREATESTRUCT /*lpcs*/,
    CCreateContext* pContext)
    {
    if (!m_wndSplitter.CreateStatic(this, 2, 1))
    {
    TRACE0("Failed to Create Static Splitter\n");
    return FALSE;
    }

    if (!m_wndSplitter.CreateView(0, 0, //top pane
    RUNTIME_CLASS(CDfdView), CSize(225, 225), pContext))
    {
    TRACE0("Failed to create top pane\n");
    return FALSE;
    }

    if (!m_wndSplitter.CreateView(1, 0, //bottom pane
    RUNTIME_CLASS(CFsdView), CSize(225, 125), pContext))
    {
    TRACE0("Failed to create bottom pane\n");
    return FALSE;
    }

    return TRUE;
    }



    CDfdView and CFsdView are two different view classes.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured