Property Interface • Properties and methods


TPropertyInterface

Properties

TPropertyInterfase contains two published properies: Root that points to the root component (usually owner form) contained handlers for all the components' events, and Instance that points to the currently selected object.

Also two public properties are available: Count that contains count of the properties in the current Instance and Properties - array-type property that contain all the properties of the current Instance.

Methods

TPropertyInterface has FindProperty method that returns the property by its name of full name. Full name contains complete name of the property with all its parent properties. Parts of full name is separated by '.'. For instance, the full name of property fsBold of Style property of Font property will be 'Font.Style.fsBold'. The same property can be accessed by recursive property finding: 'Style' in the Font property and 'fsBold' in the found Style property.

TProperty

Properties

TProperty represents the property of the object and has the same base properties that TPropertyInterface has: Root and Instance. Other properties can be divided into the following categories:

Internal properties

Emulated
Contains True is the is not a real property. For instance, all the set-type subproperties, like Boolean font styles in Style property of TFont are emulated.
Custom
Contains True if the property is custom defined with RegisterCustomProperty procedure.
OwnerProperty
Owner property or nil if the property is top-level. For instance, Style property has Font property as owner.
Level
Level number of the property in the object's properties hierarchy. For instance, Font property of control has Level = 0, Style's property level is 1 and fsBold property has Level = 2.

Raw PropInfo properties

TypeData
Returns raw PTypeData pointer.
PropType
Returns pointer to TTypeInfo record.
GetProc
Returns pointer to the 'get' function.
SetProc
Returns pointer to the 'set' procedure.
IsStored
Returns True if the property is stored in the DFM/FMX file, otherwise False.
Index
Returns index of the property.
Default
Returns default value of ordinal property.
NameIndex
Returns name index for the property.
Name
Return name of the property.
FullName
Returns full name of the property.
TypeName
Returns name of the property's type.
TypeKind
Returns kind of the property type. TTypeKind enumeration is declared in the TypInfo unit.

Properties for ordinal types

OrdType
Type of ordinal property. TOrdType enumeration is declared in the TypInfo unit.
MinValue
Minimal possible value of the property.
MaxValue
Maximal possible value of the property.

Properties for enumeration types

BaseType
Base type.
EnumCount
Count of enumeration items.
Names
Array of enumeration items names.
Values
Array of enumeration items values.

Property for set types

CompType
Base type.

Property for float types

FloatType
Base type.

Property for short string types

MaxLength
Maximum length of the property value.

Properties for class types

PropClassType
Class type of the property.
ParentInfo
Pointer to the raw data about parent property.
UnitName
Name of unit that contains the property's class declaration.
Properties
Property list of the property.

Properties for the method (event handler) types

MethodKind
Kind of method (procedure, function, constructor and so on).
ParamCount
Count of the parameters list.
ParamFlags
Array of parameters flags (var, const, and so on).
ParamNames
Array of parameters names.
ParamTypes
Array of parameters types.
Parameters
Array of parameters, items include complete declaration for each parameter with kind, names and types.
ResultType
Type of returned result.
MethodDeclaration
Complete method declaration.

Properties for interface types

IntfParent
Pointer to the parent interface type.
IntfFlags
Flags of the property's interface. TIntfFlags enumeration is declared in the TypInfo unit.
GUID
GUID of the property's interface.
IntfUnit
Name of unit that contains the property's interface declaration.

Properties for Int64 types

MinInt64Value
Minimal value of the property.
MaxInt64Value
Maximal value of the property.

Value access properties

AsFloat, AsMethod, AsInteger, AsChar, AsBoolean, AsObject, AsDateTime, AsDate, AsTime, AsString, AsVariant, AsInterface
Read-write properties that get and set value of the property.