ITT Rule IDL Version 7.0 User Manual Page 151

  • Download
  • Add to my manuals
  • Print
  • Page
    / 430
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 150
Chapter 7: Creating an Operation 151
iTool Developer’s Guide Operations and the Undo/Redo System
Generalized Operations
To provide undo/redo functionality, generalized operations (those based on the
IDLitOperation class) must provide methods that record the initial and final values of
the item being modified, along with methods that use the recorded values to undo or
redo the operation. The following things happen when the user requests an operation:
The DoAction method creates an IDLitCommandSet object to hold the initial
and final values.
The RecordInitialValues method records the original values of the specified
target objects. Values are stored as data items in IDLitCommand objects,
which are in turn stored in the IDLitCommandSet object.
The RecordFinalValues method retrieves the IDLitCommand objects created
by the RecordInitialValues method from the IDLitCommandSet object, and
records the new values of the target objects as additional items in those
IDLitCommand objects.
If the user undoes the operation, the UndoOperation method retrieves the
IDLitCommand objects from the IDLitCommandSet object, selects the
relevant data items from each, and restores the values.
If the user redoes the operation, the RedoOperation method retrieves the
IDLitCommand objects from the IDLitCommandSet object, selects the
relevant data items from each, and restores the values.
Page view 150
1 2 ... 146 147 148 149 150 151 152 153 154 155 156 ... 429 430

Comments to this Manuals

No comments