ITT Rule IDL Version 7.0 Uživatelský manuál Strana 164

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 430
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 163
164 Chapter 7: Creating an Operation
Creating a New Data-Centric Operation iTool Developer’s Guide
Creating an UndoExecute Method
The operation class’ UndoExecute method is called when the user undoes an
invocation of the operation and the REVERSIBLE_OPERATION property is set on
the operation object. (See “Operations and the Undo/Redo System” on page 150 for
details on how undo and redo are handled in different situations.) The UndoExecute
method must reverse the effect of the Execute method.
The actual processing performed by the UndoExecute method depends entirely on
the operation.
Example UndoExecute Method
The following example code shows a simple UndoExecute method for the
ExampleDataOp operation, which reverses the operation of the Execute method.
FUNCTION ExampleDataOp::UndoExecute, data
; If byte data then offsets are 0 and 255, otherwise
; use data minimum and maximum.
offsetMax = (SIZE(data, /TYPE) eq 1) ? 255b : MAX(data)
offsetMin = (SIZE(data, /TYPE) eq 1) ? 0b : MIN(data)
data = offsetMax - TEMPORARY(data) + offsetMin
RETURN, 1
END
Discussion
When the user undoes an invocation of our ExampleDataOp operation, the iTool
system supplies the data that were computed by the Execute method when the
operation was invoked. Our UndoExecute method then reverses the original
operation.
Zobrazit stránku 163
1 2 ... 159 160 161 162 163 164 165 166 167 168 169 ... 429 430

Komentáře k této Příručce

Žádné komentáře

Topcom TH-4675 podręczniki

Instrukcje obsługi i podręczniki użytkownika dla Higrometry Topcom TH-4675.
Dostarczamy 1 pdf podręczników Topcom TH-4675 do pobrania za darmo według typów dokumentów: Instrukcja Obsługi


Topcom TH-4675 Instrukcja Obsługi (2 strony)


Marka: Topcom | Kategoria: Hygrometers | Rozmiar: 0.41 MB |

     




Więcej produktów i instrukcji dla Higrometry Topcom

Modele Rodzaj dokumentu
KL-4330 Instrukcja Obsługi         Topcom Night light, 48 strony