Important: The information in this document is obsolete and should not be used for new development.
EnableItem
Use theEnableItem
procedure to enable a menu item or a menu.
PROCEDURE EnableItem (theMenu: MenuHandle; item: Integer);
theMenu
- A handle to the menu record of the menu containing the menu item
to enable.item
- The item number of the menu item to enable, or 0 to enable the entire menu. You cannot individually enable a menu item with an item number greater than 31.
- If you specify 0 in the
item
parameter, theEnableItem
procedure enables the menu title and all items in the menu that were not previously individually disabled.DESCRIPTION
TheEnableItem
procedure enables a specified menu item so that it no longer appears dim and so that the user can choose the menu item.Note that, if you enable a menu, the
EnableItem
procedure enables the menu title but only enables those menu items that are not currently disabled as a result of your application previously callingDisableItem
and specifying each item's item number. For example, if all items in your application's Edit menu are enabled, you can disable the Cut and Copy commands individually usingDisableItem
. If you choose to disable the entire menu by passing 0 as theitem
parameter toDisableItem
, the menu and all its items are disabled. If you then enable the entire menu by passing 0 as theitem
parameter toEnableItem
, the menu and its items are enabled, except for the Cut and Copy commands, which remain disabled. In this case, to enable the Cut and Copy commands you must enable each one individually usingEnableItem
.If your application enables a menu using
EnableItem
, it should callDrawMenuBar
to update the menu bar's appearance.SEE ALSO
See "Enabling and Disabling Menu Items" on page 3-58 for examples of enabling items in a menu.