Highlighted

Undo/redo in AIR application

Advocate ,
Sep 20, 2014

Copy link to clipboard

Copied

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.

TOPICS
Development

Views

146

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

Undo/redo in AIR application

Advocate ,
Sep 20, 2014

Copy link to clipboard

Copied

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.

TOPICS
Development

Views

147

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Sep 20, 2014 0

Have something to add?

Join the conversation