[Solved] How to highlight selected items in a ListBox

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

khayyam
Just popping in
Just popping in
Posts: 13
Joined: Thu Jun 29, 2006 08:22
Location: France

[Solved] How to highlight selected items in a ListBox

Postby khayyam » Thu May 03, 2007 11:47

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
Last edited by khayyam on Fri May 04, 2007 07:40, edited 1 time in total.

Rackle
CEGUI Team (Retired)
Posts: 534
Joined: Mon Jan 16, 2006 11:59
Location: Montréal

Re: How to highlight selected items in a ListBox

Postby Rackle » Thu May 03, 2007 12:00

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.

khayyam
Just popping in
Just popping in
Posts: 13
Joined: Thu Jun 29, 2006 08:22
Location: France

Postby khayyam » Fri May 04, 2007 07:40

indeed, you're right :)


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests