?
Solved

Splitter Window as MDI (not SDI)

Posted on 1998-09-24
4
Medium Priority
?
1,100 Views
Last Modified: 2013-11-19
Is there a way to do splitter windows in MDI views? I tried
creating the splitters in CMDIChildframe, but ended up with an SDI view. I want to do this as a static splitter.
0
Comment
Question by:bhale
[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
  • 2
4 Comments
 

Author Comment

by:bhale
ID: 1322557
Choosing a Split style when starting a new app is not acceptable, because you get the same view split (similar to VC++ source code window). I want two windows (like CListView and CFormView) in one split view.
0
 
LVL 1

Accepted Solution

by:
VAM345 earned 400 total points
ID: 1322558
In you InitInstance create a doc template for you CMyFormView
      CMultiDocTemplate* pSpliterTemplate;
      pSpliterTemplate = new CMultiDocTemplate(
            IDR_SPLITERTYPE,
            RUNTIME_CLASS(CMySplitDoc),
            RUNTIME_CLASS(CMyMDIChildWnd), // custom MDI child frame
            RUNTIME_CLASS(CMyFormView));
      AddDocTemplate(pSpliterTemplate);

BOOL CMyMDIChildWnd::OnCreateClient(LPCREATESTRUCT, CCreateContext* pContext)
{
      if (!m_wndSplitter.CreateStatic(this, 1, 2))
      {
            TRACE0("Failed to CreateStaticSplitter\n");
            return FALSE;
      }

      // add the first splitter pane - the default view in column 0
      if (!m_wndSplitter.CreateView(0, 0,
            RUNTIME_CLASS(CMyListView), CSize(180, 50), pContext))
      {
            TRACE0("Failed to create second pane\n");
            return FALSE;
      }

      // add the second splitter pane - an input view in column 1
      if (!m_wndSplitter.CreateView(0, 1,
            pContext->m_pNewViewClass, CSize(0, 0), pContext))
      {
            TRACE0("Failed to create first pane\n");
            return FALSE;
      }

      // activate the input view
      SetActiveView((CView*)m_wndSplitter.GetPane(0,1));
      
      return TRUE;
}

0
 

Author Comment

by:bhale
ID: 1322559
That's exactly what I needed. The key seems to be to use the pContext->m_pNewViewClass as the CRuntime parameter in CreateView. All I need to do now is resize the components of the CFormView so that the controls (list and tree) fill the panes.
0
 
LVL 1

Expert Comment

by:VAM345
ID: 1322560
I`m very happy to help you.
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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…
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.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Suggested Courses

764 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