Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Die Delphi-IDE (https://www.delphipraxis.net/62-die-delphi-ide/)
-   -   [XE10] Designer, TCollectionItem (https://www.delphipraxis.net/189087-%5Bxe10%5D-designer-tcollectionitem.html)

4dk2 2. Mai 2016 14:10

[XE10] Designer, TCollectionItem
 
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?:?::roll:

Jemand ne Idee?


Alle Zeitangaben in WEZ +1. Es ist jetzt 00:51 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz