4D Chart v13

CT ON MENU

Home

 
4D Chart v13
CT ON MENU

CT ON MENU 


 

CT ON MENU ( area ; method ) 
Parameter Type   Description
area  Longint in 4D Chart area
method  String in Name of the method to call

The CT ON MENU command executes method each time a menu command is activated in either the User or Custom Menus environments. The menu command can also be called by using the CT DO COMMAND command, as long as the menu command is called in method.

  • The called method returns three parameters:
    ParameterDescription
    $1A Long integer containing the ID for the 4D Chart area.
    $2A Long integer containing the menu item number.
    $3A 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):
    ValueModifier Key
    0No modifier
    1Ctrl (Windows) or Command (Macintosh) key
    2Shift key
    4Alt (Windows) or Option (Macintosh) key
    8Control key (Macintosh)
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 the user held down the Shift and Control keys while choosing a menu item

If you plan to compile your database, you should declare the types of these parameters, as follows:
 C_LONGINT($1;$2;$3)

Example  

This example launches the MenuProc event method.

 CT ON MENU(Area;"MenuProc")

The MenuProc method controls the user’s access to menu commands. If either the Save as Template or Properties menu command is selected, the user is presented with an alert and the menu selection is ignored. All other menu items are executed without interruption.

Following is the code for the MenuProc method.

 C_LONGINT($1;$2;$3)
 Case of
    :($2=1006) &NBSP`Save as Template
       ALERT("You cannot save templates.")
    :($2=2011) &NBSP`Properties
       ALERT("You do not have access to Properties.")
    Else
       CT DO COMMAND(vArea;$2)
 End case

 
PROPERTIES 

Product: 4D Chart
Theme: CT Area Control
Number: 14517

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: 4D Chart 1

 
SEE ALSO 

Command Codes