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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Proc.AutoUndo does not work in my app
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

PeterPanino

862 Posts

Posted - Feb 20 2024 :  15:45:03  Show Profile  Reply
Please look at this test project:

attach/PeterPanino/2024220153514_AutoUndoTest.zip
76.52 KB

0. In FormCreate, AutoUndo is set:

procedure TForm1.FormCreate(Sender: TObject);
begin
  ImageEnView1.Proc.UndoLimit := 99;
  ImageEnView1.Proc.AutoUndo := True;
end;


1. Load an image file

2. Change the image with the Colors button

3. Change the image with the Edit button

4. Click the Undo button TWICE: Only the last edit action is undone!

Shouldn't clicking the Undo button TWICE undo the LAST TWO image changes? How can this be achieved?

The demos do not have an example with
ImageEnView1.Proc.AutoUndo := True;


The documentation says:

"TImageEnProc.AutoUndo
When true, all image processing and load operations will automatically call SaveUndo"

ImageEnVersion: 13.0.0

xequte

38194 Posts

Posted - Feb 21 2024 :  16:38:57  Show Profile  Reply
Hi

Please change your code to:

ImageEnView1.Proc.Undo(True);
...
ImageEnView1.Proc.Redo(True);


https://www.imageen.com/help/TImageEnProc.Undo.html


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

PeterPanino

862 Posts

Posted - Feb 21 2024 :  23:10:19  Show Profile  Reply
Hi Nigel,

Thanks, now the multiple Undo/Redo works.

IMO, you should explicitly mention this MULTIPLE Undo/Redo feature in the documentation.
Go to Top of Page

xequte

38194 Posts

Posted - Feb 22 2024 :  13:10:51  Show Profile  Reply
Yes, I agree. It only works that way to avoid breaking old code for users. I have added a note to Undo/Redo.

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: