Solved

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

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

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Generic progress indicator 6 117
EvenOdd challenge 10 108
scoreUp challenge 14 62
noX challenge 17 116
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…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

770 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