Indicating Selected Items

A pulldown menu may be used to display a list of options from which one or more items may currently be selected; for example, a pulldown menu might provide a list of fonts to be used by a word-processing or desktop publishing application. SAA CUA guidelines stipulate that in such a case, the currently selected item or items within the pulldown menu should be indicated by a check mark next to the item. Presentation Manager provides support for this convention by allowing a check mark to be displayed within the pulldown menu. This is achieved using the WinCheckMenuItem() function; Figure "Placing a Check Mark on a Pulldown Menu Item" shows how to place a check mark next to the item MI_OPTION1.

Note that the WinCheckMenuItem() function is new in OS/2 Version 2.0; previous versions of OS/2 required the use of a WinSendDlgItemMsg() function call to send an MM_SETITEMATTR message to the menu.

If a checked item is selected for a second time, the check mark should be removed by the application. This is achieved by sending the same message to the menu bar, with FALSE specified for the last attribute in the function call.

Note that the use of a check mark in a pulldown menu provides an alternative to the use of radio buttons or check boxes in simple dialogs. See Use of Control Windows for further information. When a pulldown menu with a check mark is used to display more than one set of mutually exclusive items, each set should be separated by a horizontal bar in the pulldown menu. See Presentation Manager Resources.


[Back: Enabling/Disabling Items]
[Next: Action Windows]