Property Interface • Properties and methods
PropertiesTPropertyInterfase 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.
MethodsTPropertyInterface 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.
PropertiesTProperty 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:
- 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.
- Contains True if the property is custom defined with RegisterCustomProperty procedure.
- Owner property or nil if the property is top-level. For instance, Style property has Font property as owner.
- 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
- Returns raw PTypeData pointer.
- Returns pointer to TTypeInfo record.
- Returns pointer to the 'get' function.
- Returns pointer to the 'set' procedure.
- Returns True if the property is stored in the DFM/FMX file, otherwise False.
- Returns index of the property.
- Returns default value of ordinal property.
- Returns name index for the property.
- Return name of the property.
- Returns full name of the property.
- Returns name of the property's type.
- Returns kind of the property type. TTypeKind enumeration is declared in the TypInfo unit.
Properties for ordinal types
- Type of ordinal property. TOrdType enumeration is declared in the TypInfo unit.
- Minimal possible value of the property.
- Maximal possible value of the property.
Properties for enumeration types
- Base type.
- Count of enumeration items.
- Array of enumeration items names.
- Array of enumeration items values.
Property for set types
- Base type.
Property for float types
- Base type.
Property for short string types
- Maximum length of the property value.
Properties for class types
- Class type of the property.
- Pointer to the raw data about parent property.
- Name of unit that contains the property's class declaration.
- Property list of the property.
Properties for the method (event handler) types
- Kind of method (procedure, function, constructor and so on).
- Count of the parameters list.
- Array of parameters flags (var, const, and so on).
- Array of parameters names.
- Array of parameters types.
- Array of parameters, items include complete declaration for each parameter with kind, names and types.
- Type of returned result.
- Complete method declaration.
Properties for interface types
- Pointer to the parent interface type.
- Flags of the property's interface. TIntfFlags enumeration is declared in the TypInfo unit.
- GUID of the property's interface.
- Name of unit that contains the property's interface declaration.
Properties for Int64 types
- Minimal value of the property.
- 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.