Solved

Splitting the Mainframe of an MDI application

Posted on 1998-12-22
5
722 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 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

707 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

15 Experts available now in Live!

Get 1:1 Help Now