
92 Chapter 5: Creating an iTool
Creating a New iTool Class iTool Developer’s Guide
Note
To create an iTool that does not include the standard iTool functionality, subclass
from the IDLitTool class.
In general, the IDLitToolbase class registers the following types of features:
Standard menu items — Operations that appear in the File, Edit, Insert, Window,
and Help menus are defined in the IDLitToolbase class. If you are building a subclass
of the IDLitToolbase class, you have the option of adding items to or removing items
from these menus in your own class definition file.
Operations menu items — Standard data-centric operations provided as part of the
iTools distribution and which appear in all of the standard iTools are placed on the
Operations menu by the IDLitToolbase class.
Context menu items — Standard operations such as Cut, Copy, Paste, Group,
Ungroup, etc. are included on the context menu by the IDLitToolbase class.
Toolbar items — Operations that enable standard File and Edit menu functionality
are placed on the toolbar by the IDLitToolbase class. In addition, standard
manipulators (zoom, arrow, and rotate), and annotations (text, line, rectangle, oval,
polygon, and freeform) are placed on the toolbar.
File readers — All file readers included in the iTools distribution are registered by
the IDLitToolbase class. File readers do not appear in the iTool interface, but are used
automatically when importing a data file.
File writers — All file writers included in the iTools distribution are registered by the
IDLitToolbase class. File writers do not appear in the iTool interface, but are used
automatically when exporting data to a file.
Example Class Structure Definition
The following is a very simple iTool class structure definition for an iTool named
FirstExampleTool. This procedure should be the last procedure in a file named
firstexampletool__define.pro.
PRO FirstExampleTool__Define
struct = { FirstExampleTool, $
INHERITS IDLitToolbase $ ; Provides iTool interface
}
END
Discussion
The purpose of the structure definition routine is to define a named IDL structure
with structure fields that will contain the iTool object instance data. The structure