Types of Properties

From RAD Studio
Jump to: navigation, search

Go Up to Creating properties Index


A property can be of any type. Different types are displayed differently in the Object Inspector, which validates property assignments as they are made at design time.

How properties appear in the Object Inspector:

Property type Treatment

Simple

Numeric, character, and string properties appear as numbers, characters, and strings. You can edit the value of the property directly.

Enumerated

Properties of enumerated types (including Boolean) appear as editable strings. You can also cycle through the possible values by double-clicking the value column, and there is a drop-down list that shows all possible values.

Set

Properties of set types appear as sets. By double-clicking on the property, the developer can expand the set and treat each element as a Boolean value (true if it is included in the set).

Object

Properties that are themselves classes often have their own property editors, specified in the component's registration procedure. If the class held by a property has its own published properties, the Object Inspector lets you expand the list (by double-clicking) to include these properties and edit them individually. Object properties must descend from TPersistent.

Interface

Properties that are interfaces can appear in the Object Inspector as long as the value is an interface that is implemented by a component (a descendant of TComponent). Interface properties often have their own property editors.

Array

Array properties must have their own property editors; the Object Inspector has no built-in support for editing them. You can specify a property editor when you register your components.