 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Guest
|
Posted: Fri Dec 09, 2005 2:01 pm Post subject: Filter Out Specific Items In ComboBox Using Own TList Class? |
|
|
Could anyone give a few hints on how I should start implementing a ComboBox
that can contain items that can be filtered depending on some other
criteria?
For example: a class has been defined (TListSpecial) containing a TList of
records and the associated Add/Delete methods/properties. I then want to
use this class to populate numerous combos from data stored in the
TListSpecial class. Each combo will populate using data from the
TListSpecial private TList variable but each combo will have different
contents as it will depend on the contents of another field in the record?
The aim is to when contents of TListSpecial are updated the combos would
also automatically update?
There will be only one instance TListSpecial for all the combos.
TIA
|
|
| Back to top |
|
 |
Bob Dawson Guest
|
Posted: Fri Dec 09, 2005 3:52 pm Post subject: Re: Filter Out Specific Items In ComboBox Using Own TList Cl |
|
|
<research312 (AT) gmail (DOT) com> wrote
| Quote: | Could anyone give a few hints on how I should start
implementing a ComboBox that can contain items that
can be filtered depending on some other criteria?
|
Depends on the design of TComboBox.
My tendency would be to design the TListSpecial as a broadcasting object,
and your TComboBox descendents as subscribers. The combos would receive
notices any time the TListSpecial changed and could rebuild their internal
lists as required.
The alternative would be to intercept all access to the TComboBox's internal
strings and build what would be a 'virtual' combobox--one using the external
list directly and owning its filters. The combobox would then really be a
view object. This requires that you really can intercept all list access,
which may not be possible.
In either case, you have to decide whether filtering is a direct
responsibility of the combobox, or is delegated to a pluggable filter
object.
bobD
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|