ImageEn, unit iexToolbars |
|
TCustomImageEnToolbar.OnActionExecute
Declaration
property OnActionExecute: TIEActionEvent;
Description
Occurs whenever the user clicks a button. The default behaviour can be overriden by setting Handled to true.
It also handles the clicking of
custom buttons.
Parameter | Description |
Sender | The affected action or clicked control. See details below |
ButtonID | The ID of the clicked button |
Handled | When False the default execute behaviour occurs. Set to true to apply your own execution 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: You can alternatively use the global event,
OnToolbarButtonExecuteprocedure TMainForm.ImageEnViewToolbar1ActionExecute(Sender: TObject; ButtonID: Integer; var Handled: Boolean);
begin
// override save handling
if Sender is TImageEnViewSave then
begin
SaveCurrentImage();
Handled := True;
end;
end;
procedure TMainForm.ImageEnViewToolbar1ActionExecute(Sender: TObject; ButtonID: Integer; var Handled: Boolean);
begin
// Merge layers before saving
if ( ButtonImageID = IEViewSave_Button_ID ) or
( ButtonImageID = IEViewPromptToSave_Button_ID ) then
begin
ImageEnView1.LayersMergeAll();
// Handled is False so now default saving code will occur
end;
end;
See Also
◼OnActionUpdate◼TImageEnView Actions◼TImageEnView Layer Actions◼TIERichEdit Actions