Solved

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

Posted on 1998-01-15
1
334 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
[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
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

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