Solved

Splitting the Mainframe of an MDI application

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

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

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

20 Experts available now in Live!

Get 1:1 Help Now