Can't customize ListboxTextItem
Moderators: CEGUI MVP, CEGUI Team
Can't customize ListboxTextItem
Hi!
Could you give me a hint where I can change the text- and selectioncolor of a listboxtextitem, please?
I tried to change the colors in the LookAndFeel-file (Listboxitem), but that didn't work. I also tried to create a LookAndFeelItem which is called ListboxTextItem und linked it in the scheme-file, but that didn't work too. ;-C
Can you help me, please?
Bye,
Chaos
Could you give me a hint where I can change the text- and selectioncolor of a listboxtextitem, please?
I tried to change the colors in the LookAndFeel-file (Listboxitem), but that didn't work. I also tried to create a LookAndFeelItem which is called ListboxTextItem und linked it in the scheme-file, but that didn't work too. ;-C
Can you help me, please?
Bye,
Chaos
Excerpt taken from WidgetGalore:
A Listbox widget controls either a single selection or multiple selections among many choices. Multiple selections are enabled via setMultiselectEnabled().
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(). The call to ensureItemIsVisible() ensures that the item is visible; the listbox will automatically scroll down if necessary. The text of the ListboxTextItem can be changed via the setText() function. However this new text will not be displayed until you call the Listbox's handleUpdatedItemData() function.
--------
Regarding the creation of new list items have a read through Create a CheckListboxItem.
A Listbox widget controls either a single selection or multiple selections among many choices. Multiple selections are enabled via setMultiselectEnabled().
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(). The call to ensureItemIsVisible() ensures that the item is visible; the listbox will automatically scroll down if necessary. The text of the ListboxTextItem can be changed via the setText() function. However this new text will not be displayed until you call the Listbox's handleUpdatedItemData() function.
--------
Regarding the creation of new list items have a read through Create a CheckListboxItem.
Hi!
I already knew that, but thanks anyway. I just thought that there could be a solution without coding the colors. How can I vary the look in disabled state?
The TextItems are disabled but I still can click them and they look the same like the enabled ones.
Do you know if its possible to increase the distance between the entries of the multicolumnlistbox?
And how can I change the size and color of the listheadersegment?
Bye, Chaos
I already knew that, but thanks anyway. I just thought that there could be a solution without coding the colors. How can I vary the look in disabled state?
The TextItems are disabled but I still can click them and they look the same like the enabled ones.
Do you know if its possible to increase the distance between the entries of the multicolumnlistbox?
And how can I change the size and color of the listheadersegment?
Bye, Chaos
- scriptkid
- Home away from home
- Posts: 1178
- Joined: Wed Jan 12, 2005 12:06
- Location: The Hague, The Netherlands
- Contact:
@disabled state: a ListboxItem has both an enabled and disabled StateImagery, which is 'connected' to the actual runtime state of the item. I don't know which looknfeel you use, but you could add a disabled text colour like this, which is Gray as opposite to the selected Black:
<WidgetLook name="WindowsLook/ListboxItem">
<PropertyDefinition name="TextColour" initialValue="FF000000" redrawOnWrite="true" />
<PropertyDefinition name="DisabledTextColour" initialValue="FF888888" redrawOnWrite="true" />
Also alter the StateImagery to point to this new textcolour:
<StateImagery name="Disabled">
<Layer>
<Section section="label">
<ColourProperty name="DisabledTextColour" />
</Section>
</Layer>
</StateImagery>
You can perform the same trick to add a new colour for the "Selected Disabled" state.
-----
Not sure if you can change distance between items.
----
You can access listheadersegments throught a getter, assuming you are now talking about the MultiColumnList, which allows you to change it's size. But i don't know about the colours.
Let me know if that looknfeel part was too heavy for now
<WidgetLook name="WindowsLook/ListboxItem">
<PropertyDefinition name="TextColour" initialValue="FF000000" redrawOnWrite="true" />
<PropertyDefinition name="DisabledTextColour" initialValue="FF888888" redrawOnWrite="true" />
Also alter the StateImagery to point to this new textcolour:
<StateImagery name="Disabled">
<Layer>
<Section section="label">
<ColourProperty name="DisabledTextColour" />
</Section>
</Layer>
</StateImagery>
You can perform the same trick to add a new colour for the "Selected Disabled" state.
-----
Not sure if you can change distance between items.
----
You can access listheadersegments throught a getter, assuming you are now talking about the MultiColumnList, which allows you to change it's size. But i don't know about the colours.
Let me know if that looknfeel part was too heavy for now

Check out my released snake game using Cegui!
Thanks for your information scriptkid.
But your solution doesn't work. When I change the textcolor of the Listboxtextitem in my Looknfeel nothing happens.
I have to use the setTextColor function and so on to give my items a color.
That's why I'm asking how I can fix that problem.
Btw.: I'm using a modified version of the Taharezskin/looknfeel.
Do you know how to change the selectionbrush in that way, that it doesn't fades out anymore? -> FIXED!
The fontsize of the headersegments I could already change, but don't know how to change the color. Maybe I should change the defaultcolor of the windowelement? If so, how can I do this?
Bye
But your solution doesn't work. When I change the textcolor of the Listboxtextitem in my Looknfeel nothing happens.
I have to use the setTextColor function and so on to give my items a color.
That's why I'm asking how I can fix that problem.
Btw.: I'm using a modified version of the Taharezskin/looknfeel.
Do you know how to change the selectionbrush in that way, that it doesn't fades out anymore? -> FIXED!
The fontsize of the headersegments I could already change, but don't know how to change the color. Maybe I should change the defaultcolor of the windowelement? If so, how can I do this?

Bye
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Hi
Yeah, that's the issue. The items you add to that, which you create directly, are not 'skinned'. In order to customise these items (based on CEGUI::ListboxItem) you'll need to set options on the objects you create directly (see API reference here and here) - or even subclass it and write something that does what you need.
CE.

I'm using ... the MultiColumnList
Yeah, that's the issue. The items you add to that, which you create directly, are not 'skinned'. In order to customise these items (based on CEGUI::ListboxItem) you'll need to set options on the objects you create directly (see API reference here and here) - or even subclass it and write something that does what you need.
CE.
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Can't you do:
Where myItem is a ListboxTextItem? Or is there something else blocking you too?
Code: Select all
#define BLUE 0xFF0000FF
...
myItem->setTextColours( BLUE );
...
Where myItem is a ListboxTextItem? Or is there something else blocking you too?
Well the thing is: I want to implement a list where available levels are listed and nonavailable levels of my game are disabled (visible but not clickable).
Furthermore I need 2 more columns to show the Highscorepoints and the players rank in this level. The columnheadersegments should be in the same fontcolor as the listboxtextitems in the list. All entries schould have a distance of 3 px to each other and the text shouldn't be cut off like it does at the moment (a normal "g" is not visible completely).
An other point is, that the entries of the list should have a rectangular background in a soft color and a selectionstate which is looks a bit darker than the normal state (I'm speaking of the rectangle).
So, you see... there are many problems witch this listboxstuff. I would be very glad if you and your team would reinvent the listbox in a better way, because now the listbox is not as good as the rest of your GUI.
Bye Chaos
PS: I'm scripting the GUI with LUA so I can't do "special moves" with C++
Furthermore I need 2 more columns to show the Highscorepoints and the players rank in this level. The columnheadersegments should be in the same fontcolor as the listboxtextitems in the list. All entries schould have a distance of 3 px to each other and the text shouldn't be cut off like it does at the moment (a normal "g" is not visible completely).
An other point is, that the entries of the list should have a rectangular background in a soft color and a selectionstate which is looks a bit darker than the normal state (I'm speaking of the rectangle).
So, you see... there are many problems witch this listboxstuff. I would be very glad if you and your team would reinvent the listbox in a better way, because now the listbox is not as good as the rest of your GUI.
Bye Chaos
PS: I'm scripting the GUI with LUA so I can't do "special moves" with C++

- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
I understand that the current implementation is obviously not flexible enough to do what you want
That's unlikely to happen any time soon.
I agree. The Multicolumn List has more hacks than your average tabloid paper
The newer ItemListbox is very, very good (though does not support multi columns, so is not a lot of use for what you want).
Cool. I think the Lua scripting support is one of our stronger features.

Chaos wrote:I would be very glad if you and your team would reinvent the listbox in a better way
That's unlikely to happen any time soon.
Chaos wrote:because now the listbox is not as good as the rest of your GUI.
I agree. The Multicolumn List has more hacks than your average tabloid paper

The newer ItemListbox is very, very good (though does not support multi columns, so is not a lot of use for what you want).
Chaos wrote:PS: I'm scripting the GUI with LUA so I can't do "special moves" with C++
Cool. I think the Lua scripting support is one of our stronger features.
CrazyEddie wrote:I understand that the current implementation is obviously not flexible enough to do what you want
That's unlikely to happen any time soon.
I really hope so, because it's really hard to implement a Gui without Multicolumnlistboxes.

Btw.: Do you any solution to create an object where the user can change the controlsettings of the game? There has to be the caption and a primary and secondary keyvalue in the list. Maybe you know somebody who has solved that problem with the current CEGUIversion without programm something new.
CrazyEddie wrote:Cool. I think the Lua scripting support is one of our stronger features.
What do you mean? On the website I haven't seen LUA Code very often. But in my opinion is LUA in combination with CEGUI one of the most flexible GUI that exists. I've created kinda classes and objects with arrays and a Managerlibrary which handles the information for the Userlayer of the GUI.
Chaos wrote:Do you any solution to create an object where the user can change the controlsettings of the game? There has to be the caption and a primary and secondary keyvalue in the list. Maybe you know somebody who has solved that problem with the current CEGUIversion without programm something new.
The description of your need is a little vague. Are you talking about mapping keyboard keys to game actions?
Last edited by Rackle on Thu Feb 07, 2008 20:38, edited 1 time in total.
Who is online
Users browsing this forum: No registered users and 17 guests