Solved

Splitting the Mainframe of an MDI application

Posted on 1998-12-22
5
731 Views
Last Modified: 2013-11-20
My questions involves using a splitter window to organize a MDI app.  What I want to do is create an MDI application whose Mainframe window is split in half.  The left half of the screen contains a table of contents utilizing a tree control. The right half acts as a container for multiple document views, which can be tiled, maximized, cascaded, etcs within the right pane (kind of like how the Visual Studio displays the class view on the left and all the open source files are contained on the right).  I think I need to some how split the mainframe of the MDI app, but am not sure?  What is the best way to attack this?

Thanks!
0
Comment
Question by:WallaceM
[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
5 Comments
 
LVL 3

Expert Comment

by:plaroche
ID: 1326586
I'd go with a derived control bar where you create your own tree control and place it as a child window.

0
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 100 total points
ID: 1326587
The MDI architecture is composed of at least three windows.

  1. MDI frame window
  2. MDI client window
  3. MDI child window

The MDI frame window is the one with the menus and such. It is the umbrella window and the ultimate parent of all the other windows.

The MDI client window is the child of the MDI frame. Its job is to be the middle man between the MDI children and the MDI frame. This is where the MDI children will maximize themselves and arrange into an icon and so forth.

The MDI child window is a child of the MDI client and NOT the MDI window.

So if you want to split the windows, you need to create a splitter in the frame winodw. The left split will have a tree control and the right side is the MDI client window. The tree control will be a sibling to the MDI client window.
0
 

Author Comment

by:WallaceM
ID: 1326588
Could you possible give me some more details i.e. a code example?
Thanks
0
 

Expert Comment

by:DennisP
ID: 1326589
First you need to determine if you want the split window into static or dynamic. Static max number of rows and columns is 16 by 16. Rows and columns maybe resized, but total number of rows and columns are fixed. Dynamic on the other hand has max numbers of rows and columns equal 2 by 2. Rows and columns maybe split and unsplit dynamically.

Dynamic Splitter
1. Use CSplitterWnd::Create function
2. Add CSplitterWnd data member to the frame window class
3. Override the frame window's virtual OnCreateClient function and call CSplitterWnd::Create.

Static Splitter
1. Use CSplitterWnd::Create function
2. Add CSplitterWnd data member to the frame window class
3. Override the frame window's virtual OnCreateClient function and call CSplitterWnd::CreateStatic.
4. Use CSplitterWnd::CreateView to create  view in each of the splitters window's panes.

0
 

Author Comment

by:WallaceM
ID: 1326590
This should be very helpful, Thanks!  However, I understand where the MDI Frame window (MainFrm.cpp\.h by default) is defined, but I can't find where the MDI Client Window is defined.  What is an easy way to get at this object?

Thanks Again
0

Featured Post

Independent Software Vendors: 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

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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…
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.

696 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