?
Solved

Splitting the Mainframe of an MDI application

Posted on 1998-12-22
5
Medium Priority
?
759 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
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 400 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

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…
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 …
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.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses
Course of the Month17 days, left to enroll

864 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