Some time ago I was trying to figure out a solution for a graphics application. The
application was based on layers that could be shown or hidden, and at the same time could
be locked or unlocked. The solution I found is this combo box, where you can select an item
(layer) or just change the properties of the other itens by clicking on the icons. Try it out!
Click on the item or on the icons in the demo app and see what happens!
Almost everything in the code is self explanatory. Some of the code was based on the
article "Checkbox ComboBox"
avaible on this site (thanks for the guys who created it).
In the sample project you'll find a class called CMultiCombo
that is
responsable for creating the combobox and drawing the graphics in the combo.
Notice that I've use two icons inside the combobox that represent two properties.
This properties are saved on the ItemData
property of the CComboBox
. Since
the properies are just bit values (ON/OFF) and the item data is a DWORD
/16 bytes value
this ComboBox could be expanded to use TONS of properties with just some modifications
to the code.
To test the code, compile it and press the "Add Something to the Combo-box" button and
then try to select some items and click on the icons while the list of the combobox
is open!