[Lazarus] Custom component: cannot make Items: TStrings

Alexey aaa5500 at ya.ru
Sat Sep 30 21:50:01 CEST 2017


On 30.09.2017 22:44, Michael Van Canneyt via Lazarus wrote:
> Remove the clear statement in the setter ?
>
> It clears FTabItems, which you just assigned. That's pointless.
> Also, if FTabItems equals AValue, it will clear the AValue

hmm, setter don't clear FTabItems, it clear another FTabList [TList].

procedure TATTabs.SetItems(AValue: TStrings);
var
   i: integer;
begin
   FTabItems.Assign(AValue);
   Clear;
   for i:= 0 to AValue.Count-1 do
     AddTab(-1, AValue[i]);
end;

(updated repo)

-- 
Regards,
Alexey



More information about the Lazarus mailing list