Author |
Topic |
|
c.basso
Italy
36 Posts |
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 |
|
xequte
38514 Posts |
|
c.basso
Italy
36 Posts |
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
38514 Posts |
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
|
|
|
|
Topic |
|
|
|