CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: CSplitterView

  1. #1
    Join Date
    Apr 1999
    Posts
    74

    CSplitterView

    Can you create splitter window using SDI? Or do you have to use MDI? Only examples I can find are MDI. Any examples I could study? thanks for any help.


  2. #2
    Join Date
    May 1999
    Posts
    48

    Re: CSplitterView

    No.
    Add in your SDI view a CSplitterWnd m_wndSplitter member. Add handlers for Create fucntions, adn OnSize. Use the snippet:

    BOOL CXX2View::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
    {
    if (CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext))
    {
    m_wndSplitter.CreateStatic(this,1,2);
    m_wndSplitter.CreateView(0,0,RUNTIME_CLASS(CEditView),CSize(128,0),pContext);
    m_wndSplitter.CreateView(0,1,RUNTIME_CLASS(CEditView),CSize(0,0),pContext);
    }
    return TRUE;
    }

    void CXX2View::OnSize(UINT nType, int cx, int cy)
    {
    CView::OnSize(nType, cx, cy);
    if (m_wndSplitter.GetSafeHwnd())
    m_wndSplitter.MoveWindow(0,0,cx,cy);

    }

    Sincerely, Mihai



  3. #3
    Join Date
    Apr 1999
    Posts
    74

    Re: CSplitterView

    Thanks for your help!


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