DragDropDesign.pas 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. unit DragDropDesign;
  2. // -----------------------------------------------------------------------------
  3. //
  4. // NOT FOR RELEASE
  5. //
  6. // -----------------------------------------------------------------------------
  7. // Project: Drag and Drop Component Suite
  8. // Module: DragDropDesign
  9. // Description: Contains design-time support for the drag and drop
  10. // components.
  11. // Version: 4.0
  12. // Date: 25-JUN-2000
  13. // Target: Win32, Delphi 3-6 and C++ Builder 3-5
  14. // Authors: Angus Johnson, ajohnson@rpi.net.au
  15. // Anders Melander, anders@melander.dk, http://www.melander.dk
  16. // Copyright © 1997-2000 Angus Johnson & Anders Melander
  17. // -----------------------------------------------------------------------------
  18. interface
  19. procedure Register;
  20. implementation
  21. {$include DragDrop.inc}
  22. uses
  23. DragDrop,
  24. {$ifndef VER14_PLUS}
  25. DsgnIntf,
  26. {$else}
  27. DesignIntf,
  28. DesignEditors,
  29. {$endif}
  30. Classes;
  31. type
  32. TDataFormatNameEditor = class(TStringProperty)
  33. public
  34. function GetAttributes: TPropertyAttributes; override;
  35. procedure GetValues(Proc: TGetStrProc); override;
  36. end;
  37. procedure Register;
  38. begin
  39. RegisterPropertyEditor(TypeInfo(string), TDataFormatAdapter, 'DataFormatName',
  40. TDataFormatNameEditor);
  41. end;
  42. { TDataFormatNameEditor }
  43. function TDataFormatNameEditor.GetAttributes: TPropertyAttributes;
  44. begin
  45. Result := [paValueList, paSortList, paMultiSelect];
  46. end;
  47. type
  48. TDataFormatClassesCracker = class(TDataFormatClasses);
  49. procedure TDataFormatNameEditor.GetValues(Proc: TGetStrProc);
  50. var
  51. i : Integer;
  52. begin
  53. for i := 0 to TDataFormatClassesCracker.Instance.Count-1 do
  54. Proc(TDataFormatClassesCracker.Instance[i].ClassName);
  55. end;
  56. end.