[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] |
Adds a notification handler for the specified control handler type.
Source position: controls.pp line 1552
protected procedure TControl.AddHandler( |
HandlerType: TControlHandlerType; |
const AMethod: TMethod; |
AsFirst: Boolean = False |
); |
HandlerType |
|
Control handler type of the handler routine. |
AMethod |
|
The handler routine added in the method. |
AsFirst |
|
True if the handler routine is signalled first in the notification order. |
AddHandler is a method used to include the handler routine specified in AMethod in the list of notification handlers for the type in HandlerType.
HandlerType is a TControlHandlerType enumeration value, and indicates both the subject for the notification and the method list where the handler routine is stored.
AMethod is the TMethod instance with the handler routine signalled when a notification is needed. It is an object procedure which implements the TNotifyEvent signature and cast to the TMethod type.
AddHandler ensures that a TMethodList instance has been allocated for handler routines using the specified type; if it does not exist, it is created and stored in the internal array of handler types.
AddHandler calls the Add method in the method list to store the routine in AMethod.
AsFirst indicates whether the routine is inserted as the first item in the list. When set to False, the routine is appended as the last entry in the method list.
Use RemoveHandler to remove a handler routine from the method list for a specific handler type.
Convenience methods which act upon a specific control handler type using TNotifyEvent arguments are also available. For example:
|
Removes a notification handler from the list for the specified handler type. |
|
|
Signals handler routines for the specified control handler type. |
|
|
Notification handler types. |
|
Version 3.2 | Generated 2024-02-25 | Home |