Use of Control Windows

A number of control window classes are provided by Presentation Manager. Under CUA guidelines, these control windows should be displayed in standard windows, although their use is more typically in dialog boxes. This is in accordance with the convention that windows display objects or the contents of objects, and other more structured information such as object attributes is displayed in a dialog box. See also the proviso regarding listboxes under Standard Windows. The use of control windows is defined in the IBM Systems Application Architecture CUA Advanced Guide to User Interface Design. However, there are some emerging conventions as to the exact interpretation of the CUA guidelines, and these are discussed in the following sections.

Entry Field

Entry fields are used where textual or numeric data is required from the user, and where the set of possible entries is open-ended. Examples of such data items include file names, object descriptions etc.

List Box

A listbox is used to display a list of objects, where the contents of that list may change from one execution to the next, based upon various external or user-specified criteria. One or more items may be selected from a listbox. The listbox is typically created with a size sufficient to display a certain number of items, and a scroll bar is provided if the number of items increases such that not all items may be displayed at once.

Note that a listbox should not be used to display a set of choices where that set is finite and unchanging. In such a case, radio buttons may be used where the choices are mutually exclusive, or check boxes used where more than one choice may be made concurrently.

Combo Box

A combo box, also known as a prompted entry field is a combination of the entry field and listbox control window styles, and is supported by Presentation Manager in OS/2 Version 1.2 and above. A combo box is used where textual or numeric data is required from a user, where the set of possible entries is finite, and where the application wishes to prompt the user for a valid entry. A combo box may be of three distinct types:

  • A simple combo box is displayed as an entry field with a listbox directly below it. The user may enter textual or numeric data into the entry field in the same way as for a normal entry field, or may select an item from the listbox. The selected item will then appear in the entry field. The simple combo box provides a similar function to that of a single-selection listbox.

  • A drop-down combo box is displayed as an entry field with an icon to its immediate right. The user may enter textual or numeric data into the entry field, or may select the icon. When selected, the icon causes a listbox to appear below the entry field, containing a list of valid entries for the entry field. When selected, an item appears in the listbox. The drop-down combo box is recommended where the set of valid entries is finite and limited, but where the user may already know the required entry and may wish to save time by entering it him/herself.

  • A drop-down list combo box is displayed in a similar manner to a drop-down combo box, as an entry field with an icon to its immediate right. However, the user may not enter data directly into the entry field, but must select an item from the listbox. A drop-down list combo box is recommended in situations where a number of control windows are located in a dialog box, where the optimization of space is of primary importance, and where the default entry is likely to be used.

    The use of a combo box is typically recommended in place of a listbox in order to save room within a dialog box, or in place of an entry field where the application wishes to prompt a user with a list of valid entries.

    Radio Button

    Radio buttons are used to indicate a group of mutually exclusive options; that is, only one of the items in the group is selectable at any one time, and selecting one item automatically deselects any previously selected item. Selecting a radio button does not complete the dialog; a user may revise his/her selection any number of times during the dialog. Once a final decision is made, the user completes the dialog using a push button (see below).

    Radio buttons are always displayed in groups; it makes no sense to have a single mutually exclusive selection item. Text is displayed along with the buttons to indicate the choice represented by each button. If multiple groups of radio buttons are present within a dialog box or window, or if radio buttons are combined with other types of control window, it is recommended for reasons of clarity that the radio buttons be placed within a group box, and that this group box be named to indicate the nature or purpose of the group as a whole.

    As described above, radio buttons should be used to denote a set of mutually exclusive options in the creation or manipulation of an object, as part of a more complex dialog. They should not be used to present a set of options in response to an application or system event, where this set of options is the sole purpose of the dialog. In such cases, a message box is the preferred mechanism to achieve this type of communication with the user, since the processing overhead associated with a message box is less than that associated with a dialog box. For example, a warning that the user is about to exit the application without saving his/her latest set of changes would be presented using a message box rather than a dialog box with radio buttons.

    The equivalent function of a group of radio buttons may also be provided by a pulldown menu displaying a set of options, only one of which may be selected at any one time, with the selected item indicated by a check mark. The use of a pulldown menu is the recommended option in situations where the selection of an option is the only action to be performed. The use of radio buttons is recommended where the selection of an option indicated by the radio buttons is part of a more complex dialog.

    Note that from a programming viewpoint, "auto" radio buttons should be used in preference to standard radio buttons since these buttons are drawn and maintained by Presentation Manager. The application need not concern itself with redrawing the buttons when their state changes, thereby allowing simpler programming.

    Check Box

    A check box is used to indicate a single option that may be toggled on or off by the user. Multiple check boxes may appear in a single dialog box or window, and may refer to different attributes of the same object. However, these attributes are related to each other only by their application to that same object, and should not be mutually exclusive.

    A 3-state button is a special type of check box that, in addition to being marked selected or non-selected, may be "grayed out" to indicate that a choice is non-selectable in the current dialog. A 3-state button should be used whenever a dialog box is applicable to a range of objects, but where certain options within the dialog box are not valid for all objects dealt with by that dialog box. A 3-state button may be enabled or disabled using the WinEnableWindow() function, obtaining the window handle of the button from a WinWindowFromID() call.

    The equivalent function to a check box may be provided by a pulldown menu displaying a list of options, from which multiple items may be selected at any one time, with the selected items indicated by check marks. The use of a pulldown menu is recommended where the selection of such an option is the only action to be performed. The use of a check box or 3-state button is the preferred solution where the selection is part of a more complex dialog.

    Note that the "auto" versions of check boxes and 3-state buttons should be used in preference to the standard versions, since the auto versions are maintained by Presentation Manager, and the application need not concern itself with redrawing these buttons when their state changes.

    Push Button

    Push buttons are used to initiate an immediate action by the application. If desired, push buttons can be used in conjunction with the menu bar and context menu, to provide easy access to commonly used functions in both primary windows and action windows.

    Push buttons should not be used to form menus of selectable options that cause child windows to appear when a push button is selected. Such a practice effectively forms a hierarchical user interface, which is in violation of object-oriented user interface principles.

    An exception to this rule is a "Help" push button, which immediately displays a window containing help information, while maintaining the previous window or dialog on the screen. Dismissing the help window returns the user to the original window in which the "Help" push button was displayed.

    Slider

    The slider is used where a single value must be selected from a continuous range of options. For example, the brightness of the screen, the saturation of a color or the speed of the mouse cursor on the screen are all values selected from a continuous, though finite, range of options.

    Under previous versions of OS/2, scroll bars were often used to provide a portion of the slider's functionality. The provision of the slider control under OS/2 Version 2.0 allows the scroll bar to be used only for its intended purpose of scrolling information within a window; this improves the consistency of the user interface and removes a potential source of user confusion.

    Value Set

    The value set control is used in a similar way to a set of radio buttons, to indicate a group of mutually exclusive options. Many of the comments made for radio buttons apply equally to value sets.

    However, while the use of radio buttons is effectively limited to text items, a value set allows the use of text or graphical items, as well as color patches. Thus a value set provides additional flexibility where a selection must be made from a set of mutually exclusive options, providing a mechanism for the display of those options to the user, and allowing the user to directly select the required choice.


    [Back: Standard Dialogs]
    [Next: Message Boxes]