Registering Properties

In order for a property associated with an iTool component to be included in the property sheet for that component, the property must be registered with the iTool. The property registration mechanism accomplishes several things:

Registering a Property

Register a property by calling the RegisterProperty method of the IDLitComponent class:

self->RegisterProperty, PropertyIdentifier [, TypeCode] $ 
   [, ATTRIBUTE = value] 

where PropertyIdentifier is a string that uniquely identifies the property, TypeCode is an integer between 0 and 9 specifying the property data type, and ATTRIBUTE is a property attribute. You can specify multiple property attributes in the call to RegisterProperty; see Property Attributes for details.

Note
The property identifier string must obey certain rules; see Property Identifiers for details.

You can omit the TypeCode parameter and specify a type keyword; the following two method calls are identical:

self->RegisterProperty, 'MYPROPERTY', 1 
 
self->RegisterProperty, 'MYPROPERTY', /BOOLEAN 

See Property Data Types for a list of property data types, their type codes, and the associated keywords to the RegisterProperty method.

A typical property registration call looks like the following:

self->RegisterProperty, 'FONT_STYLE', $ 
   ENUMLIST = ['Normal', 'Bold'], $ 
   NAME = 'Font style' 

Here, the string argument FONT_STYLE is the property identifier of the property being registered; this string must be the same as the name of the keyword used with the GetProperty or SetProperty method when changing the value of the property.

The ENUMLIST keyword specifies that the property data type is an enumerated list of strings containing two possible property values ('Normal', 'Bold'); this will appear as a pulldown list of values in the property sheet. The NAME keyword specifies the string that will be used as the label for the property in the property sheet; if NAME is omitted, the property identifier string will be used in the property sheet.

Note
Values set via keywords to the RegisterProperty method are known as property attributes. Property attributes can be modified after registration using the SetPropertyAttribute method, described in Property Attributes.

Additional keywords can be set in the call to RegisterProperty. See the documentation for "IDLitComponent::RegisterProperty" (IDL Reference Guide) for additional details.

In addition to registering the property using RegisterProperty, you must make sure that the GetProperty and SetProperty methods of your object handle the value of the property being registered.

Pre-Registered Properties

Not all properties need to be explicitly registered in your iTool code in order to be displayed in a property sheet. Most of the IDL graphics objects (IDLgrAxis, IDLgrPlot, etc.) have a set of properties that are automatically registered if you set the REGISTER_PROPERTIES property of the object to 1 when it is instantiated. See the list of object properties contained in the documentation for the IDL graphics objects in the IDL Reference Guide to determine which properties are registered when the REGISTER_PROPERTIES property is set.

There may be times when you want some, but not all, of the registrable properties of a graphics object to appear in the property sheet interface. You have two options in this case:

  1. Register the properties of the graphics object individually, with calls to the RegisterProperty method.
  2. Use the REGISTER_PROPERTIES keyword when instantiating the graphics object, then set the HIDE property attribute on the properties you want to remove from the property sheet. See Property Attributes for more on this option.