[Lazarus] TComboBoxEx and TCheckComboBox

Vojtěch Čihák vojtech.cihak at atlas.cz
Wed Sep 10 17:43:28 CEST 2014


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>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20140910/f8589f38/attachment-0003.html>


More information about the Lazarus mailing list