OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
MDI Windows

Multiple document interface (MDI) windows are part of the MDI interface for managing multiple windows or views associated with a single application.

A document is usually a file-specific task, such as editing a text file or working on a spreadsheet file.

MDI Applications

Certain components are present in every MDI application. Most evident is the main window, called the MDI frame window. Within the frame window's client area is the MDI client window, which holds child windows called MDI child windows. When using the Doc/View classes, the application can put views into MDI windows.

The MDI Window Menu

An MDI application usually has a menu item labeled Window that controls the MDI child windows. The Window menu usually has items like Tile, Cascade, Arrange, and Close All. The name of each open MDI child window is automatically added to the end of this menu, and the currently selected window is checked.

MDI Child Windows

MDI child windows have some characteristics of an overlapped window. An MDI child window can be maximized to the full size of its MDI client window or minimized to an icon that sits inside the client window. MDI child windows never appear outside their client or frame windows. Although MDI child windows cannot have menus attached to them, they can have a TMenuDescr that the frame window uses as a menu when that child is active. The caption of each MDI child window is often the name of the file associated with that window; this behavior is optional and under your control.

MDI in ObjectWindows

ObjectWindows defines classes for each type of MDI window:

  • TMDIFrame
  • TMDIClient
  • TMDIChild

In ObjectWindows, the MDI frame window owns the MDI client window, and the MDI client window owns each of the MDI child windows.

TMDIFrame's member functions manage the frame window and its menu. ObjectWindows first passes commands to the focus window and then to its parent, so the client window can process the frame window's menu commands. Because TMDIFrame does not have much specialized behavior, you rarely have to derive your own MDI frame window class; instead, just use an instance of TMDIFrame. Since TMDIChild is derived from TFrameWindow, it can be a frame window

with a client window. Therefore, you can create specialized windows that either serve as client windows in a TMDIChild or are TMDIChild windows themselves. The preferred style is to use specialized clients with the standard TMDIChild class. The choice is yours and depends on your particular application.

See Also