Submenu (PRIM_SMNU)

Submenu used for nesting menu items

Ancestors - Base Menu (PRIM_MENU) Object (PRIM_OBJT)

Details

A Submenu collects Menu Items and is used to create nesting within the menu.
 
Any Menu Item can have a submenu.

Example

In this example a menu bar has 2 items and 2 submenus. The third item in the second menu also has a submenu.
Function Options(*DIRECT)
Begin_Com Role(*EXTENDS #PRIM_FORM) Clientwidth(861) Clientheight(384) Componentversion(2) Top(227) Left(222) Menubar(#MenuBar1)
 
   Define_Com Class(#PRIM_MBAR) Name(#MenuBar1) Parent(#COM_OWNER)
 
   Define_Com Class(#PRIM_MITM) Name(#MenuItem1) Caption('Item1') Displayposition(1) Parent(#MenuBar1)
   Define_Com Class(#PRIM_SMNU) Name(#SubMenu1) Parent(#MenuItem1)
   Define_Com Class(#PRIM_MITM) Name(#MenuItem2) Displayposition(1) Parent(#SubMenu1) Caption('Item1_1')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem3) Displayposition(2) Parent(#SubMenu1) Caption('Item1_2')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem4) Displayposition(3) Parent(#SubMenu1) Caption('Item1_3')
 
   Define_Com Class(#PRIM_MITM) Name(#MenuItem5) Displayposition(2) Parent(#MenuBar1) Caption('Item2')
   Define_Com Class(#PRIM_SMNU) Name(#SubMenu2) Parent(#MenuItem5)
   Define_Com Class(#PRIM_MITM) Name(#MenuItem6) Displayposition(1) Parent(#SubMenu2) Caption('Item2_1')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem7) Displayposition(2) Parent(#SubMenu2) Caption('Item2_2')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem8) Displayposition(3) Parent(#SubMenu2) Caption('Item2_3')
 
   Define_Com Class(#PRIM_SMNU) Name(#SubMenu3) Parent(#MenuItem8)
   Define_Com Class(#PRIM_MITM) Name(#MenuItem9) Displayposition(1) Parent(#SubMenu3) Caption('Item2_4')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem10) Displayposition(2) Parent(#SubMenu3) Caption('Item2_5')
   Define_Com Class(#PRIM_MITM) Name(#MenuItem11) Displayposition(3) Parent(#SubMenu3) Caption('Item2_6')
 
End_Com

Properties

NameDescription
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)
ItemsCollection of items in the component Inherited from Base Menu (PRIM_MENU)
NameName identifies the component Inherited from Object (PRIM_OBJT)
OwnerOwner owns this component Inherited from Object (PRIM_OBJT)
ParentReference to the menu containing the Submenu
TipShowTipShow controls whether menu item tips are shown. Inherited from Base Menu (PRIM_MENU)

Events

NameDescription
CreateInstanceCreateInstance is signalled when an instance of a component is created Inherited from Base Menu (PRIM_MENU)
DestroyInstanceDestroyInstance is signalled when an instance of a component is about to be destroyed Inherited from Base Menu (PRIM_MENU)
PreparePrepare event can be used to display context sensitive menus Inherited from Base Menu (PRIM_MENU)
Context

See also

All Component Classes

Technical Reference

Febuary 18 V14SP2