user manual

Chapter 7: Creating an Operation 157
iTool Developer’s Guide Creating a New Data-Centric Operation
Return Value
If all of the routines and methods used in the Init method execute successfully, it
should indicate successful initialization by returning 1. Other operation classes that
subclass from your operation class may check this return value, as your routine
should check the value returned by any superclass Init methods called.
Registering Properties
Operations can register properties with the iTool. Registered properties show up in
the property sheet interface, and can be modified interactively by users. The iTool
property interface is described in detail in Chapter 4, “Property Management”.
Register a property by calling the RegisterProperty method of the IDLitComponent
class:
self->RegisterProperty,
PropertyIdentifier
[,
TypeCode] $
[, ATTRIBUTE = value]
where PropertyIdentifier is a string that uniquely identifies the property, TypeCode is
an integer between 0 and 9 specifying the property data type, and ATTRIBUTE is a
property attribute. See “Registering Properties” on page 74 for details.
Setting Property Attributes
If a property has already been registered, perhaps by a superclass of your operation
class, you can change the registered attribute values using the SetPropertyAttribute
method of the IDLitComponent class:
self->SetPropertyAttribute,
Identifier
where Identifier is the name of the keyword to the GetProperty and SetProperty
methods used to retrieve or change the value of this property. (The Identifier is
specified in the call to RegisterProperty either via the PropertyName argument or the
IDENTIFIER keyword.) See Property Attributes on page 78 for additional details.
Example Init Method
The following example code shows a very simple Init method for an operation named
ExampleDataOp. This function would be included (along with the class structure
definition routine and any other methods defined by the class) in a file named
exampledataop__define.pro.
FUNCTION ExampleDataOp::Init, _REF_EXTRA = _extra
; Initialize the superclass.
IF (self->IDLitDataOperation::Init(TYPES=['IDLIMAGE'], $