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

Caption

Text to be displayed within the control

Checked

Checked indicates that a menu option is selected

ComponentClassName

ComponentClassName is the name of the component's class. Inherited from Object (PRIM_OBJT)

ComponentMembers

ComponentMembers provides access to all the member components of this component Inherited from Object (PRIM_OBJT)

ComponentPatternName

ComponentPatternName is used to qualify the class of the component. Inherited from Object (PRIM_OBJT)

ComponentTag

Generic space allowing a value to be stored for the instance Inherited from Object (PRIM_OBJT)

ComponentType

ComponentType gives you access to the type information about the component Inherited from Object (PRIM_OBJT)

ComponentTypeName

ComponentTypeName is the fully qualified name of the component's class. Inherited from Object (PRIM_OBJT)

Default

Default makes a menu item the default option

DisplayPosition

DisplayPosition determines how components are shown

Enabled

Enable activates/deactivates the component

GroupIndex

GroupIndex creates a set of mutually exclusive options

Image

Repository enrolled image to show in the control

MenuBreak

MenuBreak puts the item in a new column

Name

Name identifies the component Inherited from Object (PRIM_OBJT)

Owner

Owner owns this component Inherited from Object (PRIM_OBJT)

Parent

Reference to the menu containing the item

RadioItem

RadioItem makes the menu item a radio button

ShortCut

ShortCut specifies a keyboard shortcut

SubMenu

Reference to a submenu used to contain further menu items

Tag

Tag identifies menu items by a number

Tip

Tip associated with a menu item shown in the status bar

TipShow

TipShow controls whether menu item tip is shown

TipShowOfParent

TipShowOfParent controls whether the parents TipShow property is used

Visible

Show or hide the item

Events

Name

Description

Click

Fired when the mouse is clicked on the control

CreateInstance

CreateInstance is signalled when an instance of a component is created Inherited from Menu Item (PRIM_MITM)

DestroyInstance

DestroyInstance 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

  • No labels