user manual

Chapter 10: Creating a File Writer 261
iTool Developer’s Guide Creating a New File Writer
This convention is used in all file writer classes included with IDL. We strongly
suggest that you include similar checks in your own class definition files.
Keywords to the Init Method
Properties of the file writer class can be set in the Init method by specifying the
property names and values as IDL keyword-value pairs. In addition to any keywords
implemented directly in the Init method of the superclass on which you base your
class, the properties of the IDLitWriter class, IDLitComponent class, and
IDLitIMessaging class are available to any file writer class. See “IDLitReader
Properties”, “IDLitComponent Properties”, and “IDLitIMessaging Properties” (IDL
Reference Guide).
Note
Always use keyword inheritance (the _EXTRA keyword) to pass keyword
parameters through to the superclass. (See “Keyword Inheritance” (Chapter 5,
Application Programming) for details on IDLs keyword inheritance mechanism.)
Standard Base Class
While you can create your new file writer class from any existing file writer class, in
many cases, file writer classes you create will be subclassed directly from the base
class IDLitWriter:
IF ( self->IDLitWriter::Init(
Extensions
, TYPES =
types
, $
_EXTRA = _extra) EQ 0) $
THEN RETURN, 0
where Extensions is a string or array of strings specifying the filename extensions
readable by your file writer and types is a string or array of strings specifying the
iTool data types for which this writer is available. (See iTool Data Types on
page 54 for details on iTool data types.)
Note
The value of the Extensions argument is used only to display the proper filename
filter when a File Save dialog is displayed — it is not a check for the proper
filetype.
The IDLitWriter class provides the base iTool file writer functionality used in the
tools created by ITT Visual Information Solutions. See “Subclassing from the
IDLitWriter Class” on page 258 for details.