Page 1 of 1

[Solved] How to highlight selected items in a ListBox

Posted: Thu May 03, 2007 11:47
by khayyam
Hi all,

I'm trying to use ListBox with an IrrlichtRenderer.

My problem is very simple : the events seem not to be used on my ListBox. Basically, clics on the ListBox should highlight the selected item but they don't.
My events are correctly injected into CEGUI because I can trigger pushbuttons, checkboxes, comboboxes, ItemListBoxes ... but not ListBox. Is there something special I should do to highlight the selected items on clicks ? All the options are set to default, so ... what to do ?

Edit: Solved

Re: How to highlight selected items in a ListBox

Posted: Thu May 03, 2007 12:00
by Rackle
The wikied Widget Galore wrote:The choices are listbox text items (ListboxTextItem) added to the listbox via addItem(). These do not possess a selection indicator by default; one must be specified via setSelectionBrushImage().


Code: Select all

Listbox* listbox = static_cast<Listbox*>(winMgr.getWindow("Listbox"));
ListboxTextItem* itemListbox = new ListboxTextItem("Value A", 1);
itemListbox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
listbox->addItem(itemListbox);


You're probably not setting the selection brush image.

P.S. Click on the Widget Galore link to see the basic usage of Cegui's Widgets.

Posted: Fri May 04, 2007 07:40
by khayyam
indeed, you're right :)