Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sizes of nested Splitter Windows

Posted on 2000-02-15
2
Medium Priority
?
397 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Will your db performance match your db growth?

In Percona’s white paper “Performance at Scale: Keeping Your Database on Its Toes,” we take a high-level approach to what you need to think about when planning for database scalability.

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: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
Suggested Courses

704 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