The following tasks are associated with using an IMenuItem*
part in visual composition. Tasks that are common to many parts
are described in related topics.
-
- Defining text for a menu item
- To define text for the menu item, do either of the
following:
- On the composition surface, directly edit the
part text.
- In the part property sheet, enter the text in the
value column of the text property.
- Defining a mnemonic
- If you want to establish a mnemonic for the menu item,
type a tilde (~) before the mnemonic character in the
menu item text. For Windows, VisualAge maps the tilde to
an ampersand (&). If you type an ampersand, the
mnemonic is not portable.
- Assigning a bitmap
- To assign a bitmap to the menu item instead of using
text, set the bitmap property in the IMenuItem*
property sheet. In the Resource Id prompter property
window, specify a bitmap resource by setting the
following fields:
- Dll name to identify the DLL containing
the bitmap
- Id to identify the ID of the bitmap
- Defining an accelerator
- To define an accelerator for the menu item, set the Accelerator
key property in the IMenuItem* property sheet. Define
the accelerator in the prompter for the value column.
- Defining menu help information
- You can define help information about the menu item. This
text appears in the frame window information area when
the user selects the menu choice. To define help
information for the menu item, set the Info area text
property in the IMenuItem* property sheet. Enter the text
in the value column.
- Preselecting the choice
- To preselect the menu item, set the checked
property in the IMenuItem* property sheet. Select true
in the value column.
- Moving a menu item
- To move the menu item within your menu, drag the
IMenuItem* part to a new location in the IMenu* part.
- Setting the initial state
- To specify whether the menu item is initially enabled,
set the disabled property in the IMenuItem*
property sheet.
- To initially disable the menu item, select true.
- To initially enable the menu item, select either <default>
or false.
- Disabling a menu item
- To disable the menu item when an event occurs, such as
selection of another item, connect the event to the
IMenuItem* disable action.
- Enabling a menu item
- To enable the menu item when an event occurs, such as
selection of another item, do the following:
- Connect the event to the IMenuItem* enable
action.
- The enable action enables the part by
default. If you have changed this default, open
settings for the connection, select Set
parameters, and set the parameter value to true.
- Calling an action from a menu item
- To start an action when the user selects the menu item,
connect the IMenuItem* commandEvent feature to the
target action.
Setting Part Style Properties
Editing Part Labels Directly
Working with VisualAge User
Interface Parts
IMenuItem
Property Settings --
IMenuItem
Portability -- IMenuItem