Vcl.ActnList.TCustomAction.Execute

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function Execute: Boolean; override;

C++

DYNAMIC bool __fastcall Execute();

Properties

Type Visibility Source Unit Parent
function public
Vcl.ActnList.pas
Vcl.ActnList.hpp
Vcl.ActnList TCustomAction

Description

Responds when a client control "fires".

Execute is called automatically when a client control "fires" (for example, when the user clicks a button or selects a menu item). It returns True if an event handler is found to handle the action, False if there was no event handler or if the action was not enabled.

Execute first ensures that the action is updated. Then, if the Enabled property is True, it attempts to handle the action by generating an OnExecute event on the action list that contains this action (if the action belongs to an action list). If the action list's OnExecute event handler does not handle the action, Execute generates an OnActionExecute event on the application itself. If neither the action list nor the application handles the action in response to these events, Execute generates an OnExecute event on itself. If this action has no OnExecute event handler, Execute instructs the application to locate the current target control and call the ExecuteTarget method, which is the mechanism by which predefined action classes perform their function.

See Also

Code Examples