Hab es mal in einer Mini-Komponente getestet und kann da nix erkennen... bei mir läuft das einwandfrei... allerdings nutz ich Delphi 7. evtl. ein Turbo-Delphi Bug?
Delphi-Quellcode:
unit teststrings;
interface
uses
SysUtils, Classes;
type
TSlItem =
class(TCollectionItem)
private
fstrings: TStrings;
procedure SetStrings(
const Value: TStrings);
protected
public
constructor Create(Collection: TCollection);
override;
destructor Destroy;
override;
published
property Lines: TStrings
read fstrings
write SetStrings;
end;
Tteststrings =
class(TComponent)
private
flist: TCollection;
procedure SetList(
const Value: TCollection);
protected
public
constructor Create(AOwner: TComponent);
override;
destructor Destroy;
override;
published
property List: TCollection
read flist
write SetList;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('
Cruiser', [Tteststrings]);
end;
{ TSlItem }
constructor TSlItem.Create(Collection: TCollection);
begin
inherited;
fstrings := TStringList.Create;
end;
destructor TSlItem.Destroy;
begin
fstrings.Free;
inherited;
end;
procedure TSlItem.SetStrings(
const Value: TStrings);
begin
fstrings.Assign(Value);
end;
{ Tteststrings }
constructor Tteststrings.Create(AOwner: TComponent);
begin
inherited;
flist := TCollection.Create(TSlItem);
end;
destructor Tteststrings.Destroy;
begin
flist.Free;
inherited;
end;
procedure Tteststrings.SetList(
const Value: TCollection);
begin
flist.Assign(Value);
end;
end.
EDIT: Darf ich mir mal GetItem/SetItem von TExtendedItems ansehn?