CT ON EVENT

4D - Documentation   Français   English   German   4D Chart, Command Theme List   4D Chart, Command Alphabetical List   Back   Previous   Next

version 1


CT ON EVENT (method)

ParameterTypeDescription
methodStringMethod to execute

Description

The CT ON EVENT command executes method whenever a previously specified event occurs. The events that cause method to execute are described by the CT EVENT FILTER command.

If method is an empty string, no method is executed. If the area in which the event occurs has both an object method and an event method, the object method executes last. CT ON EVENT is especially useful for 4D Chart areas in plug-in windows because they cannot have object methods.

When 4D Chart calls method, it returns four parameters ($1, $2, $3, and $4) that can be used to manage the event.

ParameterTypeDescription
$1LongintRepresents the 4D Chart area in which
the event took place.
$2LongintHolds the event code. Equivalent of
a call to CT Last event.
$3LongintTable number of the form on which
the area resides. If $3 equals -1, the area
is in a plug-in window.
$4LongintNumber of the field into which the area
is being autosaved. If $4 equals 0, the area
is not being autosaved.

If you plan to compile your database, you should declare these parameter types as follows:

   C_LONGINT ($1;$2;$3;$4)

Example

This example shows the installation of an event method. It opens a plug-in window, specifies Ctrl+click as the event (Command-click on Macintosh), and then installs the event method EventProc.

      `Open plug-in window
   vArea := Open external window (20;50;400;350;0;"Chart";"_4D Chart")
      `Install the method EventProc   
   CT ON EVENT ("EventProc")   
      `Ctrl+click will call the method
   CT EVENT FILTER (vArea;64)   

See Also

CT EVENT FILTER, CT Last event.


4D - Documentation   Français   English   German   4D Chart, Command Theme List   4D Chart, Command Alphabetical List   Back   Previous   Next