[Lazarus] TComboBoxEx and TCheckComboBox
Vojtěch Čihák
vojtech.cihak at atlas.cz
Wed Sep 10 18:51:47 CEST 2014
I wasn't clear. What I was talking about was TCheckComboBox.
TComboBoxEx has property ItemsEx which is TCollection descendant.
Property Items is covered there. I used the same what Delphi do.
______________________________________________________________
> Od: "Vojtěch Čihák" <vojtech.cihak at atlas.cz>
> Komu: Lazarus mailing list <lazarus at lists.lazarus.freepascal.org>
> Datum: 10.09.2014 17:44
> Předmět: Re: [Lazarus] TComboBoxEx and TCheckComboBox
>
MyStrings.Assign(ComboEx.Items) //this should work normally
ComboEx.Items.Assign(MyStrings) //this is possible via ComboEx.AssignItems(MyStrings)
There are inconsistency but I see now way how to avoid it.
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.
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.
Vojtěch
>[...]
> PTCheckComboItemState(Items.Objects[i])^.Data;
>
> Although, I can do new property TCheckComboBox.Objects[] and getters + setter will do the job.
This is possible, but it would be inconsistent to the other LCL
controls.
For example:
Items is a TStrings, so it would be nice if
ComboEx.Items.Assign(MyStrings) and MyStrings.Assign(ComboEx.Items)
works normally.
It would be nice if the Enabled states are stored outside Items.
Mattias
--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>
----------
--
_______________________________________________
Lazarus mailing list
Lazarus at lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus <http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140910/2cabdb94/attachment-0003.html>
More information about the Lazarus
mailing list