<p style="padding:0 0 0 0; margin:0 0 0 0;">Hi,</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">you have unusual getter:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">function TATTabs.GetItems: TStrings;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">var</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> D: TATTabData;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> i: integer;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">begin</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> Result:= TStringList.Create;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> for i:= 0 to TabCount-1 do</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> begin</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> D:= GetTabData(i);</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> if Assigned(D) then</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> Result.Add(D.TabCaption)</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> else</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> Result.Add('?');</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> end;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">end; </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">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.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">I'm not sure with solution, maybe you test csLoading somewhere.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">V.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: Alexey via Lazarus <lazarus@lists.lazarus-ide.org><br />
> Komu: lazarus mailing list <lazarus@lists.lazarus-ide.org><br />
> Datum: 30.09.2017 18:42<br />
> Předmět: [Lazarus] Custom component: cannot make Items: TStrings<br />
></p>
Hi. I added to ATTabs prop Items: TStrings. It has getter/setter. It has <br />
registering in IDE.<br />
<br />
- in designer, OI can set Items and tabs appear<br />
<br />
- if i run app, tabs dont appear- ??<br />
<br />
- if I restart IDE, app's LFM looses Items- ??<br />
<br />
<a href="https://github.com/alexey-t/attabs">https://github.com/alexey-t/attabs</a><br />
<br />
-- <br />
Regards,<br />
Alexey<br />
<br />
-- <br />
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus-ide.org<br />
<a href="https://lists.lazarus-ide.org/listinfo/lazarus">https://lists.lazarus-ide.org/listinfo/lazarus</a><br />