Next: Constructors
Up: PopupMenu
Previous: PopupMenu
PopupMenu is used by the Mouse class, and perhaps other
components. A PopupMenu contains a list of elements, which are used
to create a menu of commands. There are two types of elements, `normal'
elements which consist of a name and an associated text command, and
`special' elements which modify the appearance or behavior of the menu.
Each element has these characteristics:
- Name (as it appears in the menu).
- Text command to execute when the item is selected (may be null).
- Return code: this is an integer code which is returned by the
windowing system when the item is picked. It is assigned by
PopupMenu, and for all regular menu items, it is greater than 0.
There are several ``special'' return codes, which indicate the menu
item is not a normal menu . These special return codes include:
- MENU_CODE_SUBMENU: the menu item contains a submenu.
- MENU_CODE_SEP: the menu item is really a separator.
- MENU_CODE_NONE: the menu item cannot be selected, it just
exists to display text.
- A submenu object, if any (only if the return code indicates the
element contains a submenu).
- Flags to indicate if the menu item should be displayed, or if
it should be disabled (greyed out) if possible.
A PopupMenu relies on a specific windowing system to provide the methods
for creating, posting, and activating a menu. It contains a list of
pop-up items, each item containing the
characteristics listed above. A menu is a list of these, and has a name
associated with the total list as well as with each item.
Justin Gullingsrud
Tue Apr 6 09:26:48 CDT 1999