You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Tucsonjhall <Jh...@cactusware.com> on 2014/09/20 21:43:28 UTC

Undo Redo management in AIR

I've been looking at the undoManager and not understanding some basic
principles, obviously.
 
Situation, I have an AIR desktop app and want to include Undo/Redo in the
menus. When I do that, it overrides the typically expected behavior of
control-z and control-y, so I assume that I have to manage that myself now.
I've been able to handle cut/paste overrides by capturing the menu event and
using NativeApplication.nativeApplication.copy() paste() etc, but there's
nothing comparable for undo/redo. So that took me on a quest looking at the
UndoManager, which appears to be my ticket for managing Spark TextInput text
operations. However, if I trap the menu event for undo and look at the
undoManager.canUndo() after deleting text, it's always false.
 
I'm missing a step somewhere. Can someone point me to an example or a better
explanation of how to manage undo/redo in an AIR application, if you want to
override the built-in menu items?
 
Thanks.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Undo-Redo-management-in-AIR-tp8079.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Undo Redo management in AIR

Posted by Tucsonjhall <Jh...@cactusware.com>.
Thanks for the hint. More research ahead.



--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Undo-Redo-management-in-AIR-tp8079p8081.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Undo Redo management in AIR

Posted by Harbs <ha...@gmail.com>.
Make sure you are using TLF text.
Your text components have to use an UndoManager in their interactionManager. If you are using Spark components, the undo functionality is kind of limited because everything is encapsulated. You might want to look at using TLF directly.
Moreover, you should use a single UndoManager for your whole app if you want to extend it beyond the basic TLF functionality.

HTH,
Harbs

On Sep 20, 2014, at 10:43 PM, Tucsonjhall <Jh...@cactusware.com> wrote:

> I've been looking at the undoManager and not understanding some basic
> principles, obviously.
> 
> Situation, I have an AIR desktop app and want to include Undo/Redo in the
> menus. When I do that, it overrides the typically expected behavior of
> control-z and control-y, so I assume that I have to manage that myself now.
> I've been able to handle cut/paste overrides by capturing the menu event and
> using NativeApplication.nativeApplication.copy() paste() etc, but there's
> nothing comparable for undo/redo. So that took me on a quest looking at the
> UndoManager, which appears to be my ticket for managing Spark TextInput text
> operations. However, if I trap the menu event for undo and look at the
> undoManager.canUndo() after deleting text, it's always false.
> 
> I'm missing a step somewhere. Can someone point me to an example or a better
> explanation of how to manage undo/redo in an AIR application, if you want to
> override the built-in menu items?
> 
> Thanks.
> 
> 
> 
> --
> View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Undo-Redo-management-in-AIR-tp8079.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.