Solved

3 way splitter for SDI (with split on left side not right)

Posted on 1998-01-15
1
329 Views
Last Modified: 2013-11-20
I would like to create a 3 way splitter window
configuration in the client window of an SDI application
as shown.

 |View 1 |        |
 |-------| View 2 |
 |View 3 |        |


I can get the opposite configuration to work correctly

 |      |View 1 |        
 |View 2|-------|  
 |      |View 3 |      


but when I try to create the configuration I want I get
an ASSERT error. Can you show me the code needed
to create the splitter the way I want ?

pcj

jerzak@rtp.ericsson.se

0
Comment
Question by:jerzak
1 Comment
 
LVL 1

Accepted Solution

by:
WBerthin earned 100 total points
Comment Utility
Hi jerzak:

If I understand you question correctly then the answer is
that you need code like this in your OnCreateClient
override:

BOOL CMainFrame::OnCreateClient(
     LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
      // Create a static splitter with 1 row, 2 columns
      if( !m_RightSplitter.CreateStatic(
            this,      // CWnd* pParentWnd
            1,      // int nRows
            2,      // int nColumns
            WS_CHILD | WS_VISIBLE,            // DWORD dwStyle
            AFX_IDW_PANE_FIRST ) )            // UINT nID      
            return FALSE;

      // Add the second splitter frame in column 1
      // which is a nested splitter with 2 columns
      if( !m_LeftSplitter.CreateStatic(
            &m_RightSplitter,      // CWnd* pParentWnd
                     // our parent window is the first splitter
            1,      // int nRows
            2,      // int nColumns
            WS_CHILD | WS_VISIBLE ,      // DWORD dwStyle
            m_RightSplitter.IdFromRowCol(0, 0) ) )
                  // UINT nID - the new splitter is in the 1st
                  // row and 1st column of the first splitter
            return FALSE;

        //Add the view to the right pane
      if( !m_RightSplitter.CreateView(
            0,       // int nRow
            1,      // int nColumn
            RUNTIME_CLASS(CViewRight),
                         // CRuntimeClass* pViewClass
            CSize( 0 , 0 ),       // Size sizeInit
            pContext) )   // CCreateContext* pContext
            return FALSE;

        //Add the view to the left pane
      if( !m_LeftSplitter.CreateView(
            0,      // int nRow
            0,      // int nColumn
            RUNTIME_CLASS(CViewLeft),
                      // CRuntimeClass* pViewClass
            CSize( m_nLeftWidth , 0 ),// CSize sizeInit
            pContext ) )      / CCreateContext* pContext
            return FALSE;

      // Add the view in the center pane
      if( !m_LeftSplitter.CreateView(
            0,      // int nRow
            1,      // int nColumn
            RUNTIME_CLASS(CViewCenter),
                       // CRuntimeClass* pViewClass
            CSize( 0 , 0 ),      // CSize sizeInit
            pContext) )      // CCreateContext* pContext
            return FALSE;

      // Set the width of the center pane
      m_LeftSplitter.SetColumnInfo(0, m_nCenterWidth,      0);

        // The width of the right pane defaults to the
        // remaining screen width after you set
        // m_nLeftWidth and m_nCenterWidth

      return TRUE;
}

I hope that helps.

By the way, what difference does it make which way you
split off the third pane?

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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…
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.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

743 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

8 Experts available now in Live!

Get 1:1 Help Now