Deriving a Property-editor Class
Go Up to Adding Property Editors
Both the component library define several kinds of property editors, all of which descend from TPropertyEditor. When you create a property editor, your property-editor class can either descend directly from TPropertyEditor or indirectly through one of the property-editor classes described in the table below. The classes in the DesignEditors unit can be used for VCL applications.
Note: All that is absolutely necessary for a property editor is that it descend from TBasePropertyEditor and that it support the IProperty interface. TPropertyEditor, however, provides a default implementation of the IProperty interface.
The list in the table below is not complete. The VCLEditors unit also defines some very specialized property editors used by unique properties such as the component name. The listed property editors are the ones that are the most useful for user-defined properties.
Predefined property-editor types :
Type | Properties edited |
---|---|
TOrdinalProperty |
All ordinal-property editors (those for integer, character, and enumerated properties) descend from TOrdinalProperty. |
TIntegerProperty |
All integer types, including predefined and user-defined subranges. |
TCharProperty |
Char-type and subranges of Char, such as 'A'..'Z'. |
TEnumProperty |
Any enumerated type. |
TFloatProperty |
All floating-point numbers. |
TStringProperty |
Strings. |
TSetElementProperty |
Individual elements in sets, shown as Boolean values |
TSetProperty |
All sets. Sets are not directly editable, but can expand into a list of set-element properties. |
TClassProperty |
Classes. Displays the name of the class and allows expansion of the class's properties. |
TMethodProperty |
Method pointers, most notably events. |
TComponentProperty |
Components in the same form. The user cannot edit the component's properties, but can point to a specific component of a compatible type. |
TColorProperty |
Component colors. Shows color constants if applicable, otherwise displays hexadecimal value. Drop down list contains the color constants. Double-click opens the color-selection dialog box. |
TFontNameProperty |
Font names. The drop down list displays all currently installed fonts. |
TFontProperty |
Fonts. Allows expansion of individual font properties as well as access to the font dialog box. |