Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Sizes of nested Splitter Windows

Posted on 2000-02-15
2
Medium Priority
?
399 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 200 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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.
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…

886 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