Menu Item

This document covers the following topics:


Description

A menu item is an item inside a menu bar or a submenu control. It is a child of a menu bar or a submenu control.

There are several types of menu items (values of the attribute MENU-ITEM-TYPE). Menu items of type MT-NORMAL trigger the click-event handler when an end user clicks on them. The MT-SUBMENU type of menu item is associated with a submenu control, which is pulled down when an end user clicks on the menu item.

It is not recommended to define menu items of type MT-NORMAL on the first level of a menu bar. Instead, you should define menu items of type MT-SUBMENU. When you give a name to a menu item by setting the STRING attribute to a name used by the windowing system, such as "Cascade", you must not modify this STRING value dynamically.

Attributes for Menu Item

Attribute Name Query Set/Modify In Attr. Window
ACCELERATOR X X/X X
BACKGROUND-COLOUR-NAME X X/X X
BACKGROUND-COLOUR-VALUE X X/X X
BITMAP-FILE-NAME X X/X X
CHECKED 1) X X/X X
CLIENT-DATA 2) X X/X  
CLIENT-HANDLE X X/X  
CLIENT-KEY X X/X  
CLIENT-VALUE X X/X  
DIL-TEXT 2) X X/X X
ENABLED 3) X X/X X
FIRST-CHILD X -/-  
LAST-CHILD X -/-  
MENU-HANDLE 4) X X/-  
MENU-ITEM-OLE X X/X  
MENU-ITEM-TYPE 5) X X/- X
PARENT X X/-  
PREDECESSOR X -/-  
SAME-AS X X/X X
SHARED X X/X X
STRING 3) X X/X X
STYLE X X/- X
SUCCESSOR X -/-  
TOOLTIP X -/-  
TYPE X X/-  

1) For MENU-ITEM-TYPE = MT-NORMAL only. Not for menu items inside the menu bar.

2) For MENU-ITEM-TYPEs MT-NORMAL and MT-MDI only.

3) Not for MENU-ITEM-TYPE = MT-SEPARATOR.

4) For MENU-ITEM-TYPEs MT-SUBMENU and MT-WINDOWMENU only.

5) If MENU-ITEM-TYPE = MT-WINDOWMENU, the menu item must be inside the menu bar (at the top level).

Events

Click Event.