
Chapter 8: Creating a Manipulator 223
iTool Developer’s Guide Registering a Manipulator
Registering a Manipulator
Before a manipulator can be activated by an iTool, the manipulator’s class definition
must be registered as being available to the iTool. Registering a manipulator with the
iTool links the class definition file that contains the actual IDL code that defines the
manipulator with a simple string that names the manipulator. Code that defines a
manipulator in an iTool uses the name string to specify which manipulation should be
performed.
Using IDLitTool::RegisterManipulator
In most cases, you will register a manipulator with the iTool in the iTool’s class Init
method. Registration ensures that the manipulator is available to the iTool. See
“Creating a New iTool Class” on page 91 for details on the iTool class Init method.
To register a manipulator, call the IDLitTool::RegisterManipulator method:
self->RegisterManipulator,
ManipulatorName
,
Manipulator_Class_Name
where ManipulatorName is the string you will use when referring to the manipulator,
and Manipulator_Class_Name is a string that specifies the name of the class file that
contains the manipulator’s definition.
Note
The file
Manipulator_Class_Name
__define.pro must exist somewhere in
IDL’s path for the manipulator type to be successfully registered.
See “IDLitTool::RegisterManipulator” (IDL Reference Guide) for details.
Specifying Properties During Manipulator Registration
You can specify any property of the IDLitManipulator, IDLitIMessaging, and
IDLitComponent classes when registering a manipulator. The following properties
may be of particular interest:
DEFAULT
Set this manipulator as the default manipulator for the iTool. When set, the
manipulator is active when the tool is launched.
DESCRIPTION
A string value that briefly describes how to use the manipulator. This string is
displayed in the left side of the status bar when the manipulator is activated. See
“Example: Color Table Manipulator” on page 226 for an example.