
Chapter 13: Creating a User Interface Service 297
iTool Developer’s Guide Creating a New UI Service
Creating a New UI Service
A user interface service is responsible for creating a user interface element that is
displayed when an iTool user takes some action. A simple UI service may do no more
than display the “hourglass” cursor while an operation is being performed; more
complicated UI services may be small applications unto themselves.
For simple operations the UI service routine can contain everything necessary to
implement the UI service. For more complex interfaces, however, it is often practical
to separate the actual user interface code (that is, the widget creation and event-
handling routines) from the logic of the UI service itself. The latter is the strategy
used by many of the UI services included with the standard iTools.
The process of creating a user interface service is outlined in the following sections:
• “Creating the UI Service Routine” on page 297
• “Creating Supporting User Interface Elements” on page 300
Creating the UI Service Routine
The user interface service routine performs the following tasks:
• Manages changes to any properties of the object on which the user interface
element was invoked.
• Manages the display of the user interface element.
To accomplish these things, the UI service routine needs a reference to the iTool
component on which the service will act, and a reference to the IDLitUI object
associated with the current iTool. As a result, the user interface service routine has
the following signature:
FUNCTION
ServiceName
,
oUI
,
oRequester
where ServiceName is the name of the function, oUI is an object reference to the
IDLitUI object associated with the iTool, and oRequester is an object reference to the
iTool component specified in the call to the DoUIService method.
Note
ServiceName is not necessarily the same as the registered name of the service used
in the call to the DoUIService method. The registered name is defined by the call to
the ITREGISTER procedure. See “Registering a UI Service” on page 302 for
details.