Solved

Splitter Window as MDI (not SDI)

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Get filename and folder into excel 7 68
how do i create updater to My Activex application? 3 79
Sed question 2 68
Making an alias 7 79
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 …
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.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

910 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now