The Menu Item

Main Characteristics of Menu Item Objects

Appearance on Form

 

Menu item objects deliver both the visual and behavioral characteristics of menu objects. Menu items can be owned directly by the menu. In this case they appear on the menu "bar". A menu item owned by the menu can itself own other menu items. This enables menu lists to be constructed. Even menu items in a list can own other menu items. This enables "cascading" menu structures to be constructed. Menus thus provide a flexible mechanism for enabling the application end-user to control the execution flow through an application. Although the selection of a particular menu item is generally interpreted by the application program, many predefined system actions can also be associated with menu items. Menu items can also be defined to exhibit the "On/Off" binary state condition. To inspect the attributes supported by the painter for menu item objects, display the Edit Menu Item dialog by double clicking on the menu item. The Zim language includes a suite of commands for dynamically modifying both the visual and behavioral characteristics of menu item objects.

Menu Item Attributes

Identification

Attribute Name Default Value Description
Field Type - The type of this form field or of this user interface object. (Read-only).
Item Name - A string that identifies this menu item within the Zim application;
Automatically assigned by the Zim IDE as a copy of the menu item's Text attribute, when a new menu item is created;
May be modified by the developer;
Must always conform to the Zim Object Naming Rules and satisfy the Zim Object Uniqueness Conditions.
Item Number 0 A number that may be used to identify this menu item within the Zim application and in Callback Events;
May be changed by the developer and need not be unique.
Item Tag "" A string that may be used to identify this menu item within the Zim application and in Callback Events;
May be changed by the developer and need not be unique;
If left blank, the Zim IDE will assign the value of Item Name to Item Tag.
Directory ZIM The directory that owns the parent menu of this menu item (Read-only).
Help Message "" A help message that will be displayed when this form field or this menu item receives input focus;
Displayed in the status bar of the window associated with the parent form of this form field (if the window object's Status Bar attribute is set to True);
Displayed in a message field if one such field exists in the parent form of this form field.
Menu Name - A string that identifies the parent menu object of this menu item (Read-only).

 

Color

Attribute Name Default Value Description
Inherit Background Color variable True →  The form field or container will inherit the background color of its parent container or parent form object.
Inherit Foreground Color variable True →  The form field or container will inherit the foreground color of its parent container or parent form object.

 

Properties

Attribute Name Default Value Description
Associated Action User-Defined  
Availability Available The way in which the end-user will interact with this form field:
Available →  This form field can receive input focus and its contents can be modified;
Unavailable →  This form field cannot receive input focus and its contents cannot be modified;
Guarded →  This form field can receive input focus but its contents cannot be modified;
Protected →  This form field cannot receive input focus, its contents cannot be modified and it will appear grayed-out;

 

Style

Attribute Name Default Value Description
Item Style Text Item Horizontal Separator →  This menu item will appear as a horizontal line as wide as the longest menu item in the same submenu;
Text Item →  This menu item will appear as a text string, which is defined in the Text attribute;
Note: Menu items on the menu bar can only be Text Items.

 

Tool Bar Options

Attribute Name Default Value Description
Image File "" The image file that will be displayed inside the menu item;
Selected by clicking and browsing the file system;
Note:
This attribute is only available when Image Type = User-Defined.
Image Type Predefined The type of image that will be displayed in this menu item:
Predefined →  The image can be selected from the Predefined Image drop-down list.
User-Defined →  The image can be selected through the Image File attribute.
Predefined Images List "" A list of predefined icons that may be used for this menu item.
Tool Bar Name "" The tool bar name associated with this menu item object.