Solved

Sizes of nested Splitter Windows

Posted on 2000-02-15
2
392 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
ID: 2525628
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
ID: 2527306
Thanks alot!  A+ :)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Macro to save highlighted rows as a separate file 5 45
Expand to include initial dialog with two choices. 9 80
sumNumber challenge 16 138
fix34  challenge 9 141
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

856 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