ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 edit - undo

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
kowal Posted - Feb 18 2025 : 08:57:48
hello,
Is it possible do execute undo/redo functions concerning all layers except for background layer or for example only for some kind of layers?


regards
Stan
4   L A T E S T    R E P L I E S    (Newest First)
kowal Posted - Nov 10 2025 : 16:15:05
Thank you very much!
I'll try do do something using your help.
S. Kowalski
xequte Posted - Nov 09 2025 : 19:31:22
Hi

Documentation is at:

https://www.imageen.com/help/TImageEnView.OnUndoRedo.html

But it is lacking detail and an example. I will update it for the next release.

TImageEnProc.OnUndoRedo

Declaration

property OnUndoRedo: TIEOnUndoRedoEvent;

Description
Occurs before TImageEnProc.Undo or TImageEnProc.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 TImageEnProc.SaveUndo.
*iIndex* is only used with <A 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*:
- ieuImage: Obj is a TIEBitmap
- ieuSelection: Obj is a >memory stream of the selection
- ieuLayer, ieuFullLayer: Obj is a memory stream of the object
- ieuObject, ieuObjectsAndLayers: Obj is a memory stream of the object

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 TImageEnView.OnImageChangeE> 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 ).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.IEBitmap.LoadFromFile( 'C:\Undo.jpg' );
    Handled := True; // Because we have handled it ourselves
  end;
end;


Nigel
Xequte Software
www.imageen.com
kowal Posted - Nov 09 2025 : 13:53:14
Hello!
today I try to learn something about undoRedo trying UndoReDo demo but can not find example how to use
the events:
SaveUndo(Sender: TObject; Source: TIEUndoSource);

ImageEnView1UndoRedo(Sender: TObject; bIsUndo: Boolean;
Source: TIEUndoSource; UndoObj: TObject; iIndex: Integer;
var Handled: Boolean);

And I can not find more details about these functions in help files.
regards,
S.Kowalski
xequte Posted - Feb 18 2025 : 16:24:55
Hi Stan

You should be able to use the OnSaveUndo event to remove any undo items that you don't want:


http://www.imageen.com/help/TImageEnView.OnSaveUndo.html

Nigel
Xequte Software
www.imageen.com