25 - Using the Visio Undo Manager in Your Program

3 4

Changes to a Microsoft Visio document can occur in one of two ways: through a user action in the user interface, or through an Automation program. A user can undo or redo the change in the user interface just as you can undo or redo changes in your program using the Undo or Redo method. Every Visio instance contains one Undo manager that tracks undoable and redoable actions across the application. An undoable action can be anything that modifies or changes the state of a document. The queues of undoable and redoable actions are called stacks.

The Visio Undo manager provides the flexibility to handle undoable actions as discrete actions, or to consolidate multiple undoable actions into a single unit that gets managed on the undo and redo stacks as a single undoable action. To do this, the Visio engine creates an undo scope.

Additionally, if your solution maintains a parallel or shadow model that represents data associated with the shapes in your drawing, you can create undo units to place on the Visio Undo manager to keep your data and drawings synchronized. Undo units contain the actions needed to undo or redo changes to a document.

Note


In versions earlier than Visio 2000, each individual action performed in an add-on was a single undoable action in Visio. If a user chose Undo, only the most recent action was undone.

Beginning with Visio 2000, the sequence of actions performed by an add-on that is invoked from Visio is automatically managed as a single undoable action. If a user chooses Undo, all Visio-specific actions performed in the add-on are reversed. For details, see How the Visio Undo Manager Works with an Add-on later in this chapter.



Developing Microsoft Visio Solutions 2001
Developing Microsoft Visio Solutions (Pro-Documentation)
ISBN: 0735613532
EAN: 2147483647
Year: 2004
Pages: 180

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net