4D v13.4

INSERT MENU ITEM

Home

 
4D v13.4
INSERT MENU ITEM

INSERT MENU ITEM 


 

INSERT MENU ITEM ( menu ; afterItem ; itemText {; subMenu {; process}}{; *} ) 
Parameter Type   Description
menu  Longint, MenuRef in Menu number or Menu reference
afterItem  Longint in Menu item number
itemText  String in Text for the menu item to be inserted
subMenu  MenuRef in Reference of submenu associated with item
process  Longint in Process reference number
Operator in If passed: consider metacharacters as standard characters

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, the command 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.

If you do not pass the * parameter, 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 item definition passed in itemText and about the action of the * parameter.

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")

 
PROPERTIES 

Product: 4D
Theme: Menus
Number: 412

Not for server

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D v11 SQL Release 4

 
SEE ALSO 

APPEND MENU ITEM
SET MENU ITEM PARAMETER