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 for details on the iTool class Init method.
To register a manipulator, call the IDLitTool::RegisterManipulator method:
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 for an example.
ICON
A string value giving the name of an icon to be associated with this object. Typically, this property is the name of a bitmap file that is used to represent the manipulator on the toolbar. The location of the icon image file determines how it is specified. If it exists in the resource/bitmaps subdirectory of the IDL installation, simply use the name of the file minus the extension. For example, 'crop' references the Crop tool's associated icon, crop.bmp. If the icon image is in the same directory as the tool class definition file, specify the file name, 'crop.bmp'. See Icon Bitmaps for details on how to locate and reference bitmap icon files.
IDENTIFIER
A string that will be used as the identifier of the object. Identifier strings specify where within an iTool's object hierarchy an object is located; this, in turn, may affect whether and where the object is revealed in the iTool's graphical user interface. See iTool Object Identifiers (iTool Developer's Guide) for details about how identifiers are named.
If this property is not specified, then the value of the ManipulatorName argument is used as the identifier.
TYPES
A string or an array of strings indicating the types of data that the manipulator can modify. iTools data types are described in Data Management. Set this property to a null string ('') to specify that the manipulator can be applied to all types of data.