Solved

Sizes of nested Splitter Windows

Posted on 2000-02-15
2
387 Views
Last Modified: 2013-11-20
In a SDI application I need to create 4 windows that show different views of the same document.  The application will be split up something like this:
(CORRECT)
wwwwwwwwwwwwww
w1111w22222222222w
w1111w22222222222w
w1111w22222222222w
w1111w22222222222w
wwwww22222222222w
w3333wwwwwwwwww
w3333w44444444444w
wwwwwwwwwwwwww

In order to this, I am using nested splitter windows.  The problem is that when the application starts up, Windows #1 and #3 have a width of 0 (should be 150 pixels).  Windows #2 and #4 take up the entire 600 pixels (should only be 450 pixels)  However the heights of all windows are correct.  So when you start up the applications looks something like this:
(INCORRECT)
wwwwwwwwwwwwww
ww222222222222222w
ww222222222222222w
ww222222222222222w
ww222222222222222w
ww222222222222222w
wwwwwwwwwwwwww
ww444444444444444w
wwwwwwwwwwwwww

Here's my code.  What am I doing wrong??
BOOL CMainFrame::OnCreateClient( LPCREATESTRUCT lpcs,
      CCreateContext* pContext)
{
      
      VERIFY(m_wndSplitter.CreateStatic(this,1,2));

      if (!m_wndSplitterLeft.CreateStatic(&m_wndSplitter,2,1,WS_CHILD | WS_VISIBLE | WS_BORDER,
            m_wndSplitter.IdFromRowCol(0,0)))
      {
            TRACE0("Failed to create left nested splitter window\n");
      }

      VERIFY(m_wndSplitterLeft.CreateView(0, 0, RUNTIME_CLASS(CXmlTree), CSize(150,300),
            pContext));
      VERIFY(m_wndSplitterLeft.CreateView(1, 0, RUNTIME_CLASS(CAttrList), CSize(150,100),
            pContext));

      if (!m_wndSplitterRight.CreateStatic(&m_wndSplitter,2,1,WS_CHILD | WS_VISIBLE | WS_BORDER,
            m_wndSplitter.IdFromRowCol(0,1)))
      {
            TRACE0("Failed to create right nested splitter window\n");
      }
      VERIFY(m_wndSplitterRight.CreateView(0, 0, RUNTIME_CLASS(CXmlFileView), CSize(450,375),
            pContext));
      VERIFY(m_wndSplitterRight.CreateView(1, 0, RUNTIME_CLASS(CErrorMsg), CSize(450,25),
            pContext));

      return TRUE;
}
0
Comment
Question by:sgerlach
2 Comments
 
LVL 2

Accepted Solution

by:
waseemanis earned 50 total points
Comment Utility
Try this before return

      m_wndSplitter.SetColumnInfo( 0, 150, 150 );
      m_wndSplitter.SetColumnInfo( 1, 150, 150 );
      m_wndSplitter.RecalcLayout();



Will work ...worked for me.

Luck,
Waseem.
0
 
LVL 1

Author Comment

by:sgerlach
Comment Utility
Thanks alot!  A+ :)
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now