| ImageEn, unit imageenproc |
|
TImageEnProc.OnUndoRedo
Declaration
property OnUndoRedo: TIEOnUndoRedoEvent;
Description
Occurs before
Undo or
Redo is called by user action or your code to allow the undo/redo processing to be customized.
Source is the same parameter used when calling
SaveUndo.
iIndex is only used with
TImageEnMView and specifies the index of the image being undone/redone.
UndoObj contains the object that will be applied. The type depends on the
Source:
Set
Handled if you perform the undo/redo operation yourself (to prevent ImageEn from applying any change).
Note: You can check for iecsUndo in the
OnImageChangeEx event to detect changes due to undo/redo
Example
// Supply our own image on "Undo"
procedure TfrmMain.ImageEnView1UndoRedo(Sender: TObject; bIsUndo: Boolean; Source:
TIEUndoSource; UndoObj: TObject; iIndex: Integer; var Handled: Boolean);
begin
If bIsUndo and ( Source = ieuImage ) then
begin
TIEBitmap( UndoObj ).IEBitmap.LoadFromFile( 'C:\Undo.bmp' );
Handled := False; // Because we still want this undo object to be processed
end;
end;
// Which is the same as...
procedure TfrmMain.ImageEnView1UndoRedo(Sender: TObject; bIsUndo: Boolean; Source:
TIEUndoSource; UndoObj: TObject; iIndex: Integer; var Handled: Boolean);
begin
If bIsUndo and ( Source = ieuImage ) then
begin
ImageEnView1.LoadFromFile( 'C:\Undo.jpg' );
Handled := True; // Because we have handled it ourselves
end;
end;