home *** CD-ROM | disk | FTP | other *** search
Text File | 1999-08-11 | 57.3 KB | 1,371 lines |
-
- {*******************************************************}
- { }
- { Borland Delphi Visual Component Library }
- { }
- { Copyright (c) 1995,99 Inprise Corporation }
- { }
- {*******************************************************}
-
- unit DsgnIntf;
-
- interface
-
- {$N+,S-,R-}
-
- uses
- Windows, Activex, SysUtils, Classes, Graphics, Controls, Forms, Contnrs, IniFiles,
- TypInfo, Masks, Menus;
-
- type
-
- TEditAction = (eaUndo, eaRedo, eaCut, eaCopy, eaPaste, eaDelete, eaSelectAll,
- eaPrint, eaBringToFront, eaSendToBack, eaAlignToGrid, eaFlipChildrenAll,
- eaFlipChildrenSelected);
-
- TEditState = set of (esCanUndo, esCanRedo, esCanCut, esCanCopy, esCanPaste,
- esCanDelete, esCanZOrder, esCanAlignGrid, esCanEditOle, esCanTabOrder,
- esCanCreationOrder, esCanPrint, esCanSelectAll);
-
- IEventInfos = interface
- ['{11667FF0-7590-11D1-9FBC-0020AF3D82DA}']
- function GetCount: Integer;
- function GetEventValue(Index: Integer): string;
- function GetEventName(Index: Integer): string;
- procedure ClearEvent(Index: Integer);
- property Count: Integer;
- end;
-
- IPersistent = interface
- ['{82330133-65D1-11D1-9FBB-0020AF3D82DA}'] {Java}
- procedure DestroyObject;
- function Equals(const Other: IPersistent): Boolean;
- function GetClassname: string;
- function GetEventInfos: IEventInfos;
- function GetNamePath: string;
- function GetOwner: IPersistent;
- function InheritsFrom(const Classname: string): Boolean;
- function IsComponent: Boolean; // object is stream createable
- function IsControl: Boolean;
- function IsWinControl: Boolean;
- property Classname: string;
- property Owner: IPersistent;
- property NamePath: string;
- // property PersistentProps[Index: Integer]: IPersistent
- // property PersistentPropCount: Integer;
- property EventInfos: IEventInfos;
- end;
-
- IComponent = interface(IPersistent)
- ['{B2F6D681-5098-11D1-9FB5-0020AF3D82DA}'] {Java}
- function FindComponent(const Name: string): IComponent;
- function GetComponentCount: Integer;
- function GetComponents(Index: Integer): IComponent;
- function GetComponentState: TComponentState;
- function GetComponentStyle: TComponentStyle;
- function GetDesignInfo: TSmallPoint;
- function GetDesignOffset: TPoint;
- function GetDesignSize: TPoint;
- function GetName: string;
- function GetOwner: IComponent;
- function GetParent: IComponent;
- procedure SetDesignInfo(const Point: TSmallPoint);
- procedure SetDesignOffset(const Point: TPoint);
- procedure SetDesignSize(const Point: TPoint);
- procedure SetName(const Value: string);
- property ComponentCount: Integer;
- property Components[Index: Integer]: IComponent;
- property ComponentState: TComponentState;
- property ComponentStyle: TComponentStyle;
- property DesignInfo: TSmallPoint;
- property DesignOffset: TPoint;
- property DesignSize: TPoint;
- property Name: string;
- property Owner: IComponent;
- property Parent: IComponent;
- end;
-
- IImplementation = interface
- ['{F9D448F2-50BC-11D1-9FB5-0020AF3D82DA}']
- function GetInstance: TObject;
- end;
-
- function MakeIPersistent(Instance: TPersistent): IPersistent;
- function ExtractPersistent(const Intf: IUnknown): TPersistent;
- function TryExtractPersistent(const Intf: IUnknown): TPersistent;
-
- function MakeIComponent(Instance: TComponent): IComponent;
- function ExtractComponent(const Intf: IUnknown): TComponent;
- function TryExtractComponent(const Intf: IUnknown): TComponent;
-
- var
- MakeIPersistentProc: function (Instance: TPersistent): IPersistent = nil;
- MakeIComponentProc: function (Instance: TComponent): IComponent = nil;
-
- type
-
- { IDesignerSelections }
- { Used to transport the selected objects list in and out of the form designer.
- Replaces TDesignerSelectionList in form designer interface. }
-
- IDesignerSelections = interface
- ['{82330134-65D1-11D1-9FBB-0020AF3D82DA}'] {Java}
- function Add(const Item: IPersistent): Integer;
- function Equals(const List: IDesignerSelections): Boolean;
- function Get(Index: Integer): IPersistent;
- function GetCount: Integer;
- property Count: Integer;
- property Items[Index: Integer]: IPersistent; default;
- end;
-
- function CreateSelectionList: IDesignerSelections;
-
- type
-
- TDesignerSelectionList = class;
-
- IComponentList = interface
- ['{8ED8AD16-A241-11D1-AA94-00C04FB17A72}']
- function GetComponentList: TDesignerSelectionList;
- end;
-
- { TDesignerSelectionList }
- { Used to transport VCL component selections between property editors }
-
- TDesignerSelectionList = class(TInterfacedObject, IDesignerSelections,
- IComponentList)
- public
- constructor Create;
- destructor Destroy; override;
- function Add(Item: TPersistent): Integer;
- function Equals(List: TDesignerSelectionList): Boolean;
- property Count: Integer;
- property Items[Index: Integer]: TPersistent; default;
- end;
-
- { IFormDesigner
- BuildLocalMenu - Constructs and returns the popup menu for the currently
- selected component(s). Base is the popup menu that will receive additional
- menu items. If Base is nil, a default popup menu is constructed containing
- the default designer menu items, like "Align to Grid". The menu object
- returned by this function is owned by the designer and will be destroyed
- the next time BuildLocalMenu is called (the next time a Popup menu is
- invoked on the designer). If you pass in a Base menu, you don't own it
- anymore. It will be destroyed later.
- }
- type
- TLocalMenuFilter = (lmModule, lmComponent, lmDesigner);
- TLocalMenuFilters = set of TLocalMenuFilter;
-
- const
- cNoLocalMenus = [lmModule, lmComponent, lmDesigner];
- cAllLocalMenus = [];
- cLocalMenusIf: array [boolean] of TLocalMenuFilters =
- (cNoLocalMenus, cAllLocalMenus);
-
- type
- IFormDesigner = interface(IDesigner)
- ['{ADDD444D-1B03-11D3-A8F8-00C04FA32F53}']
- function CreateMethod(const Name: string; TypeData: PTypeData): TMethod;
- function GetMethodName(const Method: TMethod): string;
- procedure GetMethods(TypeData: PTypeData; Proc: TGetStrProc);
- function GetPrivateDirectory: string;
- procedure GetSelections(const List: IDesignerSelections);
- function MethodExists(const Name: string): Boolean;
- procedure RenameMethod(const CurName, NewName: string);
- procedure SelectComponent(Instance: TPersistent);
- procedure SetSelections(const List: IDesignerSelections);
- procedure ShowMethod(const Name: string);
- procedure GetComponentNames(TypeData: PTypeData; Proc: TGetStrProc);
- function GetComponent(const Name: string): TComponent;
- function GetComponentName(Component: TComponent): string;
- function GetObject(const Name: string): TPersistent;
- function GetObjectName(Instance: TPersistent): string;
- procedure GetObjectNames(TypeData: PTypeData; Proc: TGetStrProc);
- function MethodFromAncestor(const Method: TMethod): Boolean;
- function CreateComponent(ComponentClass: TComponentClass; Parent: TComponent;
- Left, Top, Width, Height: Integer): TComponent;
- function IsComponentLinkable(Component: TComponent): Boolean;
- procedure MakeComponentLinkable(Component: TComponent);
- procedure Revert(Instance: TPersistent; PropInfo: PPropInfo);
- function GetIsDormant: Boolean;
- function HasInterface: Boolean;
- function HasInterfaceMember(const Name: string): Boolean;
- procedure AddToInterface(InvKind: Integer; const Name: string; VT: Word;
- const TypeInfo: string);
- procedure GetProjectModules(Proc: TGetModuleProc);
- function GetAncestorDesigner: IFormDesigner;
- function IsSourceReadOnly: Boolean;
- function GetContainerWindow: TWinControl;
- procedure SetContainerWindow(const NewContainer: TWinControl);
- function GetScrollRanges(const ScrollPosition: TPoint): TPoint;
- procedure Edit(const Component: IComponent);
- function BuildLocalMenu(Base: TPopupMenu; Filter: TLocalMenuFilters): TPopupMenu;
- procedure ChainCall(const MethodName, InstanceName, InstanceMethod: string;
- TypeData: PTypeData);
- procedure CopySelection;
- procedure CutSelection;
- function CanPaste: Boolean;
- procedure PasteSelection;
- procedure DeleteSelection;
- procedure ClearSelection;
- procedure NoSelection;
- procedure ModuleFileNames(var ImplFileName, IntfFileName, FormFileName: string);
- function GetRootClassName: string;
- property IsDormant: Boolean;
- property AncestorDesigner: IFormDesigner;
- property ContainerWindow: TWinControl;
- end;
-
- IDesignNotification = interface
- ['{3250122F-D336-11D2-B725-00C04FA35D12}']
- procedure ItemDeleted(const AItem: IPersistent);
- procedure ItemInserted(const AItem: IPersistent);
- procedure ItemsModified(const ADesigner: IUnknown);
- procedure SelectionChanged(const ASelection: IDesignerSelections);
- procedure DesignerInitialized(const ADesigner: IUnknown);
- procedure DesignerClosed(const ADesigner: IUnknown);
- end;
-
- { IDesignerPopulateMenu
- Allows a design surface an opportunity to add context-sensitive menu items
- to the designer's popup menu. This is in addition to the component editor
- verbs and the custom module verbs. }
-
- IDesignerPopulateMenu = interface
- ['{66C7D913-EC70-11D2-AAD1-00C04FB16FBC}']
- procedure PopulateMenu(const APopupMenu: TPopupMenu);
- end;
-
- { TPropertyEditor
- Edits a property of a component, or list of components, selected into the
- Object Inspector. The property editor is created based on the type of the
- property being edited as determined by the types registered by
- RegisterPropertyEditor. The Object Inspector uses a TPropertyEditor
- for all modification to a property. GetName and GetValue are called to display
- the name and value of the property. SetValue is called whenever the user
- requests to change the value. Edit is called when the user double-clicks the
- property in the Object Inspector. GetValues is called when the drop-down
- list of a property is displayed. GetProperties is called when the property
- is expanded to show sub-properties. AllEqual is called to decide whether or
- not to display the value of the property when more than one component is
- selected.
-
- The following are methods that can be overridden to change the behavior of
- the property editor:
-
- Activate
- Called whenever the property becomes selected in the object inspector.
- This is potentially useful to allow certain property attributes to
- to only be determined whenever the property is selected in the object
- inspector. Only paSubProperties and paMultiSelect, returned from
- GetAttributes, need to be accurate before this method is called.
- AllEqual
- Called whenever there is more than one component selected. If this
- method returns true, GetValue is called, otherwise blank is displayed
- in the Object Inspector. This is called only when GetAttributes
- returns paMultiSelect.
- AutoFill
- Called to determine whether the values returned by GetValues can be
- selected incrementally in the Object Inspector. This is called only when
- GetAttributes returns paValueList.
- Edit
- Called when the '...' button is pressed or the property is double-clicked.
- This can, for example, bring up a dialog to allow the editing the
- component in some more meaningful fashion than by text (e.g. the Font
- property).
- GetAttributes
- Returns the information for use in the Object Inspector to be able to
- show the appropriate tools. GetAttributes returns a set of type
- TPropertyAttributes:
- paValueList: The property editor can return an enumerated list of
- values for the property. If GetValues calls Proc
- with values then this attribute should be set. This
- will cause the drop-down button to appear to the right
- of the property in the Object Inspector.
- paSortList: Object Inspector to sort the list returned by
- GetValues.
- paSubProperties: The property editor has sub-properties that will be
- displayed indented and below the current property in
- standard outline format. If GetProperties will
- generate property objects then this attribute should
- be set.
- paDialog: Indicates that the Edit method will bring up a
- dialog. This will cause the '...' button to be
- displayed to the right of the property in the Object
- Inspector.
- paMultiSelect: Allows the property to be displayed when more than
- one component is selected. Some properties are not
- appropriate for multi-selection (e.g. the Name
- property).
- paAutoUpdate: Causes the SetValue method to be called on each
- change made to the editor instead of after the change
- has been approved (e.g. the Caption property).
- paReadOnly: Value is not allowed to change.
- paRevertable: Allows the property to be reverted to the original
- value. Things that shouldn't be reverted are nested
- properties (e.g. Fonts) and elements of a composite
- property such as set element values.
- paFullWidthName: Tells the object inspector that the value does not
- need to be rendered and as such the name should be
- rendered the full width of the inspector.
- GetComponent
- Returns the Index'th component being edited by this property editor. This
- is used to retrieve the components. A property editor can only refer to
- multiple components when paMultiSelect is returned from GetAttributes.
- GetEditLimit
- Returns the number of character the user is allowed to enter for the
- value. The inplace editor of the object inspector will be have its
- text limited set to the return value. By default this limit is 255.
- GetName
- Returns the name of the property. By default the value is retrieved
- from the type information with all underbars replaced by spaces. This
- should only be overridden if the name of the property is not the name
- that should appear in the Object Inspector.
- GetProperties
- Should be overridden to call PropertyProc for every sub-property (or
- nested property) of the property begin edited and passing a new
- TPropertyEdtior for each sub-property. By default, PropertyProc is not
- called and no sub-properties are assumed. TClassProperty will pass a
- new property editor for each published property in a class. TSetProperty
- passes a new editor for each element in the set.
- GetPropType
- Returns the type information pointer for the property(s) being edited.
- GetValue
- Returns the string value of the property. By default this returns
- '(unknown)'. This should be overridden to return the appropriate value.
- GetValues
- Called when paValueList is returned in GetAttributes. Should call Proc
- for every value that is acceptable for this property. TEnumProperty
- will pass every element in the enumeration.
- Initialize
- Called after the property editor has been created but before it is used.
- Many times property editors are created and because they are not a common
- property across the entire selection they are thrown away. Initialize is
- called after it is determined the property editor is going to be used by
- the object inspector and not just thrown away.
- SetValue(Value)
- Called to set the value of the property. The property editor should be
- able to translate the string and call one of the SetXxxValue methods. If
- the string is not in the correct format or not an allowed value, the
- property editor should generate an exception describing the problem. Set
- value can ignore all changes and allow all editing of the property be
- accomplished through the Edit method (e.g. the Picture property).
- ListMeasureWidth(Value, Canvas, AWidth)
- This is called during the width calculation phase of the drop down list
- preparation.
- ListMeasureHeight(Value, Canvas, AHeight)
- This is called during the item/value height calculation phase of the drop
- down list's render. This is very similar to TListBox's OnMeasureItem,
- just slightly different parameters.
- ListDrawValue(Value, Canvas, Rect, Selected)
- This is called during the item/value render phase of the drop down list's
- render. This is very similar to TListBox's OnDrawItem, just slightly
- different parameters.
- PropDrawName(Canvas, Rect, Selected)
- Called during the render of the name column of the property list. Its
- functionality is very similar to TListBox's OnDrawItem, but once again
- it has slightly different parameters.
- PropDrawValue(Canvas, Rect, Selected)
- Called during the render of the value column of the property list. Its
- functionality is similar to PropDrawName. If multiple items are selected
- and their values don't match this procedure will be passed an empty
- value.
-
- Properties and methods useful in creating a new TPropertyEditor classes:
-
- Name property
- Returns the name of the property returned by GetName
- PrivateDirectory property
- It is either the .EXE or the "working directory" as specified in
- the registry under the key:
- "HKEY_CURRENT_USER\Software\Borland\Delphi\*\Globals\PrivateDir"
- If the property editor needs auxiliary or state files (templates, examples,
- etc) they should be stored in this directory.
- Value property
- The current value, as a string, of the property as returned by GetValue.
- Modified
- Called to indicate the value of the property has been modified. Called
- automatically by the SetXxxValue methods. If you call a TProperty
- SetXxxValue method directly, you *must* call Modified as well.
- GetXxxValue
- Gets the value of the first property in the Properties property. Calls
- the appropriate TProperty GetXxxValue method to retrieve the value.
- SetXxxValue
- Sets the value of all the properties in the Properties property. Calls
- the approprate TProperty SetXxxxValue methods to set the value.
- GetVisualValue
- This function will return the displayable value of the property. If
- only one item is selected or all the multi-selected items have the same
- property value then this function will return the actual property value.
- Otherwise this function will return an empty string.}
-
- TPropertyAttribute = (paValueList, paSubProperties, paDialog, paMultiSelect,
- paAutoUpdate, paSortList, paReadOnly, paRevertable, paFullWidthName);
- TPropertyAttributes = set of TPropertyAttribute;
-
- TPropertyEditor = class;
-
- TInstProp = record
- Instance: TPersistent;
- PropInfo: PPropInfo;
- end;
-
- PInstPropList = ^TInstPropList;
- TInstPropList = array[0..1023] of TInstProp;
-
- TGetPropEditProc = procedure(Prop: TPropertyEditor) of object;
-
- TPropertyEditor = class
- protected
- constructor Create(const ADesigner: IFormDesigner; APropCount: Integer); virtual;
- function GetPropInfo: PPropInfo;
- function GetFloatValue: Extended;
- function GetFloatValueAt(Index: Integer): Extended;
- function GetInt64Value: Int64;
- function GetInt64ValueAt(Index: Integer): Int64;
- function GetMethodValue: TMethod;
- function GetMethodValueAt(Index: Integer): TMethod;
- function GetOrdValue: Longint;
- function GetOrdValueAt(Index: Integer): Longint;
- function GetStrValue: string;
- function GetStrValueAt(Index: Integer): string;
- function GetVarValue: Variant;
- function GetVarValueAt(Index: Integer): Variant;
- procedure Modified;
- procedure SetFloatValue(Value: Extended);
- procedure SetMethodValue(const Value: TMethod);
- procedure SetInt64Value(Value: Int64);
- procedure SetOrdValue(Value: Longint);
- procedure SetStrValue(const Value: string);
- procedure SetVarValue(const Value: Variant);
- public
- destructor Destroy; override;
- procedure Activate; virtual;
- function AllEqual: Boolean; virtual;
- function AutoFill: Boolean; virtual;
- procedure Edit; virtual;
- function GetAttributes: TPropertyAttributes; virtual;
- function GetComponent(Index: Integer): TPersistent;
- function GetEditLimit: Integer; virtual;
- function GetName: string; virtual;
- procedure GetProperties(Proc: TGetPropEditProc); virtual;
- function GetPropType: PTypeInfo;
- function GetValue: string; virtual;
- function GetVisualValue: string;
- procedure GetValues(Proc: TGetStrProc); virtual;
- procedure Initialize; virtual;
- procedure Revert;
- procedure SetValue(const Value: string); virtual;
- function ValueAvailable: Boolean;
- procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas;
- var AWidth: Integer); dynamic;
- procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas;
- var AHeight: Integer); dynamic;
- procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
- const ARect: TRect; ASelected: Boolean); dynamic;
- procedure PropDrawName(ACanvas: TCanvas; const ARect: TRect;
- ASelected: Boolean); dynamic;
- procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect;
- ASelected: Boolean); dynamic;
- property Designer: IFormDesigner;
- property PrivateDirectory: string;
- property PropCount: Integer;
- property Value: string;
- end;
-
- TPropertyEditorClass = class of TPropertyEditor;
-
- { TOrdinalProperty
- The base class of all ordinal property editors. It established that ordinal
- properties are all equal if the GetOrdValue all return the same value. }
-
- TOrdinalProperty = class(TPropertyEditor)
- function AllEqual: Boolean; override;
- function GetEditLimit: Integer; override;
- end;
-
- { TIntegerProperty
- Default editor for all Longint properties and all subtypes of the Longint
- type (i.e. Integer, Word, 1..10, etc.). Restricts the value entered into
- the property to the range of the sub-type. }
-
- TIntegerProperty = class(TOrdinalProperty)
- public
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TCharProperty
- Default editor for all Char properties and sub-types of Char (i.e. Char,
- 'A'..'Z', etc.). }
-
- TCharProperty = class(TOrdinalProperty)
- public
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TEnumProperty
- The default property editor for all enumerated properties (e.g. TShape =
- (sCircle, sTriangle, sSquare), etc.). }
-
- TEnumProperty = class(TOrdinalProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- end;
-
- TBoolProperty = class(TEnumProperty)
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TInt64Property
- Default editor for all Int64 properties and all subtypes of Int64. }
-
- TInt64Property = class(TPropertyEditor)
- public
- function AllEqual: Boolean; override;
- function GetEditLimit: Integer; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TFloatProperty
- The default property editor for all floating point types (e.g. Float,
- Single, Double, etc.) }
-
- TFloatProperty = class(TPropertyEditor)
- public
- function AllEqual: Boolean; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TStringProperty
- The default property editor for all strings and sub types (e.g. string,
- string[20], etc.). }
-
- TStringProperty = class(TPropertyEditor)
- public
- function AllEqual: Boolean; override;
- function GetEditLimit: Integer; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TNestedProperty
- A property editor that uses the parent's Designer, PropList and PropCount.
- The constructor and destructor do not call inherited, but all derived classes
- should. This is useful for properties like the TSetElementProperty. }
-
- TNestedProperty = class(TPropertyEditor)
- public
- constructor Create(Parent: TPropertyEditor); reintroduce;
- destructor Destroy; override;
- end;
-
- { TSetElementProperty
- A property editor that edits an individual set element. GetName is
- changed to display the set element name instead of the property name and
- Get/SetValue is changed to reflect the individual element state. This
- editor is created by the TSetProperty editor. }
-
- TSetElementProperty = class(TNestedProperty)
- protected
- constructor Create(Parent: TPropertyEditor; AElement: Integer); reintroduce;
- public
- function AllEqual: Boolean; override;
- function GetAttributes: TPropertyAttributes; override;
- function GetName: string; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TSetProperty
- Default property editor for all set properties. This editor does not edit
- the set directly but will display sub-properties for each element of the
- set. GetValue displays the value of the set in standard set syntax. }
-
- TSetProperty = class(TOrdinalProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- procedure GetProperties(Proc: TGetPropEditProc); override;
- function GetValue: string; override;
- end;
-
- { TClassProperty
- Default property editor for all objects. Does not allow modifying the
- property but does display the class name of the object and will allow the
- editing of the object's properties as sub-properties of the property. }
-
- TClassProperty = class(TPropertyEditor)
- public
- function GetAttributes: TPropertyAttributes; override;
- procedure GetProperties(Proc: TGetPropEditProc); override;
- function GetValue: string; override;
- end;
-
- { TMethodProperty
- Property editor for all method properties. }
-
- TMethodProperty = class(TPropertyEditor)
- public
- function AllEqual: Boolean; override;
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- function GetEditLimit: Integer; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const AValue: string); override;
- function GetFormMethodName: string; virtual;
- function GetTrimmedEventName: string;
- end;
-
- { TComponentProperty
- The default editor for TComponents. It does not allow editing of the
- properties of the component. It allow the user to set the value of this
- property to point to a component in the same form that is type compatible
- with the property being edited (e.g. the ActiveControl property). }
-
- TComponentProperty = class(TPropertyEditor)
- public
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- function GetEditLimit: Integer; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TComponentNameProperty
- Property editor for the Name property. It restricts the name property
- from being displayed when more than one component is selected. }
-
- TComponentNameProperty = class(TStringProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- function GetEditLimit: Integer; override;
- end;
-
- { TFontNameProperty
- Editor for the TFont.FontName property. Displays a drop-down list of all
- the fonts known by Windows. The following global variable will make
- this property editor actually show examples of each of the fonts in the
- drop down list. We would have enabled this by default but it takes
- too many cycles on slower machines or those with a lot of fonts. Enable
- it at your own risk. ;-}
- var
- FontNamePropertyDisplayFontNames: Boolean = False;
-
- type
- TFontNameProperty = class(TStringProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- procedure GetValues(Proc: TGetStrProc); override;
-
- procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas;
- var AHeight: Integer); override;
- procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas;
- var AWidth: Integer); override;
- procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
- const ARect: TRect; ASelected: Boolean); override;
- end;
-
- { TFontCharsetProperty
- Editor for the TFont.Charset property. Displays a drop-down list of the
- character-set by Windows.}
-
- TFontCharsetProperty = class(TIntegerProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TImeNameProperty
- Editor for the TImeName property. Displays a drop-down list of all
- the IME names known by Windows.}
-
- TImeNameProperty = class(TStringProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- procedure GetValues(Proc: TGetStrProc); override;
- end;
-
- { TColorProperty
- Property editor for the TColor type. Displays the color as a clXXX value
- if one exists, otherwise displays the value as hex. Also allows the
- clXXX value to be picked from a list. }
-
- TColorProperty = class(TIntegerProperty)
- public
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
-
- procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas;
- var AWidth: Integer); override;
- procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
- const ARect: TRect; ASelected: Boolean); override;
- procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect;
- ASelected: Boolean); override;
- end;
-
- { TBrushStyleProperty
- Property editor for TBrush's Style. Simply provides for custom render. }
-
- TBrushStyleProperty = class(TEnumProperty)
- public
- procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas;
- var AWidth: Integer); override;
- procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
- const ARect: TRect; ASelected: Boolean); override;
- procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect;
- ASelected: Boolean); override;
- end;
-
- { TPenStyleProperty
- Property editor for TPen's Style. Simply provides for custom render. }
-
- TPenStyleProperty = class(TEnumProperty)
- public
- procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas;
- var AWidth: Integer); override;
- procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
- const ARect: TRect; ASelected: Boolean); override;
- procedure PropDrawValue(ACanvas: TCanvas; const ARect: TRect;
- ASelected: Boolean); override;
- end;
-
- { TCursorProperty
- Property editor for the TCursor type. Displays the cursor as a clXXX value
- if one exists, otherwise displays the value as hex. Also allows the
- clXXX value to be picked from a list. }
-
- TCursorProperty = class(TIntegerProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- procedure ListMeasureHeight(const Value: string; ACanvas: TCanvas;
- var AHeight: Integer); override;
- procedure ListMeasureWidth(const Value: string; ACanvas: TCanvas;
- var AWidth: Integer); override;
- procedure ListDrawValue(const Value: string; ACanvas: TCanvas;
- const ARect: TRect; ASelected: Boolean); override;
- end;
-
- { TFontProperty
- Property editor for the Font property. Brings up the font dialog as well as
- allowing the properties of the object to be edited. }
-
- TFontProperty = class(TClassProperty)
- public
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- end;
-
- { TModalResultProperty }
-
- TModalResultProperty = class(TIntegerProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TShortCutProperty
- Property editor the ShortCut property. Allows both typing in a short
- cut value or picking a short-cut value from a list. }
-
- TShortCutProperty = class(TOrdinalProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure GetValues(Proc: TGetStrProc); override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TMPFilenameProperty
- Property editor for the TMediaPlayer. Displays an File Open Dialog
- for the name of the media file.}
-
- TMPFilenameProperty = class(TStringProperty)
- public
- procedure Edit; override;
- function GetAttributes: TPropertyAttributes; override;
- end;
-
- { TTabOrderProperty
- Property editor for the TabOrder property. Prevents the property from being
- displayed when more than one component is selected. }
-
- TTabOrderProperty = class(TIntegerProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- end;
-
- { TCaptionProperty
- Property editor for the Caption and Text properties. Updates the value of
- the property for each change instead on when the property is approved. }
-
- TCaptionProperty = class(TStringProperty)
- public
- function GetAttributes: TPropertyAttributes; override;
- end;
-
- { TDateProperty
- Property editor for date portion of TDateTime type. }
-
- TDateProperty = class(TPropertyEditor)
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TTimeProperty
- Property editor for time portion of TDateTime type. }
-
- TTimeProperty = class(TPropertyEditor)
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TDateTimeProperty
- Edits both date and time data... simultaneously! }
-
- TDateTimeProperty = class(TPropertyEditor)
- function GetAttributes: TPropertyAttributes; override;
- function GetValue: string; override;
- procedure SetValue(const Value: string); override;
- end;
-
- { TComponentEditor
- A component editor is created for each component that is selected in the
- form designer based on the component's type (see GetComponentEditor and
- RegisterComponentEditor). When the component is double-clicked the Edit
- method is called. When the context menu for the component is invoked the
- GetVerbCount and GetVerb methods are called to build the menu. If one
- of the verbs are selected ExecuteVerb is called. Paste is called whenever
- the component is pasted to the clipboard. You only need to create a
- component editor if you wish to add verbs to the context menu, change
- the default double-click behavior, or paste an additional clipboard format.
- The default component editor (TDefaultEditor) implements Edit to searches the
- properties of the component and generates (or navigates to) the OnCreate,
- OnChanged, or OnClick event (whichever it finds first). Whenever the
- component modifies the component is *must* call Designer.Modified to inform
- the designer that the form has been modified.
-
- Create(AComponent, ADesigner)
- Called to create the component editor. AComponent is the component to
- be edited by the editor. ADesigner is an interface to the designer to
- find controls and create methods (this is not use often).
- Edit
- Called when the user double-clicks the component. The component editor can
- bring up a dialog in response to this method, for example, or some kind
- of design expert. If GetVerbCount is greater than zero, edit will execute
- the first verb in the list (ExecuteVerb(0)).
- ExecuteVerb(Index)
- The Index'ed verb was selected by the use off the context menu. The
- meaning of this is determined by component editor.
- GetVerb
- The component editor should return a string that will be displayed in the
- context menu. It is the responsibility of the component editor to place
- the & character and the '...' characters as appropriate.
- GetVerbCount
- The number of valid indices to GetVerb and Execute verb. The index is assumed
- to be zero based (i.e. 0..GetVerbCount - 1).
- PrepareItem
- While constructing the context menu PrepareItem will be called for
- each verb. It will be passed the menu item that will be used to represent
- the verb. The component editor can customize the menu item as it sees fit,
- including adding subitems. If you don't want that particular menu item
- to be shown, don't free it, simply set its Visible property to False.
- Copy
- Called when the component is being copied to the clipboard. The
- component's filed image is already on the clipboard. This gives the
- component editor a chance to paste a different type of format which is
- ignored by the designer but might be recognized by another application.
- IsInInlined
- Determines whether Component is in the Designer which owns it. Essentially,
- Components should not be able to be added to a Frame instance (collections
- are fine though) so this function checks to determine whether the currently
- selected component is within a Frame instance or not.
- }
-
- IComponentEditor = interface
- ['{ABBE7252-5495-11D1-9FB5-0020AF3D82DA}']
- procedure Edit;
- procedure ExecuteVerb(Index: Integer);
- function GetIComponent: IComponent;
- function GetDesigner: IFormDesigner;
- function GetVerb(Index: Integer): string;
- function GetVerbCount: Integer;
- procedure PrepareItem(Index: Integer; const AItem: TMenuItem);
- procedure Copy;
- end;
-
- TComponentEditor = class(TInterfacedObject, IComponentEditor)
- public
- constructor Create(AComponent: TComponent; ADesigner: IFormDesigner); virtual;
- procedure Edit; virtual;
- procedure ExecuteVerb(Index: Integer); virtual;
- function GetIComponent: IComponent;
- function GetDesigner: IFormDesigner;
- function GetVerb(Index: Integer): string; virtual;
- function GetVerbCount: Integer; virtual;
- function IsInInlined: Boolean;
- procedure PrepareItem(Index: Integer; const AItem: TMenuItem); virtual;
- procedure Copy; virtual;
- property Component: TComponent;
- property Designer: IFormDesigner;
- end;
-
- TComponentEditorClass = class of TComponentEditor;
-
- IDefaultEditor = interface(IComponentEditor)
- ['{5484FAE1-5C60-11D1-9FB6-0020AF3D82DA}']
- end;
-
- TDefaultEditor = class(TComponentEditor, IDefaultEditor)
- protected
- procedure EditProperty(PropertyEditor: TPropertyEditor;
- var Continue, FreeEditor: Boolean); virtual;
- public
- procedure Edit; override;
- end;
-
- { Global variables initialized internally by the form designer }
-
- type
- TFreeCustomModulesProc = procedure (Group: Integer);
-
- var
- FreeCustomModulesProc: TFreeCustomModulesProc;
-
- { RegisterPropertyEditor
- Registers a new property editor for the given type. When a component is
- selected the Object Inspector will create a property editor for each
- of the component's properties. The property editor is created based on
- the type of the property. If, for example, the property type is an
- Integer, the property editor for Integer will be created (by default
- that would be TIntegerProperty). Most properties do not need specialized
- property editors. For example, if the property is an ordinal type the
- default property editor will restrict the range to the ordinal subtype
- range (e.g. a property of type TMyRange = 1..10 will only allow values
- between 1 and 10 to be entered into the property). Enumerated types will
- display a drop-down list of all the enumerated values (e.g. TShapes =
- (sCircle, sSquare, sTriangle) will be edited by a drop-down list containing
- only sCircle, sSquare and sTriangle). A property editor need only be
- created if default property editor or none of the existing property editors
- are sufficient to edit the property. This is typically because the
- property is an object. The properties are looked up newest to oldest.
- This allows and existing property editor replaced by a custom property
- editor.
-
- PropertyType
- The type information pointer returned by the TypeInfo built-in function
- (e.g. TypeInfo(TMyRange) or TypeInfo(TShapes)).
-
- ComponentClass
- Type of the component to which to restrict this type editor. This
- parameter can be left nil which will mean this type editor applies to all
- properties of PropertyType.
-
- PropertyName
- The name of the property to which to restrict this type editor. This
- parameter is ignored if ComponentClass is nil. This parameter can be
- an empty string ('') which will mean that this editor applies to all
- properties of PropertyType in ComponentClass.
-
- EditorClass
- The class of the editor to be created whenever a property of the type
- passed in PropertyTypeInfo is displayed in the Object Inspector. The
- class will be created by calling EditorClass.Create. }
-
- procedure RegisterPropertyEditor(PropertyType: PTypeInfo; ComponentClass: TClass;
- const PropertyName: string; EditorClass: TPropertyEditorClass);
-
- type
- TPropertyMapperFunc = function(Obj: TPersistent;
- PropInfo: PPropInfo): TPropertyEditorClass;
-
- procedure RegisterPropertyMapper(Mapper: TPropertyMapperFunc);
-
- procedure GetComponentProperties(Components: TDesignerSelectionList;
- Filter: TTypeKinds; Designer: IFormDesigner; Proc: TGetPropEditProc);
-
- procedure RegisterComponentEditor(ComponentClass: TComponentClass;
- ComponentEditor: TComponentEditorClass);
-
- function GetComponentEditor(Component: TComponent;
- Designer: IFormDesigner): TComponentEditor;
-
- { Custom modules }
- { A custom module allows containers that descend from classes other than TForm
- to be created and edited by the form designer. This is useful for other form
- like containers (e.g. a report designer) or for specialized forms (e.g. an
- ActiveForm) or for generic component containers (e.g. a TDataModule). It is
- assumed that the base class registered will call InitInheritedComponent in its
- constructor which will initialize the component from the associated DFM file
- stored in the programs resources. See the constructors of TDataModule and
- TForm for examples of how to write such a constructor.
-
- The following designer assumptions are made, depending on the base components
- ancestor,
-
- If ComponentBaseClass descends from TForm,
-
- it is designed by creating an instance of the component as the form.
- Allows designing TForm descendants and modifying their properties as
- well as the form properties
-
- If ComponentBaseClass descends from TWinControl (but not TForm),
-
- it is designed by creating an instance of the control, placing it into a
- design-time form. The form's client size is the default size of the
- control.
-
- If ComponentBaseClass descends from TDataModule,
-
- it is designed by creating an instance of the class and creating a
- special non-visual container designer to edit the components and display
- the icons of the contained components.
-
- The module will appear in the project file with a colon and the base class
- name appended after the component name (e.g. MyDataModule: TDataModule).
-
- Note it is not legal to register anything that does not descend from one of
- the above.
-
- TCustomModule class
- An instance of this class is created for each custom module that is
- loaded. This class is also destroyed whenever the module is unloaded.
- The Saving method is called prior to the file being saved. When the context
- menu for the module is invoked the GetVerbCount and GetVerb methods are
- called to build the menu. If one of the verbs is selected ExecuteVerb is
- called.
-
- ExecuteVerb(Index)
- The Index'ed verb was selected by the use off the context menu. The
- meaning of this is determined by custom module.
- GetAttributes
- cmaVirtualSize: For TWinControl objects only: including this attribute makes
- the control "client aligned" in the design window. Without this
- attribute, the object is sized independently from the design window.
- Attributes are a set to allow for future expansion of features.
- GetVerb(Index)
- The custom module should return a string that will be displayed in the
- context menu. It is the responsibility of the custom module to place
- the & character and the '...' characters as appropriate.
- GetVerbCount
- The number of valid indexs to GetVerb and Execute verb. The index assumed
- to be zero based (i.e. 0..GetVerbCount - 1).
- PrepareItem
- While constructing the context menu PrepareItem will be called for
- each verb. It will be passed the menu item that will be used to represent
- the verb. The module editor can customize the menu item as it sees fit,
- including adding subitems. If you don't want that particular menu item
- to be shown don't free it, simply set it's Visible property to False.
- Saving
- Called prior to the module being saved.
- ValidateComponent(Component)
- ValidateComponent is called whenever a component is created by the
- user for the designer to contain. The intent is for this procedure to
- raise an exception with a descriptive message if the component is not
- applicable for the container. For example, a TComponent module should
- throw an exception if the component descends from TControl.
- Root
- This is the instance being designed.}
-
- type
- TCustomModuleAttribute = (cmaVirtualSize);
- TCustomModuleAttributes = set of TCustomModuleAttribute;
-
- TCustomModule = class
- public
- constructor Create(ARoot: IComponent); virtual;
- procedure ExecuteVerb(Index: Integer); virtual;
- function CreateDesignerForm(Designer: IDesigner): TCustomForm; virtual;
- function GetAttributes: TCustomModuleAttributes; virtual;
- function GetVerb(Index: Integer): string; virtual;
- function GetVerbCount: Integer; virtual;
- procedure PrepareItem(Index: Integer; const AItem: TMenuItem); virtual;
- procedure Saving; virtual;
- procedure ValidateComponent(Component: IComponent); virtual;
- class function Nestable: Boolean; virtual;
- property Root: IComponent;
- end;
-
- TCustomModuleClass = class of TCustomModule;
-
- TRegisterCustomModuleProc = procedure (Group: Integer;
- ComponentBaseClass: TComponentClass;
- CustomModuleClass: TCustomModuleClass);
-
- ICustomModuleSettings = interface
- ['{50947DAD-E627-11D2-B728-00C04FA35D12}']
- function IniSection: string;
- end;
-
- ICustomModuleProjectSettings = interface(ICustomModuleSettings)
- ['{78E12CC2-DBCC-11D2-B727-00C04FA35D12}']
- procedure SaveProjectState(AFile: TMemIniFile);
- procedure LoadProjectState(AFile: TMemIniFile);
- end;
-
- ICustomModuleUnitSettings = interface(ICustomModuleSettings)
- ['{78E12CC1-DBCC-11D2-B727-00C04FA35D12}']
- procedure SaveUnitState(AFile: TMemIniFile);
- procedure LoadUnitState(AFile: TMemIniFile);
- end;
-
- IDesignerPersistence = interface
- ['{D32194C2-EECF-11D2-AAD2-00C04FB16FBC}']
- procedure Save(const Stream: IStream);
- procedure Load(const Stream: IStream);
- end;
-
- procedure RegisterCustomModule(ComponentBaseClass: TComponentClass;
- CustomModuleClass: TCustomModuleClass);
-
- var
- RegisterCustomModuleProc: TRegisterCustomModuleProc;
-
- { Routines used by the form designer for package management }
-
- type
- TGroupChangeProc = procedure(AGroup: Integer);
-
- function NewEditorGroup: Integer;
- procedure FreeEditorGroup(Group: Integer);
- procedure NotifyGroupChange(AProc: TGroupChangeProc);
- procedure UnNotifyGroupChange(AProc: TGroupChangeProc);
-
- var // number of significant characters in identifiers
- MaxIdentLength: Byte = 63;
-
- { Property Categories Classes
- The following three components make up the category management system.
- Access to them is usually managed by the following support functions.
-
- TPropertyCategoryList
- Contains and maintains the list of TPropertyCategories. There are numerous
- 'As a whole' access and manipulation methods for categories as well as
- simplified access functions.
- TPropertyCategory
- Contains and maintains the list of TPropertyFilters. There are numerous
- 'As a whole' access and manipulation methods for filters as well as data
- about the category itself.
- TPropertyFilter
- Maintains the information about a single filter associated with a particular
- category. Along with its filter specific data it also encapsulates the
- matching algorithm. }
-
- type
- TPropertyFilter = class(TObject)
- public
- constructor Create(const APropertyName: String; AComponentClass: TClass;
- APropertyType: PTypeInfo);
- destructor Destroy; override;
- function Match(const APropertyName: String; AComponentClass: TClass;
- APropertyType: PTypeInfo): Boolean;
- property ComponentClass: TClass;
- property PropertyType: PTypeInfo;
- end;
-
- TPropertyCategoryClass = class of TPropertyCategory;
- TPropertyCategory = class(TObject)
- protected
- function GetFilter(Index: Integer): TPropertyFilter;
- public
- constructor Create;
- destructor Destroy; override;
- function Add(AFilter: TPropertyFilter): TPropertyFilter;
- function Count: integer;
- function Match(const APropertyName: String; AComponentClass: TClass;
- APropertyType: PTypeInfo): Boolean;
- procedure ClearMatches;
- procedure FreeEditorGroup(AGroup: Integer);
- class function Name: string; virtual;
- class function Description: string; virtual;
- procedure PropDraw(ACanvas: TCanvas; const ARect: TRect;
- ASelected: Boolean); dynamic;
- property Filters[Index: Integer]: TPropertyFilter;
- property MatchCount: Integer;
- property Visible: Boolean;
- property Editor: TPropertyEditor;
- end;
-
- TPropertyCategoryVisibleMode = (pcvAll, pcvToggle, pcvNone, pcvNotListed, pcvOnlyListed);
- TPropertyCategoryList = class(TObject)
- protected
- function GetCategory(Index: Integer): TPropertyCategory;
- function GetHiddenCategories: string;
- procedure SetHiddenCategories(const Value: string);
- public
- constructor Create;
- destructor Destroy; override;
- function FindCategory(ACategoryClass: TPropertyCategoryClass): TPropertyCategory;
- function IndexOf(ACategoryClass: TPropertyCategoryClass): Integer; overload;
- function IndexOf(const ACategoryName: string): Integer; overload;
- procedure ClearMatches;
- procedure FreeEditorGroup(AGroup: Integer);
- function MiscCategory: TPropertyCategory;
- function Count: integer;
- function Match(const APropertyName: String; AComponentClass: TClass;
- APropertyType: PTypeInfo = nil): Boolean;
- function ChangeVisibility(AMode: TPropertyCategoryVisibleMode): Boolean; overload;
- function ChangeVisibility(AMode: TPropertyCategoryVisibleMode;
- const AClasses: array of TClass): Boolean; overload;
- property HiddenCategories: string;
- property Categories[Index: Integer]: TPropertyCategory; default;
- end;
-
- { Property Categories Helpers
-
- RegisterPropertyInCategory
- This function comes in four flavors, each taking slightly different set of
- arguments. You can specify a category filter by property name; by class
- type and property name; by property type and property name; and finally
- just by property type. Additionally property name may include wild card
- symbols. For example: you can add all properties that match 'Data*' to
- a particular category. For a full list of what wild card characters
- are available please refer to the TMask class documentation.
- RegisterPropertiesInCategory
- This function will allow you to register a series of property names and/or
- property types filters in a single statement.
- IsPropertyInCategory
- This function comes in two flavors, each taking a slightly different set of
- arguments. But in either case you can ask if a property of a certain class
- falls under the specified category. The class can be specified by name or
- by class type.
- PropertyCategoryList
- This function will return, and create if necessary, the global property
- category list.}
-
- function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass;
- const APropertyName: string): TPropertyFilter; overload;
- function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass;
- AComponentClass: TClass; const APropertyName: string): TPropertyFilter; overload;
- function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass;
- APropertyType: PTypeInfo; const APropertyName: string): TPropertyFilter; overload;
- function RegisterPropertyInCategory(ACategoryClass: TPropertyCategoryClass;
- APropertyType: PTypeInfo): TPropertyFilter; overload;
-
- function RegisterPropertiesInCategory(ACategoryClass: TPropertyCategoryClass;
- const AFilters: array of const): TPropertyCategory; overload;
- function RegisterPropertiesInCategory(ACategoryClass: TPropertyCategoryClass;
- AComponentClass: TClass; const AFilters: array of string): TPropertyCategory; overload;
- function RegisterPropertiesInCategory(ACategoryClass: TPropertyCategoryClass;
- APropertyType: PTypeInfo; const AFilters: array of string): TPropertyCategory; overload;
-
- function IsPropertyInCategory(ACategoryClass: TPropertyCategoryClass;
- AComponentClass: TClass; const APropertyName: String): Boolean; overload;
- function IsPropertyInCategory(ACategoryClass: TPropertyCategoryClass;
- const AClassName: string; const APropertyName: String): Boolean; overload;
-
- function PropertyCategoryList: TPropertyCategoryList;
-
- { Property Categories
- The following class defines the standard categories used by Delphi. These are
- general purpose and can be used by component developers for property category
- registration. Additionally component developers can create new descedents of
- TPropertyCategory to add completly new categories. }
-
- type
- TActionCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TDataCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TDatabaseCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TDragNDropCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- THelpCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TLayoutCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TLegacyCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TLinkageCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TLocaleCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TLocalizableCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TMiscellaneousCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TVisualCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- TInputCategory = class(TPropertyCategory)
- public
- class function Name: string; override;
- class function Description: string; override;
- end;
-
- var
- BaseRegistryKey: string = '';
-
- implementation
-