TTMSFNCObjectInspector Class
Displays editable object properties or dataset fields in an inspector-style tree.
API unit family: TMSFNCObjectInspector
Inherits from: TTMSFNCTreeView
Syntax
TTMSFNCObjectInspector = class(TTMSFNCTreeView)
class PASCALIMPLEMENTATION TTMSFNCObjectInspector : public TTMSFNCTreeView
Properties
| Name | Description |
|---|---|
| DataSource | Gets or sets the data source whose fields are displayed by the inspector. |
| Designer | Gets or sets the designer component used to resolve component references. |
| Mode | Gets or sets whether the inspector shows properties, events, or both. |
Methods
| Name | Description |
|---|---|
| Initialize | Initializes the inspector columns, defaults, and design-time content. |
| InputListQuery | Shows a list-selection query dialog. |
| IsBitmap | Checks whether a class represents a bitmap. |
| IsCollection | Checks whether a class represents a collection. |
| IsColor | Checks whether a property name represents a color value. |
| IsComponent | Checks whether a class represents a component. |
| IsControl | Checks whether a class represents a visual control. |
| IsDate | Checks whether a property name represents a date value. |
| IsDateTime | Checks whether a property name represents a date and time value. |
| IsDescendingClass | Checks whether a class descends from any class name in the supplied list. |
| IsFillKind | Checks whether a property name represents a fill kind value. |
| IsGenericList | Checks whether a class represents a generic object list. |
| IsList | Checks whether a class represents a non-generic list. |
| IsStrings | Checks whether a class represents a string list or strings object. |
| IsStrokeKind | Checks whether a property name represents a stroke kind value. |
| IsTime | Checks whether a property name represents a time value. |
| RebuildList | Rebuilds the inspector tree from the assigned object or data source. |
Events
| Name | Description |
|---|---|
| OnBeforeOpenObjectEditor | Occurs before the object editor dialog is opened for an assignable property. |
| OnCustomizeObjectEditor | Occurs after the object editor dialog is created and before it is shown. |
| OnFieldValueChanged | Occurs after a dataset field value changes. |
| OnPropertyValueChanged | Occurs after an object property value changes. |
| OnReadDBField | Occurs before a dataset field is read into the inspector. |
| OnReadDBFieldValue | Occurs when a dataset field value is read. |
| OnReadProperty | Occurs before an object property is read into the inspector. |
| OnReadPropertyValue | Occurs when an object property value is read. |
| OnWriteDBFieldValue | Occurs before an edited dataset field value is written. |
| OnWritePropertyValue | Occurs before an edited object property value is written. |
Usage examples
Inspect a custom object
Creates a settings object with published properties and assigns it to the object inspector.
type
TEditorSettings = class(TPersistent)
private
FCaption: string;
FRefreshInterval: Integer;
published
property Caption: string read FCaption write FCaption;
property RefreshInterval: Integer read FRefreshInterval write FRefreshInterval;
end;
TForm1 = class(TForm)
private
FEditorSettings: TEditorSettings;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
FEditorSettings := TEditorSettings.Create;
FEditorSettings.Caption := 'Dashboard';
FEditorSettings.RefreshInterval := 30;
TMSFNCObjectInspector1.&Object := FEditorSettings;
TMSFNCObjectInspector1.RebuildList;
end;
procedure TForm1.FormDestroy(Sender: TObject);
begin
FEditorSettings.Free;
end;