Hot Door CORE Forum
Undo and Redo - Printable Version

+- Hot Door CORE Forum (http://hotdoorcore.com/forum)
+-- Forum: All forums (http://hotdoorcore.com/forum/forumdisplay.php?fid=1)
+--- Forum: General discussion (http://hotdoorcore.com/forum/forumdisplay.php?fid=3)
+--- Thread: Undo and Redo (/showthread.php?tid=172)



Undo and Redo - Rick Johnson - 05-29-2018

Is there a way to make a plugin's actions undoable and redoable? The user sees objects that are manipulated as though they were non-printing artwork, but in fact it's dictionary data and annotations. I have to manually mark the document as dirty so changes to the plugin's parameters that are not seen by AI will still be saved with the document, and hope there's a similar way (best if within CORE, of course) to coerce AI to save or restore a certain state even though AI is completely unaware of those changes.

Also, there are times when Illustrator does automatically offer users Edit > Undo, but doesn't have a description of what it's going to undo. For example, "Undo" vs. "Undo Concatenate." Is there a way for a plugin to provide that info to AI?

Many thanks!


RE: Undo and Redo - garrett - 05-31-2018

You can set the text of the undo/redo menu item via the AIUndoSuite::SetUndoTextUS() suite call, but hdi_core does not wrap this functionality at this time.

As far as I know, Illustrator only adds artwork changes to the undo stack. Anything that does not cause artwork to change does not result in a new item in the stack.


RE: Undo and Redo - Rick Johnson - 10-22-2018

Another Undo issue has come up. A floating dialog with a "Preview" checkbox creates temporary preview art. When the dialog blurs, the temporary art is deleted, but then an Undo by the user will bring it back. I'd like Undo to ignore activity between the dialog's focus and blur, but setting the undo context to silent during this period doesn't change anything. Do I need to do something with the app context? I do appreciate that CORE handles so much of this automatically, especially since I never clearly understood push/pop/suspend/resume app context, but I wonder if this may be an occasion when it's needed. Thanks!