version 11 (Modified)
INSERT MENU ITEM (menu; afterItem; itemText{; subMenu{; process}})
Parameter | Type | Description | |
menu | Number | MenuRef | Menu number or Menu reference | |
afterItem | Number | Menu item number | |
itemText | String | Text for the menu item to be inserted | |
subMenu | MenuRef | Reference of submenu associated with item | |
process | Number | Process reference number |
Description
The INSERT MENU ITEM command inserts new menu items into the menu whose number or reference is passed in menu after the existing menu item whose number is passed in afterItem.
If you omit the process parameter, INSERT MENU ITEM applies to the menu bar for the current process. Otherwise, INSERT MENU ITEM applies to the menu bar for the process whose reference number is passed in process.
Note: If you pass a MenuRef in menu, the process parameter serves no purpose and will be ignored.
INSERT MENU ITEM allows to you insert one or several menu items in one call.
INSERT MENU ITEM works like APPEND MENU ITEM, except that it enables you to insert items anywhere in the menu, while APPEND MENU ITEM always adds them at the end of the menu.
See the description of the APPEND MENU ITEM command for details about the the item definition passed in itemText.
The optional subMenu parameter can be used to indicate a menu as the added item and thus position a hierarchical submenu. You must pass a menu reference (MenuRef type string) specifying a menu created, for example, using the Create menu command. If the command adds more than one menu item, the submenu is associated with the first item.
Important: The new items do not have any associated methods or actions. These must be associated with the items using the SET MENU ITEM PROPERTY or SET MENU ITEM METHOD commands, or the items can also be managed from within a form method using the Menu selected command.
Example
The following example creates a menu consisting of two commands to which it assigns a method:
menuRef:=Create menu APPEND MENU ITEM(menuRef;"Characters") SET MENU ITEM METHOD(menuRef;1;"CharMgmtDial") INSERT MENU ITEM(menuRef;1;"Paragraphs") SET MENU ITEM METHOD(menuRef;2;"ParaMgmtDial")
See Also
APPEND MENU ITEM, SET MENU ITEM REFERENCE.