An optional on clause allows you to customize the response to the user's selection of an object or an object in a class, using the following on clauses:
•on activate
•on button1 down
•on button1 double click on close
•on validation
•on validation failure
Use the on clause to define a customized response, when the user:
•Activates the region (on activate).
•Clicks on the object once with the primary mouse selection button (on button1 down).
•Double-clicks on the object with the primary mouse selection button (on button1 double click).
•Selects the "Close" choice from the system menu, or double- clicks on the system menu (on close).
•Selects one of the validation choices.
When the object is selected, ESL responds by executing the action statements and/or on clauses specified in the response definition. The response will be invoked only if the object is selectable (enabled) at the time that it is selected. If you do not specify an on clause, ESL invokes the response associated with the selected object.
A response can contain one or more of the on clauses in any order. However, a given response can contain no more than one of each type. For example, only one on close clause is allowed in any one response.
An on button1 double click is always preceded by an on button1 down event. The corresponding actions for on button1 down or the generic response to... are invoked before the actions for on button1 double-click are invoked.
The on activate response statement is invoked when a region becomes the active region as a result of a user selecting it, or one of its children, with the mouse or the keyboard. If a region is activated due to the execution of an ESL statement, the on activate response for that region is not invoked. An on activate response is not invoked when a region is first created.
The ESL compiler will accept any on clause syntax for any response to an object or class name. However, note that some object/on-clause combinations are not useful, and will never be executed. (Refer to the table in response to OBJECT Response Definition in the Reference Guide for meaningful combinations.)