| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118 |
- //
- // Graphic Scene Engine, http://glscene.org
- //
- (*
- Register TXCollection property editor
- *)
- unit GXS.RegisterXCollection;
- interface
- {$I Stage.Defines.inc}
- uses
- System.Classes,
- System.TypInfo,
- {
- DesignIntf,
- DesignEditors,
- }
- GXS.XCollection;
- type
- TPropertyAttribute = (paValueList, paSubProperties, paDialog, paMultiSelect,
- paAutoUpdate, paSortList, paReadOnly, paRevertable, paFullWidthName,
- paVolatileSubProperties, paFMX, paNotNestable, paDisplayReadOnly,
- paCustomDropDown, paValueEditable);
- TPropertyAttributes = set of TPropertyAttribute;
- TClassProperty = class //class(TPropertyEditor)
- public
- function GetAttributes: TPropertyAttributes; //override; <- not found in base class
- procedure GetProperties(Proc: TGetChildProc);
- //in VCL -> (Proc: TGetPropProc) //override; <- not found in base class
- function GetValue: string; //override; <- not found in base class
- end;
- TXCollectionProperty = class(TClassProperty)
- public
- function GetAttributes: TPropertyAttributes; //override; <- not found in base class
- procedure Edit; //override; <- not found in base class
- end;
- function GetOrdValueAt(Index: Integer): Longint;
- function GetOrdValue: Longint;
- procedure Register;
- //===================================================================
- implementation
- //===================================================================
- uses
- FXCollectionEditor;
- function GetOrdValueAt(Index: Integer): Longint;
- var
- FPropList: PInstPropList;
- begin
- with FPropList^[Index] do Result := GetOrdProp(Instance, PropInfo);
- end;
- function GetOrdValue: Longint;
- begin
- Result := GetOrdValueAt(0);
- end;
- procedure Register;
- begin
- { TODO : E2003 Undeclared identifier: 'RegisterPropertyEditor' }
- (*
- RegisterPropertyEditor(TypeInfo(TXCollection), nil, '', TXCollectionProperty);
- *)
- end;
- //----------------- TXCollectionProperty ------------------------------------
- function TXCollectionProperty.GetAttributes: TPropertyAttributes;
- begin
- Result:=[paDialog];
- end;
- procedure TXCollectionProperty.Edit;
- begin
- with XCollectionEditor do
- begin
- { TODO : E2003 Undeclared identifier: 'Designer' }
- (*SetXCollection(TXCollection(GetOrdValue), Self.Designer);*)
- Show;
- end;
- end;
- // ------------------------------------------------------------------
- function TClassProperty.GetAttributes: TPropertyAttributes;
- begin
- end;
- procedure TClassProperty.GetProperties(Proc: TGetChildProc);
- begin
- inherited;
- end;
- function TClassProperty.GetValue: string;
- begin
- end;
- // ------------------------------------------------------------------
- initialization
- // ------------------------------------------------------------------
-
-
- end.
|