Hi,
 
you have unusual getter:
 
function TATTabs.GetItems: TStrings;
var
  D: TATTabData;
  i: integer;
begin
  Result:= TStringList.Create;
  for i:= 0 to TabCount-1 do
  begin
    D:= GetTabData(i);
    if Assigned(D) then
      Result.Add(D.TabCaption)
    else
      Result.Add('?');
  end;
end;           
 
IMO, when you run app, ATTabs should read Items from *.lfm. But it creates new 
instance of TStringList instead. New instance is created from existing tabs, 
therefore it is empty. Even more, you don't Free then TStringList anywhere, 
there will be many instantioned Results.
I'm not sure with solution, maybe you test csLoading somewhere.
 
V.
______________________________________________________________
Od: Alexey via Lazarus <lazarus@lists.lazarus-ide.org>
Komu: lazarus mailing list <lazarus@lists.lazarus-ide.org>
Datum: 30.09.2017 18:42
Předmět: [Lazarus] Custom component: cannot make Items: TStrings

Hi. I added to ATTabs prop Items: TStrings. It has getter/setter. It has registering in IDE.

- in designer, OI can set Items and tabs appear

- if i run app, tabs dont appear- ??

- if I restart IDE, app's LFM looses Items- ??

https://github.com/alexey-t/attabs <https://github.com/alexey-t/attabs>

--
Regards,
Alexey

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus 
<https://lists.lazarus-ide.org/listinfo/lazarus>

-- 
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus

Reply via email to