Freigeben über


Design Specifications and Guidelines - Window Management

Multiple-Document Interface

The multiple-document interface (MDI) technique uses a single primary window, called a parent window, to visually contain a set of related document or child windows, as shown in Figure 10.3. Each child window is essentially a primary window, but it is constrained to appear only within the parent window instead of on the desktop.

MDI parent and child windows

Figure 10.3 MDI parent and child windows (click to enlarge image)

MDI Design

With MDI, the parent window provides a visual and operational framework for its child windows. For example, child windows typically share the menu bar of the parent window and can also share other parts of the parent's interface, such as a toolbar or status bar. You can change these to reflect the commands and attributes of the active child window.

Cross referenceMore Information

For more information about the interaction between a primary window and its secondary windows, see Chapter 7, "Windows" and Chapter 9, "Secondary Windows."

Secondary windows displayed as a result of interaction within the MDI parent or child — such as dialog boxes, message boxes, or property sheets — typically are not contained or clipped by the parent window. These windows should activate and display content according to the conventions for secondary windows associated with a primary window, even if they apply to specific child windows.

Window Design

For the title bar of an MDI parent window, include the icon and name of the application or the object that it represents in the work area displayed in the parent window. For the title bar of a child window, include the icon representing the document or data file type and its file name, as shown in Figure 10.4.

MDI application and child (document) window title bars

Figure 10.4 MDI application and child (document) window title bars

Supply a shortcut menu for the application icon in the parent window using the conventions for application title bar icons. Include the following commands where they apply.

Optional Shortcut Menu Commands for MDI Parent Window Title Bar Icons
Command Meaning
New Creates a new data file or displays a list of data file types supported by the application from which the user can choose.
Save All Saves all data files open in the MDI workspace and the state of the MDI window.
Find Displays a window that allows the user to specify criteria to locate a data file.

Cross referenceMore Information

For more information about window shortcut menus, see Chapter 8, "Menus, Controls, and Toolbars."

In addition, supply an appropriate shortcut menu for the title bar icon that appears in the child window's title bar. You can follow the same conventions for non-MDI data files. Note that although pressing ALT+SPACEBAR should display the shortcut menu for the application's parent window, use ALT+HYPHEN to display the shortcut menu for the active child window.

Opening and Closing MDI Windows

The user starts an MDI application either by opening the application itself or by opening a document (or data file) of the type supported by the MDI application. If an MDI document is opened, the MDI parent window opens first, and then the child window for the document opens within it. To support the user opening other documents associated with the application, include an interface such as an Open dialog box.

If a user opens an MDI document outside the interface of its MDI parent window — for example, by double-clicking the file — and the parent window for the application is already open, open another instance of the MDI parent window. Although opening the child window within the existing parent window can seem more efficient, the new open window can disrupt the task environment already set up in the existing parent window. For example, if the newly opened file is a macro, opening it in the existing parent window could inadvertently affect other open documents in that window. If the user wants to open a file as part of the set in a particular parent MDI window, the commands within that window provide support.

Because an MDI child window is a special form of primary window, support its closure by following the same conventions for primary windows: include a Close button in its title bar and a Close command on the shortcut menu for the child window. When the user closes a child window, any unsaved changes are processed just as they are for primary windows. Do not automatically close its parent window, unless the parent window provides context or operations only with an open child window.

When the user closes the parent window, close all of its child windows. Where possible, preserve the state of a child window, such as its size and position within the parent window, and restore the state when the user reopens the file.

Moving and Sizing MDI Windows

MDI allows the user to move or hide the child windows as a set by moving or minimizing the parent window. When the user moves an MDI parent window, maintain the relative positions of the open child windows within the parent window.

MDI child windows can support the same window commands as their parent. Therefore, you should create shortcut menus for your application's MDI child windows and include Move, Size, Minimize, Maximize, and Close commands.

Moving a child window constrains it to its parent window. In some cases, the size of the parent window's interior area may result in clipping a child window. Optionally, you can support automatic resizing of the parent window when the user moves or resizes a child window either toward or away from the edge of the parent window.

NoteNote

A minimized child window in Microsoft Windows should appear sized down to display only part of its title area and its border. This avoids potential confusion between minimized child window icons and icons that represent objects.

Although an MDI parent window minimizes as an entry on the taskbar, MDI child windows minimize within their parent window, as shown in Figure 10.5.

Minimized MDI child window

Figure 10.5 A minimized MDI child window

When the user maximizes an MDI parent window, expand the window to its maximum size, like any other primary window. When the user maximizes an MDI child window, also expand it to its maximum size. When this size exceeds the interior of its parent window, merge the child window with its parent window. The child window's title bar icon, Restore button, Close button, and Minimize button (if supported) are placed on the menu bar of the parent window in the same relative positions as in the title bar of the child window, as shown in Figure 10.6. Append the child window title text to the parent window title text.

Maximized MDI child window

Figure 10.6 A maximized MDI child window (click to enlarge image)

If the user maximizes one child window and it merges with the parent window, and then the user switches to another child window, display that window as maximized. Similarly, when the user restores one child window from its maximized state to its previous size, restore all other child windows to their previous sizes.

Switching Between MDI Child Windows

For MDI child windows, apply common mouse conventions for activating and switching between primary windows. The recommended keyboard shortcuts for switching between child windows are CTRL+F6 and CTRL+TAB (and SHIFT+ modified combinations to move backwards). On the menu bar of the parent window, include a Window menu with commands for switching between child windows and managing or arranging the windows within the MDI parent window, such as Tile or Cascade.

When the user switches child windows, you can change the interface of the parent window — such as its menu bar, toolbar, or status bar — to appropriately reflect the commands that apply to a particular child window. However, provide as much consistency as possible, keeping constant any menus that represent the document files and control the application or overall parent window environment, such as the File menu or the Window menu.

Design Trade-offs

MDI offers multiple benefits, such as sharing the parent window's interface components (menus, toolbars, and status bars) to make it a very space-efficient interface. It also provides a logical separation of its views from other document or application windows. However, MDI also has a number of limitations. First, MDI supports a more conventional application-centered design. Although the user can start an MDI application by opening one of its document or data files, the application interface must be visible for the user to open and work with multiple documents within the same MDI parent window.

An MDI implementation could also confuse or be frustrating to users who are familiar with switching between documents by using separate taskbar buttons or by pressing ALT+TAB. Similarly, users cannot easily determine what documents they have open because there is only one entry for the parent window on the taskbar.

When the user opens multiple files within the same MDI parent window, the storage relationship between the child windows and the objects being viewed in those windows is not consistent. That is, although the parent window provides visual containment for a set of child windows, it does not provide containment for the files those windows represent. This makes the relationship between the files and their windows more abstract, making an MDI application more challenging for beginning users to learn.

Similarly, because the MDI parent window does not actually contain the objects opened within it, MDI cannot support an effective design for reopening the application's windows to their last state. When the user closes the parent window and then reopens it, the context cannot be restored because the application state must be maintained independently from that of the files last opened in it.

MDI can make some aspects of the COM interface unintentionally more complex. For example, if the user opens a text document in an MDI application and then opens a worksheet embedded in that text document, the task relationship and window management break down. This is because the embedded worksheet's window does not appear in the same MDI parent window.

Finally, the MDI technique of managing windows by confining child windows to the parent window can be inconvenient or inappropriate for some tasks, such as designing with window or form layout tools. Similarly, the nested nature of child windows may make it difficult for the user to distinguish between a child window in a parent window and a primary window that is a peer with the parent window but is positioned on top.

Fundamentals of Designing User Interaction

Windows Interface Components

Design Specifications and Guidelines

Appendixes and References