Previous IDL Reference Guide: IDL Object Class Overview Next

Registered Properties

In order for an object property to be displayed in the WIDGET_PROPERTYSHEET interface, which makes it possible for a user to interactively change the value of the property using the mouse and keyboard, the following two conditions must be met:

Registering a Property

To register a property, use the RegisterProperty method of the IDLitComponent class:

Obj->IDLitComponent::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.

Property identifier strings must obey certain rules; see Property Identifiers for details. Property type codes are discussed in Registered Property Data Types. Property attributes are discussed in Property Attributes.

Registering All Available Properties

Some of the classes in the IDL object class library include a mechanism to register all available properties in a single operation. If an object class has a REGISTER_PROPERTIES property, then setting that property to 1 when creating the object automatically registers all properties that can be registered. If a property contains a "Yes" in the Registered box of the property description table, it will be registered automatically if the REGISTER_PROPERTIES property is set when the object is created. (See About Object Property Descriptions for a description of the property description table.)

Registered Property Data Types

Registered properties must be of one of the data types listed in the following table.


Note
Properties of objects that are not registered (that is, properties that cannot appear in a property sheet) can be of any IDL data type.

Table 4-1: iTools Property Data Types 

Table 4-1: iTools Property Data Types 
Type Code
Type
Description
0
USERDEF
User Defined properties can contain values of any IDL type, but must also include a string value that will be displayed in the property sheet. See the following discussion for additional information.
1
BOOLEAN
Boolean properties contain either the integer 0 or the integer 1.
2
INTEGER
Integer properties contain an integer value. If a property of integer data type has a VALID_RANGE attribute that includes an increment value, the property is displayed in a property sheet using a slider. If no increment value is supplied, the property sheet allows the user to edit values manually.
3
FLOAT
Float properties contain a double-precision floating-point value. If a property of float data type has a VALID_RANGE attribute that includes an increment value, the property is displayed in a property sheet using a slider. If no increment value is supplied, the property sheet allows the user to edit values manually.
4
STRING
String properties contain a scalar string value
5
COLOR
Color properties contain an RGB color triplet
6
LINESTYLE
Linestyle properties contain an integer value between 0 and 6, corresponding to the following IDL line styles:
  • 0 = Solid
  •  

  • 1 = Dotted
  •  

  • 2 = Dashed
  •  

  • 3 = Dash Dot
  •  

  • 4 = Dash Dot Dot
  •  

  • 5 = Long Dashes
  •  

  • 6 = No Line
See Property Controls for a visual example of the available line styles.
7
SYMBOL
Symbol properties contain an integer value between 0 and 8, corresponding to the following IDL symbol types:
  • 0 = No symbol
  •  

  • 1 = Plus sign
  •  

  • 2 = Asterisk
  •  

  • 3 = Period (Dot)
  •  

  • 4 = Diamond
  •  

  • 5 = Triangle
  •  

  • 6 = Square
  •  

  • 7 = X
  •  

  • 8 = "Greater-than" Arrow Head (>)
  •  

  • 9 = "Less-than" Arrow Head (<)
See Property Controls for a visual example of the available symbols.
8
THICKNESS
Thickness properties contain an integer value between 1 and 10, corresponding to the thickness (in points) of the line.
9
ENUMLIST
Enumerated List properties contain an array of string values defined when the property is registered. The GetProperty method returns the zero-based index of the selected item.

User Defined Property Types

The User Defined property type lets you create a custom interface that allow users of your iTool to select data of types other than the predefined iTool property types. Creating a user defined property type entails the following:

  IDL Online Help (March 06, 2007)