Suppose that the user opens a new RaiseMan document and makes three edits:
Inserts a new record
Changes the name from
New Employee to
Changes the raise from 5 to 20
To support undo, as each edit is performed your controller will add an invocation that would undo that edit to the undo stack. For the sake of simplifying the prose, let’s say, “The inverse of the edit gets added to the undo stack.”
Figure 11.1 shows what the undo stack would look like after these three edits.
Figure 11.1 The undo stack
If the user now chooses the Undo menu item, the first invocation is taken ...