Solved

Splitter Window as MDI (not SDI)

Posted on 1998-09-24
4
1,085 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 100 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

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

739 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