user manual

Chapter 13: Creating a User Interface Service 305
iTool Developer’s Guide Example: Changing a Property Value
Example: Changing a Property Value
This example creates a user interface service named SrvExample, which displays a
dialog that allows the user to change the NAME property of the currently selected
iTool component. The SrvExample user interface service is launched by an
IDLitDataOperation named opName.
This example is intended as a demonstration of the techniques used to create a user
interface service. In practice, you do not have to create a user interface to change the
NAME property; it can be changed more easily by altering the value in the
Visualization browser. It is conceivable, however, that you might want to provide an
interface that allows the user to change numerous properties simultaneously, with
some values being based on other user-supplied values. Similarly, you may wish to
display a dialog that allows the user to set the properties of an operation every time
that operation is executed, without forcing the user to open the Operations browser.
Creating and using the SrvExample user interface service involves the following
steps:
Creating the SrvExample Service
Creating the SrvExample Interface
Creating an Operation that Calls the Service
Registering the SrvExample Service
Registering the opName Operation
Invoking the opName Operation
Creating the SrvExample Service
The SrvExample user interface service consists of a single function named
SrvExample, stored in a file named
srvexample.pro that is located in a directory
that is included in the IDL !PATH system variable.
FUNCTION SrvExample, oUI, oRequester
; Retrieve widget ID of top-level base.
oUI->GetProperty, GROUP_LEADER = groupLeader
; Retrieve the original value of the name property
; attribute from the selected item.
oRequester->GetProperty, NAME = origName
; Display the widget UI that allows the user to choose