Einzelnen Beitrag anzeigen

4dk2

Registriert seit: 4. Sep 2007
176 Beiträge
 
#1

[XE10] Designer, TCollectionItem

  Alt 2. Mai 2016, 14:10
Hallo zusammen,
irgendwie bekomme ich bei mir nicht nen PropertyEditor für abgeleitet von TCollectionItem ans Laufen,
oder muss ich mir nen eigenen Listen-Designer bauen?

Delphi-Quellcode:
  TSimpleCollectionItem=class(TCollectionItem)
  private
    FNameXYZ:string;
  published
    property NameXYZ:string read FNameXYZ write FNameXYZ;

  end;

  TSimpleCollectionList=class(TOwnedCollection)
  private
  protected
    function GetItem(Index: integer): TSimpleCollectionItem;
    procedure SetItem(index: integer; Value: TSimpleCollectionItem);

  public
    function Add: TSimpleCollectionItem;
    constructor Create(AOwner: TPersistent);
  public
    property Items[index: integer]: TSimpleCollectionItem read GetItem write SetItem;
  end;

  TSimpleCollectionComp=class(TComponent)
  private
    FItems:TSimpleCollectionList;
    FSingleItem: TCollectionItem;
  public
    constructor Create(AOwner: TComponent); override;
    destructor Destroy; override;
  published
    property Items: TSimpleCollectionList read FItems write FItems;
    property SingleItem:TCollectionItem read FSingleItem write FSingleItem;
  end;

type
  TSimpleCollection_PropertyEditor = class(TClassProperty)
  public
    procedure GetProperties(Proc: TGetPropProc); override;
    procedure Edit; override;
    function GetAttributes: TPropertyAttributes; override;
    constructor Create(const ADesigner: IDesigner; APropCount: Integer);
      override;

  end;


....


procedure Register;
begin
  RegisterComponents('SimpleCollection', [TSimpleCollectionComp]);
 RegisterPropertyEditor(TypeInfo(TSimpleCollectionItem),TSimpleCollectionComp,'',TSimpleCollection_PropertyEditor);

end;
in den Funktionen vom TSimpleObject_PropertyEditor hab ich überall nen showmessage reingepackt, aber wird nie ausgeführt?

Jemand ne Idee?
  Mit Zitat antworten Zitat