A SERVICE OF

logo

344 Chapter 15: Creating a Custom iTool Widget Interface
Adding Menus iTool Developer’s Guide
Adding Menus
iTool menus are created using the CW_ITMENU compound widget. The signature of
the CW_ITMENU function is:
Result = CW_ITMENU(Parent, UI, Target [, KEYWORDS])
where:
Parent is the widget ID of the base widget on which the menu will be
displayed.
UI is the user interface object associated with the interface.
Target is the iTool identifier, relative to the iTool associated with UI, of the
container whose operations should be included in the menu.
KEYWORDS are keywords either handled explicitly by the widget, or passed
through to the widgets that make up the compound widget.
Standard Menus
Operations registered in the iTool containers that create the standard menus are
automatically sensitized and desensitized to reflect whether the individual operation
can be applied at the time the menu is displayed. Some items are sensitized when the
selected item is of the correct data or visualization type, others (such as
Undo and
Redo) are sensitized when some other criteria are met. Still others (such as the Open
operation on the
File menu) are always available.
The following statements create the menus used by the standard iTools:
wFile = CW_ITMENU(wMenubar, oUI, 'Operations/File')
wEdit = CW_ITMENU(wMenubar, oUI, 'Operations/Edit')
wInsert = CW_ITMENU(wMenubar, oUI, 'Operations/Insert')
wOperations = CW_ITMENU(wMenubar, oUI, 'Operations/Operations')
wWindow = CW_ITMENU(wMenubar, oUI, 'Operations/Window')
wHelp = CW_ITMENU(wMenubar, oUI, 'Operations/Help')
You can include any subset of these menus, or your own menus, in your interface.
Modifying Menu Contents
Each iTool menu contains an entry for each item that is registered in the container.
This has two ramifications: