Solved

layout of a splitter window

Posted on 1998-12-29
2
272 Views
Last Modified: 2013-11-20
Hi,
 I can only create splitter window with a "Grid" style, i.e. 3x3, 2x4, and so on. And I do not know how to create a splitter window with different number of columns for each row. For example, there are three panes. One is on the top. The other two are in the second row. Can anybody tell me how to do this?

wyldsj
0
Comment
Question by:wyldsj
[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
2 Comments
 
LVL 12

Accepted Solution

by:
migel earned 20 total points
ID: 1326985
Hi! It`s simple just create second splitter as child of the first (horz) spliter.
for example:

class C3SplitterFrame : public CMDIChildWnd
{
      DECLARE_DYNCREATE(C3SplitterFrame)
protected:
      C3SplitterFrame();   // protected constructor used by dynamic creation

// Attributes
protected:
      CSplitterWnd m_wndSplitter;
      CSplitterWnd m_wndSplitter2;        // embedded in the first

// Implementation
public:
      virtual ~C3SplitterFrame();
      virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);

      // Generated message map functions
      //{{AFX_MSG(C3SplitterFrame)
      //}}AFX_MSG
      DECLARE_MESSAGE_MAP()
};

BOOL C3SplitterFrame::OnCreateClient(LPCREATESTRUCT lpcs,
       CCreateContext* pContext)
{
      // create a splitter with 1 row, 2 columns
      if (!m_wndSplitter.CreateStatic(this, 1, 2))
      {
            TRACE("Failed to CreateStaticSplitter\n");
            return FALSE;
      }

      // add the first splitter pane - the default view in column 0
      if (!m_wndSplitter.CreateView(0, 0,
            pContext->m_pNewViewClass, CSize(200, 50), pContext))
      {
            TRACE("Failed to create first pane\n");
            return FALSE;
      }

      // add the second splitter pane - which is a nested splitter with 2 rows
      if (!m_wndSplitter2.CreateStatic(
            &m_wndSplitter,     // our parent window is the first splitter
            2, 1,               // the new splitter is 2 rows, 1 column
            WS_CHILD | WS_VISIBLE | WS_BORDER,  // style, WS_BORDER is needed
            m_wndSplitter.IdFromRowCol(0, 1)
                  // new splitter is in the first row, 2nd column of first splitter
         ))
      {
            TRACE("Failed to create nested splitter\n");
            return FALSE;
      }

      // now create the two views inside the nested splitter
      int cyText = max(lpcs->cy - 70, 20);    // height of text pane

      if (!m_wndSplitter2.CreateView(0, 0,
            RUNTIME_CLASS(...), CSize(0, cyText), pContext))
      {
            TRACE("Failed to create second pane\n");
            return FALSE;
      }
      if (!m_wndSplitter2.CreateView(1, 0,
            RUNTIME_CLASS(...), CSize(0, 0), pContext))
      {
            TRACE("Failed to create third pane\n");
            return FALSE;
      }

      // it all worked, we now have two splitter windows which contain
      //  three different views
      return TRUE;
}

just replace RUNTIME_CLASS(...) to the yours.

0
 

Author Comment

by:wyldsj
ID: 1326986
Got it! Thanks!!!

wyldsj
0

Featured Post

Technology Partners: 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

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: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
There's a multitude of different network monitoring solutions out there, and you're probably wondering what makes NetCrunch so special. It's completely agentless, but does let you create an agent, if you desire. It offers powerful scalability …

635 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