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
 Undo an AddNewObject

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
c.basso Posted - May 27 2015 : 01:52:39
Hi,

I'm using a TImageEnVect with AutoUndo set to true.
All operations of undo/redo works well,
but if I create at runtime an object:
idx1:= AddNewObject;
ObjKind[idx1]:= iekLINE;
ObjPenColor[idx1]:= clBlack;
...

The undo stack doesn't change.

I've tried to call SaveUndo before creating object, nothing changes (the undo stack increase, but if I undo, my object is not removed).
I've tried to set autoundo = false and call saveundo, no luck.

What's the procedure to undo the AddNewObject method?

Thanks
Claudio BAsso

Claudio
3   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - May 29 2015 : 04:32:53
Hi

If you set ObjUndoMode to ieumShared then the object and proc undo are shared, so use Proc.undo to undo both types of change. Do not use ObjUndo.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
c.basso Posted - May 27 2015 : 06:17:42
Ok, solved using objsaveundo before AddNewObject.

Now I have 2 undo stack, one for image, one for vect objects,
if I want that the user has only 1 "Undo" button, how can I know what is the last action?
How can I know if I have to call Proc.Undo or ObjUndo?

To explain better:
I'm set the undo object like this:
Proc.AutoUndo:= True;
Proc.UndoLimit:= 10;
ObjAutoUndo:= True;
ObjUndoMode:= ieumShared;

If I create a line with mouse, I can undo the action with the Undo command, but if I use ObjSaveUndo, I must use ObjUndo to come back, the Undo command does nothing.

In that manner, when user clic on my Undo button, I can't know if last action was automatically put in Undo stack or if I must call ObjUndo.

Thanks

Claudio
xequte Posted - May 27 2015 : 05:21:40
Hi Claudio

AutoUndo, SaveUndo, etc are for undo/redo of TImageEnView image and layer changes.

For TImageEnVect object changes use the ObjAutoUndo and the other Obj*Undo properties and methods.

http://www.imageen.com/help/TImageEnVect.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com