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.

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 delete instruction (as opposed to making it invisible). Deleted menus cannot be reinstated. If the deleted menu item is a popup menu, all members of that popup menu are also deleted.

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 allControlChildren and MenuItem class children properties), the only methods that are implemented are at (which allows the use of square brackets to access the elements), createIterator (which allows logic to do a foreach over the array), size, and size64.

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)