Editing the Property as Text

From RAD Studio
Jump to: navigation, search

Go Up to Adding Property Editors


All properties need to provide a string representation of their values for the Object Inspector to display. Most properties also allow the user to type in a new value for the property. TPropertyEditor and its descendants provide virtual methods you can override to convert between the text representation and the actual value.

The methods you override are called GetValue and SetValue. Your property editor also inherits methods for assigning and reading different sorts of values from TPropertyEditor, as shown in the following table.

Property Type Get Method Set Method

Floating point

GetFloatValue

SetFloatValue

Method pointer (event)

GetMethodValue

SetMethodValue

Ordinal Type

GetOrdValue

SetOrdValue

String

GetStrValue

SetStrValue

When you override a GetValue method, you call one of the Get methods, and when you override SetValue, you call one of the Set methods. Many other related methods (such as TPropertyEditor.GetIntfValue, for a component interface type) are listed in the VCL/RTL Reference section of the help.

Topics

See Also