Solved

Sizes of nested Splitter Windows

Posted on 2000-02-15
2
394 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 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…

734 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