Page 1 of 1

Undo

Posted: Tue Mar 03, 2009 11:46 pm
by dylan
Is there any way for developers to bind to the undo (ctrl^z) event?

Ragards,

Dylan

Re: Undo

Posted: Wed Mar 04, 2009 11:35 am
by sorin_ristache
Hello,

It is possible in Author mode but not in Text mode. In Author mode you can set any shortcut for an extension action specified in a document type.

Do you want to change the Undo action in Text mode? What action would you like to run instead of the built-in action for Ctrl-Z?


Regards,
Sorin

Re: Undo

Posted: Wed Mar 04, 2009 10:12 pm
by dylan
Hi Sorin,

As you may know, I am working on 'track changes' functionality. The issue I am having is that (for example, with track changes ON) when a user is inserting a change, and then hits ctrl^z, the inserted text is removed, but is now being tagged as deleted!

Normally, I can just stop listening for contentInserted() and contentDeleted() events, but with ctrl^z, I don't get the opportunity to remove my AuthorListener from the AuthorAccess object.

I will try today to handle the ctrl^z event and work around this issue, and i'll keep you posted on the outcome.

Thanks,

Dylan

======================================================
UPDATE:
======================================================
I can handle the ctrl^z event as you suggested, but in doing so, I have completely overridden the original purpose of undo...

What I am *trying* to do is:

1. handle ctrl^z
2. remove the AuthorListener from AuthorAccess
3. turn OFF change tracking
4. let the system perform the undo operation, and
5. turn track changes back ON

Is there a call I can make from within AuthorOperation.doOperation(...) that will perform the undo?

Re: Undo

Posted: Wed Mar 04, 2009 10:32 pm
by george
Hi Dylan,

Track changes is work in progress right now... My suggestion would be to wait for that to be available as a standard oXygen feature. The expected time for that to be generally available is the end of April and I hope we will have something that can be tested in a couple of weeks.

Best Regards,
George

Re: Undo

Posted: Thu Mar 05, 2009 6:24 pm
by sorin_ristache
Hello Dylan,
dylan wrote:Is there a call I can make from within AuthorOperation.doOperation(...) that will perform the undo?
In version 10.2 the Author API will allow a custom extension action to call the methods of the undo manager that stores the Author actions for which undo and redo is available.


Regards,
Sorin