Menu Item (PRIM_MITM)

Menu item used to construct menus

Ancestors - Object (PRIM_OBJT)

Details

A menu item is used to construct Popup Menus or to provide the options on a Menu Bar.
 
A submenu is used to construct nested menu items.

Example

This example shows a simple right click menu for a list.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(897) Clientheight(404) Componentversion(2) Top(227) Left(222) Layoutmanager(#TableLayout1)
 
   Define_Com Class(#PRIM_TBLO) Name(#TableLayout1)
   Define_Com Class(#PRIM_TBLO.Column) Name(#Column1) Displayposition(1) Parent(#TableLayout1)
   Define_Com Class(#PRIM_TBLO.Row) Name(#Row1) Displayposition(1) Parent(#TableLayout1) Height(1.83)
   Define_Com Class(#PRIM_TBLO.Item) Name(#ListViewItem1) Column(#Column1) Manage(#ListView) Parent(#TableLayout1) Row(#Row1)
 
   Define_Com Class(#PRIM_LTVW) Name(#ListView) Columnbuttonheight(19) Componentversion(2) Displayposition(1) Fullrowselect(True) Height(404) Keyboardpositioning(SortColumn) Left(0) Parent(#COM_OWNER) Showsortarrow(True) Tabposition(1) Top(0) Width(897) Popupmenu(#PopupMenu)
   Define_Com Class(#PRIM_LVCL) Name(#LVCL1) Displayposition(1) Parent(#ListView) Source(#EMPNO)
   Define_Com Class(#PRIM_LVCL) Name(#LVCL2) Displayposition(2) Parent(#ListView) Source(#SURNAME)
   Define_Com Class(#PRIM_LVCL) Name(#LVCL3) Displayposition(3) Parent(#ListView) Source(#GIVENAME)
 
   Define_Com Class(#PRIM_PMNU) Name(#PopupMenu)
   Define_Com Class(#PRIM_MITM) Name(#Add) Caption('Add') Displayposition(1) Parent(#PopupMenu)
   Define_Com Class(#PRIM_MITM) Name(#Edit) Caption('Edit') Displayposition(2) Parent(#PopupMenu)
   Define_Com Class(#PRIM_MITM) Name(#Delete) Caption('Delete') Displayposition(3) Parent(#PopupMenu)
 
   Evtroutine Handling(#Com_owner.CreateInstance)
 
      Select Fields(#ListView) From_File(Pslmst)
 
         Add_Entry To_List(#ListView)
 
      Endselect
 
   Endroutine
 
End_Com

Properties

NameDescription
CaptionText to be displayed within the control
CheckedChecked indicates that a menu option is selected
ComponentClassNameComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)
ComponentMembersComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)
ComponentPatternNameComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)
ComponentTagGeneric space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)
ComponentTypeComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)
ComponentTypeNameComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)
DefaultDefault makes a menu item the default option
DisplayPositionDisplayPosition determines how components are shown
EnabledEnable activates/deactivates the component
GroupIndexGroupIndex creates a set of mutually exclusive options
ImageRepository enrolled image to show in the control
MenuBreakMenuBreak puts the item in a new column
NameName identifies the component Inherited from Object (PRIM_OBJT)
OwnerOwner owns this component Inherited from Object (PRIM_OBJT)
ParentReference to the menu containing the item
RadioItemRadioItem makes the menu item a radio button
ShortCutShortCut specifies a keyboard shortcut
SubMenuReference to a submenu used to contain further menu items
TagTag identifies menu items by a number
TipTip associated with a menu item shown in the status bar
TipShowTipShow controls whether menu item tip is shown
TipShowOfParentTipShowOfParent controls whether the parents TipShow property is used
VisibleShow or hide the item

Events

NameDescription
ClickFired when the mouse is clicked on the control
CreateInstanceCreateInstance is signalled when an instance of a component is created Inherited from Menu Item (PRIM_MITM)
DestroyInstanceDestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Menu Item (PRIM_MITM)

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2