version 6.0
DR ON MENU (area; method)
| Parameter | Type | Description | |
| area | Longint | 4D Draw area (-1=all areas) | |
| method | String | Name of the method to call |
Description
The command DR ON MENU executes method each time a menu item is activated, in either the User or Runtime environment. The menu item can also be called by using the DR DO COMMAND command, as long as the menu item is called in method.
The called method returns three parameters:
| $1 | A Long integer containing the ID for the 4D Draw area |
| $2 | A Long integer containing the menu item number |
| $3 | A Long integer containing the number of the modifier key pressed |
The $3 parameter corresponds to one of the following modifier keys (or combination of modifier keys):
| MacOS | Windows | |
| 0 | No modifier | No modifier |
| 1 | Command key | Ctrl key |
| 2 | Shift key | Shift key |
| 4 | Option key | Alt key |
| 8 | Control key |
If a combination of modifier keys is pressed, the values are added together and passed as a parameter. For example, a value of 10 indicates that you pressed the Shift and Control keys while selecting a menu item.
Note: If you compile your database, you must declare the $1, $2, and $3 parameters as Long integers in the method executed by DR ON MENU.