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

# TApplication.UpdateAction

Signals an OnActionUpdate handler (when assigned).

## Declaration

Source position: forms.pp line 1612

`public function TApplication.UpdateAction(`
`TheAction: TBasicAction`
`):Boolean; override;`

## Arguments

`TheAction` |  | The action updated in an event handler.

## Function result

True if the action was updated in the event handler.

## Description

UpdateAction is an overridden Boolean function used to signal an OnActionUpdate event handler (when assigned) to update the settings in the action instance in TheAction. UpdateAction reimplements the method defined in the ancestor (TComponent), and does not call the inherited method.

UpdateAction signals a TActionEvent event handler using the action instance in TheAction 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 updated in an event handler.

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

If OnActionUpdate handler is not assigned, or returns False, the other handlers in the internal list are signalled to determine whether they can update 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 update the action, the return value is False.

## Version info

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

## See also

TApplication.AddOnActionUpdateHandler |  | Adds the specified routine to the list of ahtActionUpdate handlers for the application.
TApplication.RemoveOnActionUpdateHandler |  | Removes the specified routine from the list of ahtActionUpdate handlers for the application.
TApplicationHandlerType |  | Types of Application notification handlers.
TActionEvent |  | Specifies an event handler signalled to implement an action in TCustomActionList.
TComponent.UpdateAction