
310 Chapter 13: Creating a User Interface Service
Example: Changing a Property Value iTool Developer’s Guide
PRO opName__define
struct = {opName, $
inherits IDLitDataOperation $
}
END
Discussion
Only two methods are required: Init and DoExecuteUI. Since this operation is based
on the IDLitDataOperation class, all interaction with the iTools undo/redo system is
automated.
Even though all of the items that are currently selected in the iTool are retrieved by
the GetSelectedItems method, only the first item is passed to the SrvExample user
interface service for processing. Handling multiple selected items would require a
more complicated user interface.
The process of defining an IDLitDataOperation is discussed in detail in Chapter 7,
“Creating an Operation”.
Registering the SrvExample Service
In order for the SrvExample user interface service to be available, it must be
registered with the current iTool. The following line in the iTool’s launch routine
allows the service to be called with the name “Example Service”:
ITREGISTER, 'Example Service', 'srvExample', /UI_SERVICE
Registering the opName Operation
To use the opName operation within an iTool, the operation must be registered in the
iTool’s definition. The following statement registers the operation with the name
“Property Name” and places it in the Operations menu of the iTool.
self->RegisterOperation, 'Property Name', 'opName', $
IDENTIFIER = 'Operations/PropertyName'
Invoking the opName Operation
To use the SrvExample service, the user would launch an iTool for which the
opName operation is registered, select an iTool component in the window, and select
Property Name from the Operations menu.