Skip to main content
Known Participant
December 5, 2007
Question

How to write Undo Code in CS3

  • December 5, 2007
  • 5 replies
  • 675 views
I am working on CS3 and I need to revert some operations which was performed during Do. yes, the changes made in the Data Base of the InDesign get reverted once UnDo is done. But I need some additional revert to be done which I had made in the Do() function.

In Short I need the control when I press Ctrl + Z in Undo function ?
So how to Go for it.
This topic has been closed for replies.

5 replies

Known Participant
December 5, 2007
Andreas,

Do you have an Skype Id i need to talk to you for this concern...
Participating Frequently
December 5, 2007
Hi Rizwan,

There is no way I can think of to easily explain or present a recipe for implementing an InvalHandler. Handling undo in CS3 is not trivial, in short there is no way to implement an Undo() as it was known in pre-CS3. Please read the chapter I pointed to in the programming guide. The programming guide is available in the Adobe InDesign CS3 5.0.1 Products SDK/docs/guides/programming-guide.pdf.

Regards,
Andreas
Known Participant
December 5, 2007
Andreas,

I have checked in the GTTxtEdtNewDeleteStoryObserver.cpp file for InvalHandler, i found it but its I suppose in a different context. I need the flow control in Undo() function of a command say (SomthingCmd.cpp), when Ctrl + Z is done.
So, how exactly i can do that.

Thanks in advance for you kind Support...
Known Participant
December 5, 2007
Thanks Andreas,

Thank you for the Help. Kindly can you take me through a brief detail of its. I am unable to find it yet in either place...
Participating Frequently
December 5, 2007
Hi Rizwan.

To get notified on undo in CS3, you need to implement an InvalHandler. Please see the section Inval Handler on page 132 in the Programming Guide for details. The SDK sample GoToLastTextEdit implements an InvalHandler, which could be interesting to take a look at as well.

/Andreas