GXS.RegisterXCollection.pas 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. //
  2. // Graphic Scene Engine, http://glscene.org
  3. //
  4. (*
  5. Register TXCollection property editor
  6. *)
  7. unit GXS.RegisterXCollection;
  8. interface
  9. {$I Stage.Defines.inc}
  10. uses
  11. System.Classes,
  12. System.TypInfo,
  13. {
  14. DesignIntf,
  15. DesignEditors,
  16. }
  17. GXS.XCollection;
  18. type
  19. TPropertyAttribute = (paValueList, paSubProperties, paDialog, paMultiSelect,
  20. paAutoUpdate, paSortList, paReadOnly, paRevertable, paFullWidthName,
  21. paVolatileSubProperties, paFMX, paNotNestable, paDisplayReadOnly,
  22. paCustomDropDown, paValueEditable);
  23. TPropertyAttributes = set of TPropertyAttribute;
  24. TClassProperty = class //class(TPropertyEditor)
  25. public
  26. function GetAttributes: TPropertyAttributes; //override; <- not found in base class
  27. procedure GetProperties(Proc: TGetChildProc);
  28. //in VCL -> (Proc: TGetPropProc) //override; <- not found in base class
  29. function GetValue: string; //override; <- not found in base class
  30. end;
  31. TXCollectionProperty = class(TClassProperty)
  32. public
  33. function GetAttributes: TPropertyAttributes; //override; <- not found in base class
  34. procedure Edit; //override; <- not found in base class
  35. end;
  36. function GetOrdValueAt(Index: Integer): Longint;
  37. function GetOrdValue: Longint;
  38. procedure Register;
  39. //===================================================================
  40. implementation
  41. //===================================================================
  42. uses
  43. FXCollectionEditor;
  44. function GetOrdValueAt(Index: Integer): Longint;
  45. var
  46. FPropList: PInstPropList;
  47. begin
  48. with FPropList^[Index] do Result := GetOrdProp(Instance, PropInfo);
  49. end;
  50. function GetOrdValue: Longint;
  51. begin
  52. Result := GetOrdValueAt(0);
  53. end;
  54. procedure Register;
  55. begin
  56. { TODO : E2003 Undeclared identifier: 'RegisterPropertyEditor' }
  57. (*
  58. RegisterPropertyEditor(TypeInfo(TXCollection), nil, '', TXCollectionProperty);
  59. *)
  60. end;
  61. //----------------- TXCollectionProperty ------------------------------------
  62. function TXCollectionProperty.GetAttributes: TPropertyAttributes;
  63. begin
  64. Result:=[paDialog];
  65. end;
  66. procedure TXCollectionProperty.Edit;
  67. begin
  68. with XCollectionEditor do
  69. begin
  70. { TODO : E2003 Undeclared identifier: 'Designer' }
  71. (*SetXCollection(TXCollection(GetOrdValue), Self.Designer);*)
  72. Show;
  73. end;
  74. end;
  75. // ------------------------------------------------------------------
  76. function TClassProperty.GetAttributes: TPropertyAttributes;
  77. begin
  78. end;
  79. procedure TClassProperty.GetProperties(Proc: TGetChildProc);
  80. begin
  81. inherited;
  82. end;
  83. function TClassProperty.GetValue: string;
  84. begin
  85. end;
  86. // ------------------------------------------------------------------
  87. initialization
  88. // ------------------------------------------------------------------
  89. end.