Deriving a Property-editor Class

From RAD Studio
Jump to: navigation, search

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


All ordinal-property editors (those for integer, character, and enumerated properties) descend from TOrdinalProperty.


All integer types, including predefined and user-defined subranges.


Char-type and subranges of Char, such as 'A'..'Z'.


Any enumerated type.


All floating-point numbers.




Individual elements in sets, shown as Boolean values


All sets. Sets are not directly editable, but can expand into a list of set-element properties.


Classes. Displays the name of the class and allows expansion of the class's properties.


Method pointers, most notably events.


Components in the same form. The user cannot edit the component's properties, but can point to a specific component of a compatible type.


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.


Font names. The drop down list displays all currently installed fonts.


Fonts. Allows expansion of individual font properties as well as access to the font dialog box.