Solved

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

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
matchUp  challenge 6 70
How to convert MFC::CString to UTF8 wchar_t* 10 292
Bartender label printing - switch on and off graphics 3 54
moto 4g phone enable finger print 4 28
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

828 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