user manual
Chapter 7: Creating an Operation 161
iTool Developer’s Guide Creating a New Data-Centric Operation
• For operations that return a two-dimensional array, the Operation Preview UI
service displays the operation’s property sheet and a small window that
previews the result of the operation.
See “Predefined iTool UI Services” on page 295 for additional details.
Example DoExecuteUI Method
The following example code shows a simple DoExecuteUI method for the
ExampleDataOp operation. This method relies on a UI service named
'ExampleDataOp' being registered with the current iTool.
FUNCTION ExampleDataOp::DoExecuteUI
oTool = self->GetTool()
IF (oTool EQ OBJ_NEW()) THEN RETURN, 0
RETURN, oTool->DoUIService('ExampleDataOp', self)
END
Discussion
If the SHOW_EXECUTION_UI property is set on our ExampleDataOp operation
object, the DoExecuteUI method is called automatically when the user invokes the
operation. This method does the following:
1. Retrieve a reference to the current iTool object using the GetTool method of
the IDLitIMessaging class. (IDLitIMessaging is a superclass of
IDLitOperation, and thus of IDLitDataOperation.)
2. If the retrieved iTool object reference is a null object reference, no data about
the current tool is available, so we return immediately without calling the UI
service.
3. Call the ExampleDataOp UI service. Since our ExampleDataOp operation has
only one property of its own (ByteTop), the ExampleDataOp UI presumably
allows the user to set this value. See Chapter 13, “Creating a User Interface
Service” for discussion of UI services.
Creating a GetProperty Method
The operation class GetProperty method retrieves property values from the operation
object instance or from instance data of other associated objects. It should retrieve the
requested property value, either from the operation object’s instance data or by
calling another class’ GetProperty method.