<p style="padding:0 0 0 0; margin:0 0 0 0;">I wasn't clear. What I was talking about was TCheckComboBox.</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;">TComboBoxEx has property ItemsEx which is TCollection descendant.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Property Items is covered there. I used the same what Delphi do. </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________<br />
> Od: "Vojtěch Čihák" <vojtech.cihak@atlas.cz><br />
> Komu: Lazarus mailing list <lazarus@lists.lazarus.freepascal.org><br />
> Datum: 10.09.2014 17:44<br />
> Předmět: Re: [Lazarus] TComboBoxEx and TCheckComboBox<br />
></p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">MyStrings.Assign(ComboEx.Items) //this should work normally</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;">ComboEx.Items.Assign(MyStrings) //this is possible via ComboEx.AssignItems(MyStrings) </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;">There are inconsistency but I see now way how to avoid it.</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;">For example, the ComboEx.Items.Assign(). Here I would need some notification that new data was assigned - to clear old TCheckComboItemStates and create new one for each new string in list.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;">But there is no such notification. I tried to create new class derived from TStringList but it lead to other problems. Class helper and FPONotifyObserver was also a blind way.</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;">Vojtěch </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;">>[...] <br />
<br />
> PTCheckComboItemState(Items.Objects[i])^.Data;<br />
> <br />
> Although, I can do new property TCheckComboBox.Objects[] and getters + setter will do the job.<br />
<br />
This is possible, but it would be inconsistent to the other LCL<br />
controls.</p>
<p style="padding: 0 0 0 0; margin: 0 0 0 0;"><br />
For example:<br />
Items is a TStrings, so it would be nice if <br />
ComboEx.Items.Assign(MyStrings) and MyStrings.Assign(ComboEx.Items)<br />
works normally.<br />
<br />
It would be nice if the Enabled states are stored outside Items.<br />
<br />
Mattias<br />
<br />
--<br />
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus.freepascal.org<br />
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><br />
<br />
----------<br />
<br />
--<br />
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus.freepascal.org<br />
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a></p>