Solved

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

Posted on 1998-01-15
1
330 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
ID: 1314186
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

929 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

10 Experts available now in Live!

Get 1:1 Help Now