XCollectionRegister.pas 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // This unit is part of the GLScene Engine, http://glscene.org
  3. //
  4. unit XCollectionRegister;
  5. (* Register TXCollection property editor *)
  6. interface
  7. {$I GLScene.inc}
  8. uses
  9. System.Classes,
  10. XCollection,
  11. DesignEditors,
  12. DesignIntf;
  13. type
  14. TXCollectionProperty = class(TClassProperty)
  15. public
  16. function GetAttributes: TPropertyAttributes; override;
  17. procedure Edit; override;
  18. end;
  19. procedure Register;
  20. // ------------------------------------------------------------------
  21. implementation
  22. // ------------------------------------------------------------------
  23. uses
  24. FXCollectionEditor;
  25. //----------------- TXCollectionProperty ------------------------------------
  26. function TXCollectionProperty.GetAttributes: TPropertyAttributes;
  27. begin
  28. Result:=[paDialog];
  29. end;
  30. procedure TXCollectionProperty.Edit;
  31. begin
  32. with XCollectionEditorForm do begin
  33. SetXCollection(TXCollection(GetOrdValue), Self.Designer);
  34. Show;
  35. end;
  36. end;
  37. procedure Register;
  38. begin
  39. RegisterPropertyEditor(TypeInfo(TXCollection), nil, '', TXCollectionProperty);
  40. end;
  41. // ------------------------------------------------------------------
  42. initialization
  43. // ------------------------------------------------------------------
  44. // class registrations
  45. end.