TatScripterEventBroker Class
For event support.
Remarks
TatScripterEventBroker provides methods to set and remove event handlers, specifying the object, event name, and the script routine that should handle the event. The broker also implements a stack mechanism: setting a new handler does not necessarily discard the previous one -- the previous handler can optionally be kept in the call chain.
When an event set by the broker is removed, the previous handler is automatically restored.
Syntax
Unit: atScript
TatScripterEventBroker = class(TComponent);
Methods
| Name | Description |
|---|---|
| GetAssignedRoutineName | Returns the name of script routine currently assigned to be the handler of the object's event. |
| SetEvent | Sets a new event handler for a Delphi object's event. |
| UnsetAllEvents | Unset all events assigned by this event broker. See UnsetEvent for more details. |
| UnsetEvent | Unsets an event handler for a Delphi object's event which was previously set with SetEvent. |
| UnsetEvents | Remove all event handlers set in the object AInstance for the event specified by APropName. See UnsetEvent method for more information. |
Properties
| Name | Description |
|---|---|
| Dispatchers | Holds the list of current event dispatcher. An event dispatcher is created for each event set. See TatEventDispatchers for more info. |
| EventAdapters | Holds a list of event adapters registered in scripting system. This is just a pointer to the global variable EventAdapters. |
Events
| Name | Description |
|---|---|
| OnExecuteEvent | OnExecuteEvent is fired whenever an event is fired in Delphi object and handled by the dispatcher. |
| OnSetEvent | OnSetEvent is fired when an event is set by the event broker. |
| OnSettingEvent | OnSettingEvent is fired when an event is about to be set by the event broker. |
| OnUnsettingEvent | OnUnsettingEvent is fired when an event is about to be unset by the event broker. |