ImageEn, unit iexToolbars

TCustomImageEnToolbar.OnActionUpdate

TCustomImageEnToolbar.OnActionUpdate


Declaration

property OnActionUpdate: TIEActionEvent;


Description

Occurs when the state of the button action is updated (i.e. needs to be set visible or enabled). The default behaviour can be overriden by setting Handled to true.
It also handles the state for custom buttons.

Parameter Description
Sender The action or control being updated. See details below
ButtonImageID The ID of the affected control
Handled When False the default state behaviour occurs. Set to true to apply your own state setting code

The Sender type will be one of the following:
TToolButton for custom buttons
TComboBox showing a shape (IELayerShapeBox_Button_ID)
TPaintBox for colors, fonts, sizes, etc. (IELayerFontColorSelect_Button_ID, IELayerFontBox_Button_ID, IELayerFillBox_Button_ID, IELayerBorderSizeBox_Button_ID, IELayerBorderColorBox_Button_ID, IEViewToolBrushSizeBox_Button_ID, IEViewToolColor_Button_ID, IEViewZoomBox_Button_ID, IERichEditFontColor_Button_ID, IERichEditFontBox_Button_ID)
TAction from the ImageEn Actions Classes (all other types)

Note:
This method is called frequently, so avoid slow code
You can alternatively use the global event, OnToolbarButtonUpdate


Example

procedure TMainForm.ImageEnViewToolbar1ActionUpdate(Sender: TObject; ButtonID: Integer; var Handled: Boolean);
begin
  // Disable opening once we have a valid image
  if Sender is TImageEnViewPromptToOpen then
  begin
    TImageEnViewPromptToOpen(Sender).Enabled := ImageEnView1.IsEmpty(False);
    Handled := True;
  end;
end;


See Also

OnActionExecute
TImageEnView Actions
TImageEnView Layer Actions
TIERichEdit Actions