4D v13.4Specifying the action of a menu |
||
|
4D v13.4
Specifying the action of a menu
Specifying the action of a menu
To enable a menu command to perform its function, you must assign either a project method or a standard action to it. These methods or standard actions perform the functions indicated by the menu commands. For example, the Monthly Report menu command can call a project method that prepares a monthly report from a table containing financial data. The Cut menu command can call the Cut standard action in order to move the selection to the clipboard and erase it from the window in the foreground. When a menu command is chosen, 4D executes the standard action or project method that is assigned to it. The choice between associating a standard action or a project method with a menu command depends on the type of result desired. In principle, it is preferable to choose a standard action whenever possible since they implement optimized mechanisms, more particularly an activation/deactivation according to the context. You can also assign both a standard action and a project method to a menu item. In this case, the standard action is never executed; however, 4D uses this action to enable/disable the menu item according to the context. When a menu item is disabled, the associated project method cannot be executed. You create the project methods in the Method editor. You can create them either before or after you assign them to the menu command. When you have assigned a method to a menu command in the Menu Bar editor, you can open this method by simply selecting the [...] button. If a menu command is not associated with a standard action or a method, when it is selected in Application mode, 4D will automatically return to the Design mode (if it is accessible). To assign a project method to a menu command:
To associate a standard action with a menu command:
|
PROPERTIES
Product: 4D SEE ALSO |