MenuItem Class
The MenuItem class contains the definition of each menu item (command) on a menu. A menu for a form is constructed in the JADE development environment, by using the Menu Design window in the JADE Painter. You cannot add a subclass to the MenuItem class.
A menu can include items, submenu titles, and separator bars. A menu can have submenu items. Define menu items with names to which they can be referred at run time.
Menus are displayed in four columns: check mark, picture, text, and shortcut text. The width of the picture, text, and shortcut text columns is set to the maximum width of all the menu items in the popup menu that is being displayed.
Menus are drawn in the .NET style. A menu is drawn with a left gutter border and draws the selected background using the current Windows theme set. In addition, menus activated from the form’s menu are drawn as though the form menu item is part of the activated menu. The form’s menu bar is also drawn using the current Windows theme. The exception to this is when a skin is currently active for the form, in which case the skin definition of any menu elements is still used instead.
Menu items are generated as static text for HTML on Web pages. All menu items that have an associated click event also have a HyperText link.
Each menu item can be defined with the following set of attributes.
-
A separator (all other properties are then ignored).
-
A check mark can be displayed to the left of a menu item. The default value is none. Menu items that are popup menus or top-level items ignore this attribute.
-
A picture, displayed after the check mark.
-
A caption, displayed after the picture.
-
Although you cannot assign a shortcut key to top-level and popup menus, other menu items can have a shortcut key assigned to them, with a default value of none. The menu item executes its click event logic when the shortcut key is pressed. A textual description of the key is displayed after the caption.
-
Can be enabled (the default) or disabled (the caption will be gray, or dimmed). If the item has subitems, the menu does not drop down when selected.
-
Can be initially visible (the default) or hidden. If the item has subitems, then they are also hidden.
-
A context-sensitive help identifier (helpContextId) or keyword (helpKeyword).
-
One top-level menu item can have a standard set of help items added to it, by checking the Help list option. This list includes an Index entry for the help file of the application and an About box for the application. No logic is required to handle these options. These entries can be moved and deleted, but they cannot be altered. The Help menu item is moved to the end of the top menu items at run time.
-
One top-level menu item can also have a standard set of items added to it for MDI window control, by checking the Window list option. This list includes the ability to cascade, tile, or arrange the icons, and create a new copy of an MDI form. No logic is required to handle these options. These entries can be moved and deleted, but they cannot be altered.
These options are ignored if they are included in the menu for a non-MDI form. The Window menu item is moved to the end of the top menu items (but before any Help item) at run time. (Alternatively, you can make an MDI child form invisible if you do not want to include it in the list of currently open MDI forms.)
When you create a Multiple-Document Interface (MDI) application, the menu bar on the MDI child form replaces the menu bar on the MDI form when the child form is active.
Menu items and submenu items can be loaded at run time, by using the loadMenu and loadSubMenu methods, respectively. The loaded menu items can then be accessed by using the getMenuItem method.
A menu item can be deleted at run time, by using the
If you invoke the JADE Debugger while processing JADE menu logic, Windows discards subsequent menu actions. For example, if you break in the click event of a popup menu, the menu is not displayed.
An exception is raised if a MenuItem method is invoked from a server method.
For the arrays associated with control and menu item children (for example, the Window class
For details about adding user‑defined event methods for menu items to handle populating or refreshing the state of each in a recursive manner, see "Adding User‑defined Event Methods to a Menu Item", later in this section.
For details about the constants, properties, methods, and events defined in the MenuItem class, see "MenuItem Class Constants", "MenuItem Properties", "MenuItem Methods", and "MenuItem Events", in the following subsections.
MenuItemData
(None)