Adding Property Editors

From RAD Studio
Jump to: navigation, search

Go Up to Making Components Available at Design Time

The Object Inspector provides default editing for all types of properties. You can, however, provide an alternate editor for specific properties by writing and registering property editors. You can register property editors that apply only to the properties in the components you write, but you can also create editors that apply to all properties of a certain type.

At the simplest level, a property editor can operate in either or both of two ways: displaying and allowing the user to edit the current value as a text string, and displaying a dialog box that permits some other kind of editing. Depending on the property being edited, you might find it useful to provide either or both kinds.

Writing a property editor requires these steps:

  1. Deriving a property-editor class.
  2. Editting the property, either as text or as a whole.
  3. Specifying editor attributes.
  4. Registering the property editor.