GXS.XCollectionRegister.pas 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. //
  2. // The graphics GaLaXy Engine. The unit of GXScene
  3. //
  4. unit GXS.XCollectionRegister;
  5. (* Register TXCollection property editor *)
  6. (* TODO *)
  7. interface
  8. uses
  9. System.Classes,
  10. System.TypInfo,
  11. // ToDo
  12. /// DesignEditors,
  13. /// DesignIntf,
  14. GXS.XCollection,
  15. FMxXCollectionEditor;
  16. type
  17. TXCollectionProperty = class(TClassProperty)
  18. public
  19. function GetAttributes: TPropertyAttributes; override;
  20. procedure Edit; override;
  21. end;
  22. procedure Register;
  23. // ------------------------------------------------------------------
  24. implementation
  25. // ------------------------------------------------------------------
  26. //----------------- TXCollectionProperty ------------------------------------
  27. function TXCollectionProperty.GetAttributes: TPropertyAttributes;
  28. begin
  29. Result:=[paDialog];
  30. end;
  31. procedure TXCollectionProperty.Edit;
  32. begin
  33. with FXCollectionEditor do begin
  34. SetXCollection(TXCollection(GetOrdValue), Self.Designer);
  35. Show;
  36. end;
  37. end;
  38. procedure Register;
  39. begin
  40. RegisterPropertyEditor(TypeInfo(TXCollection), nil, '', TXCollectionProperty);
  41. end;
  42. // ------------------------------------------------------------------
  43. initialization
  44. // ------------------------------------------------------------------
  45. end.