appevents OnActionExecute event
Return to Introduction  Previous page  Next page
Applies to
acAppEvents component.  

  TActionEvent = procedure(Action: TBasicAction; var Handled: Boolean) of object;  
property OnActionExecute: TActionEvent;  

The OnActionExecute event occurs when an action's Execute method is called and its action list has not already handled it.  
Use the OnActionExecute event handler to respond when a user invokes actions whose action lists do not have OnExecute event handlers.  
If the action list that contains the action does not handle it in an OnExecute event handler, then the action is routed to the Application object's ExecuteAction method, which invokes the OnActionExecute event handler. (The application's ExecuteAction method applies to all actions in the application.)  
The Handled parameter of the event handler returns False by default. If the handler handles the event, it should change Handled to True, thereby preventing further attempts to handle the action. When the event handler exits with Handled set to False, the action's OnExecute event occurs. If the action remains unhandled after that, the active control's ExecuteAction method is called to allow the action to execute with an identified target. Finally, the active form's ExecuteAction method is called if all other handlers do not handle the action.  

iiinfo The OnActionExecute and OnActionUpdate events available in Delphi 4/BCB 4 and higher.  

See also
OnActionUpdate, OnIdle event.