4D v13.4

SET MENU ITEM PROPERTY

Home

 
4D v13.4
SET MENU ITEM PROPERTY

SET MENU ITEM PROPERTY 


 

SET MENU ITEM PROPERTY ( menu ; menuItem ; property ; value {; process} ) 
Parameter Type   Description
menu  Longint, MenuRef in Menu reference or menu number
menuItem  Longint in Number of menu item or -1 for the last item added to the menu
property  String in Property type
value  Expression in Property value
process  Longint in Process number

The SET MENU ITEM PROPERTY command sets the value of the property for the menu item designated by the menu and menuItem parameters.

You can pass -1 in menuItem to specify the last item added to menu.

In menu, you can pass a menu reference (MenuRef) or a menu number. If you pass a menu reference, the command will apply to all the instances of the menu in all the processes. In this case, the process parameter is ignored if it is passed. If you pass a menu number, the command will take the corresponding menu in the main menu bar of the current process into account. If you want to designate another process, pass its number in the optional process parameter.

In the property parameter, pass the property whose value you want to modify and pass the new value in value. For the property parameter, you can use one of the constants of the “Menu Item Properties” theme or any custom value:

Standard property: The constants of the “Menu Item Properties” theme as well as their possible values are described below. Note that in the case of the Associated Standard Action property, you can pass one of the constants of the “Value for Associated Standard Action” theme in the value parameter:

Constant Type Value Comment
Access Privileges String 4D_access_group Assign an access group to the command
0 = All Groups
>0 = Group ID
Associated Standard Action String 4D_standard_action Associate a standard action with a menu item
See the constants of the Value for Associated Standard Action theme
Start a New Process String 4D_start_new_process Activate the "Start New Process" option
0 = No, 1 = Yes

Here are the constants for the “Value for Associated Standard Action” theme:

Constant Type Value
Accept Action Longint 2
Add subrecord Action Longint 14
Cancel Action Longint 1
Clear Action Longint 21
Copy Action Longint 19
Cut Action Longint 18
Database Settings Action Longint 32
Delete record Action Longint 7
Delete subrecord Action Longint 13
Edit subrecord Action Longint 12
First page Action Longint 10
First record Action Longint 5
Last page Action Longint 11
Last record Action Longint 6
MSC Action Longint 36
Next page Action Longint 8
Next record Action Longint 3
No Action Longint 0
Paste Action Longint 20
Previous page action Longint 9
Previous record Action Longint 4
Quit Action Longint 27
Redo Action Longint 31
Return to Design mode Longint 35
Select all Action Longint 22
Show Clipboard Action Longint 23
Test Application Action Longint 26
Undo Action Longint 17

For more information about standard menu item properties, refer to the “Building menus” section of the Design Reference manual.

Custom property: In property, you can pass any custom text and associate a value of the text, number or Boolean type with it. This value will be stored with the item and can be retrieved using the GET MENU ITEM PROPERTY command. You can use any custom string in the property parameter, simply make sure not to use a title used by 4D (by convention, properties set by 4D begin with “4D_”).

Note: If the menu item corresponds to the title of a hierarchical sub-menu, the standard action will not be called when the menu item is selected.

 
PROPERTIES 

Product: 4D
Theme: Menus
Number: 973

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D v11 SQL

 
SEE ALSO 

GET MENU ITEM PROPERTY