[Lazarus] Fwd: Need help in streaming components
Martin Frb
lazarus at mfriebe.de
Mon Dec 15 11:42:27 CET 2014
On 15/12/2014 04:02, Kiên Nguyễn Tiến Trung wrote:
> Thank you for your respond. I find that my real problem is more
> complex and need more help from you.
>
> I want my TClass1 can contain many TClass2. It means that number of
> TClass2 in TClass1 is not fixed.
You may have to add
procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
to TClass1
procedure TClass1.GetChildren(Proc: TGetChildProc; Root: TComponent);
begin
for i = 0 to ListOfClass2.count-1 do
Proc(ListOfClass2[i]);
end;
When loaded you need to put them back into that list. You con override
TClass2.Loaded. The Owner of each Class2 will be the Class1 that saved it.
More information about the Lazarus
mailing list