Examples


Suppose you have an iTool class definition file named myTool__define.pro, located in a directory included in IDL’s !PATH system variable. Register this class with the iTool system with the following command:

IREGISTER, 'My First Tool', 'myTool'        

Tools defined by the myTool class definition file can now be created by the iTool system by specifying the tool name My First Tool.

Similarly, suppose you have a user interface service defined in a file named myUIFileOpen.pro. Register this UI service with the iTool system with the following command:

IREGISTER, 'My File Open', 'myUIFileOpen', /UI_SERVICE        

Finally, suppose you have a user interface panel defined in a file named myPanel.pro, and that you want this panel to be added to the user interface of iTools registered with the TYPES property set to MYTOOL. Register this UI panel with the iTool system with the following command:

IREGISTER, 'My Panel', 'myPanel', /UI_PANEL, TYPES = 'MYTOOL'

Syntax


IRegister, Name, ItemName [, /ANNOTATION] [, /DEFAULT] [, /FILE_READER] [, /FILE_WRITER] [, TYPES=string] [, /UI_PANEL] [, /UI_SERVICE] [, /USER_INTERFACE] [, /VISUALIZATION]

Arguments


Name

A string containing the name used to refer to the associated class once registration is completed. Subsequent calls to create items of this type will use this name to identify the associated class.

The Name argument and the keywords specified (if any) are used to define the iTool identifier for the component being registered. If an item with the specified identifier has already been registered with the iTool system, the existing item will be replaced by the new item. This means that calling IREGISTER more than once with the same combination of Name argument and keywords will replace the previously registered item.

Note: If no keywords are supplied, Name is the name of an iTool.

ItemName

A string containing the class name of the object class or user interface routine that is to be associated with Name. When an item of name Name is requested from the system, an object of this class is created or the specified routine is called.

Note: If no keywords are supplied, ItemName is the name of an iTool class.

Keywords


Note: Keywords supplied in the call to IREGISTER but not listed here are passed directly to the underlying objects’ registration routines.

ANNOTATION

Set this keyword to indicate that an annotation is being registered with the system. When this keyword is set, the value of Name is the string used to refer to the annotation type, and ItemName is the class name of the annotation type’s object class.

DEFAULT

Set this keyword to specify that the item being registered should be the default item of its type. Making an item the default places the item first in the list of items of its type. When the iTool system chooses an item, it will use the first item in the list that matches the data type of the selected data. When items are displayed in a list for the user to select from, the default item will appear at the top of the list.

For example, if you register a visualization type with the DEFAULT keyword set, your visualization type will be used by the iTool (assuming the selected data is of the proper type) unless you specifically choose a different visualization type.

Note: If you register more than one item with the DEFAULT keyword set, the last item registered will appear first in the list of items of that type.

FILE_READER

Set this keyword to indicate that a file reader is being registered with the system. When this keyword is set, the value of Name is the string used to refer to the file reader, and ItemName is the class name of the file reader’s object class.

FILE_WRITER

Set this keyword to indicate that a file writer is being registered with the system. When this keyword is set, the value of Name is the string used to refer to the file writer, and ItemName is the class name of the file writer’s object class.

TYPES

This keyword is only used in conjunction with the UI_PANEL keyword.

Set this keyword equal to a string or string array containing iTool types with which the UI panel should be associated. When the registered type of a UI panel matches the registered type of an iTool, the panel will be displayed as part of the iTool’s interface.

UI_PANEL

Set this keyword to indicate that a UI panel is being registered with the system. When this keyword is set, the value of Name is the string used to refer to the panel and ItemName is the routine that should be called when the panel is created.

To specify that the UI panel is associated with a particular iTool or iTools, set the TYPES keyword to the iTool types that should expose this panel.

UI_SERVICE

Set this keyword to indicate that a UI service is being registered with the system. When this keyword is set, the value of Name is the string used to refer to the UI service and ItemName is the routine that should be called to execute the service.

USER_INTERFACE

Set this keyword to indicate that a user interface is being registered with the system. When this keyword is set, the value of Name is the string used to refer to the user interface, and ItemName is the name of the user interface procedure.

VISUALIZATION

Set this keyword to indicate that a visualization is being registered with the system. When this keyword is set, the value of Name is the string used to refer to the visualization type, and ItemName is the class name of the visualization type’s object class.

Version History


6.0

Introduced

6.1

Added ANNOTATION, DEFAULT, FILE_READER, FILE_WRITER, and USER_INTERFACE keywords

7.1

Routine name changed from ITREGISTER to IREGISTER.