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
Name | Description |
|---|---|
Text to be displayed within the control | |
Checked indicates that a menu option is selected | |
ComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT) | |
ComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT) | |
ComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT) | |
Generic space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT) | |
ComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT) | |
ComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT) | |
Default makes a menu item the default option | |
DisplayPosition determines how components are shown | |
Enable activates/deactivates the component | |
GroupIndex creates a set of mutually exclusive options | |
Repository enrolled image to show in the control | |
MenuBreak puts the item in a new column | |
Name identifies the component Inherited from Object (PRIM_OBJT) | |
Owner owns this component Inherited from Object (PRIM_OBJT) | |
Reference to the menu containing the item | |
RadioItem makes the menu item a radio button | |
ShortCut specifies a keyboard shortcut | |
Reference to a submenu used to contain further menu items | |
Tag identifies menu items by a number | |
Tip associated with a menu item shown in the status bar | |
TipShow controls whether menu item tip is shown | |
TipShowOfParent controls whether the parents TipShow property is used | |
Show or hide the item |
Events
Name | Description |
|---|---|
Fired when the mouse is clicked on the control | |
CreateInstance is signalled when an instance of a component is created Inherited from Menu Item (PRIM_MITM) | |
DestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Menu Item (PRIM_MITM) |