[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'Forms' (#lcl)

TApplication.ExecuteAction

Signals an OnActionExecute handler (when assigned).

Declaration

Source position: forms.pp line 1612

public function TApplication.ExecuteAction(

  ExeAction: TBasicAction

):Boolean; override;

Arguments

ExeAction

  

The Action to execute in the event handler.

Function result

True when the Action was handled in one of the event handlers for the type.

Description

ExecuteAction is an overridden Boolean function used to signal an OnActionExecute event handler assigned to the control. ExecuteAction reimplements the method defined in the ancestor (TComponent) and does not call the inherited method.

ExecuteAction signals a TActionEvent event handler using the action instance in ExeAction as an argument. The Handled argument in the event is used as the return value for the method, and is set to True if the action was successfully executed in an event handler.

In LCL version 3.0 or higher, multiple handler routines can be assigned which use the ahtActionExecute event type. This situation can occur when TApplicationProperties tries to assign an OnActionExecute handler to the TApplication instance and it already has a user-specified handler. It can also happen when the AddOnActionExecuteHandler method is called directly to add a handler routine for the application event type.

If OnActionExecute handler is not assigned, or returns False, the other handlers in the internal list are signalled to determine whether they can execute the action. Each handler routine is signalled until one of them changes the Handled argument in the event type to True. If none of the routines can execute the action, the return value is False.

Version info

Modified in in LCL version 3.0 to provide support for multiple OnActionExecute event handlers in the application.

See also

TApplication.AddOnActionExecuteHandler

  

Adds the specified routine to the list of ahtActionExecute handlers for the application.

TApplication.RemoveOnActionExecuteHandler

  

Removes the specified routine from the list of ahtActionExecute handlers for the application.

TApplicationHandlerType

  

Types of Application notification handlers.

TActionEvent

  

Specifies an event handler signalled to implement an action in TCustomActionList.

TComponent.ExecuteAction


Version 3.2 Generated 2024-02-25 Home