TatScripterEventBroker.SetEvent Method
Sets a new event handler for a Delphi object's event.
Syntax
Unit: atScript
function TatScripterEventBroker.SetEvent(AInstance: TObject; APropName: string; ARoutineName: string; AScripter: TatCustomScripter; APlacement: TatEventPlacement; AScript: TatScript = nil): TatEventDispatcher;
Parameters
| <-> | Parameter | Type | Description |
|---|---|---|---|
| AInstance | TObject | Contains the instance of the object for which the event will be set, for example, a button object | |
| APropName | string | Contains the name of the event to be set, for example, 'OnClick' | |
| ARoutineName | string | Contains the name of the script routine name that will handle the event, for example, 'Button1Click' | |
| AScripter | TatCustomScripter | Contains the scripter object which holds the script containing the routine | |
| APlacement | TatEventPlacement | Indicates how this new event will replace the existing one | |
| AScript | TatScript | Optional: Default value is nil Contains the script object which holds the routine. If AScript is nil, the current script of scripter component will be used This method creates a new TatEventDispatcher object to handle the object's event, and return it as the result value. |