Important: The information in this document is obsolete and should not be used for new development.
EnableItem
Use theEnableItemprocedure 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
itemparameter, theEnableItemprocedure enables the menu title and all items in the menu that were not previously individually disabled.DESCRIPTION
TheEnableItemprocedure 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
EnableItemprocedure enables the menu title but only enables those menu items that are not currently disabled as a result of your application previously callingDisableItemand 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 theitemparameter toDisableItem, the menu and all its items are disabled. If you then enable the entire menu by passing 0 as theitemparameter 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 callDrawMenuBarto 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.