A SERVICE OF

logo

166 Chapter 7: Creating an Operation
Creating a New Generalized Operation iTool Developer’s Guide
“Creating a SetProperty Method” on page 177
“Creating an UndoOperation Method” on page 178
“Creating a RedoOperation Method” on page 179
Creating the Class Structure Definition
When any IDL object is created, IDL looks for an IDL class structure definition that
specifies the instance data fields needed by an instance of the object, along with the
data types of those fields. The object class structure must have been defined before
any objects of the type are created. In practice, when the IDL OBJ_NEW function
attempts to create an instance of a specified object class, it executes a procedure
named
ObjectClass
__define (where ObjectClass is the name of the object),
which is expected to define an IDL structure variable with the correct name and
structure fields. For additional information on how IDL creates object instances, see
“The Object Lifecycle” (Chapter 13, Object Programming).
Note
The class structure definition is generally the last routine in the
.pro file that
defines an object class.
Subclassing from the IDLitOperation Class
The IDLitOperation class is the base class for all iTool operations. In almost all cases,
new operations will be subclassed either from the IDLitOperation class or from a
class that is a subclass of IDLitOperation.
Note
If your operation acts directly on data, rather than affecting the visual appearance of
objects in the iTool, you may be able to subclass from IDLitDataContainer. See
“Creating a New Data-Centric Operation” on page 152 for details.
See “IDLitOperation” (IDL Reference Guide) for details on the methods and
properties available to classes that subclass from IDLitOperation.
Example Class Structure Definition
The following is the class structure definition for the ExampleOp operation class.
This procedure should be the last procedure in a file named
exampleop__define.pro.
PRO ExampleOp__Define