Multiline listbox
Posted: Sat Oct 25, 2008 18:20
Hi !
I am trying to figure out a way to use multiline for each of my items because horizontal scrolling is annoying...
Here is my listbox code :
And here is the code is use to add item to the listbox :
Thanks for your help !
I am trying to figure out a way to use multiline for each of my items because horizontal scrolling is annoying...
Here is my listbox code :
Code: Select all
server = (Listbox*)Wmgr->createWindow("TaharezLook/Listbox","ServerList");
MenuBackground->addChildWindow( server );
server->setPosition( UVector2( UDim( 0.07f, 0.0f ), UDim( 0.22f, 0.0f ) ) );
server->setSize( UVector2( UDim( 0.7f, 0.0f ), UDim( 0.5f, 0.0f ) ) );
And here is the code is use to add item to the listbox :
Code: Select all
CEGUI::ListboxTextItem *listboxitem =
new CEGUI::ListboxTextItem (CEGUI::String((utf8*)str),id);
listboxitem->setSelected(server->getItemCount() == 0);
listboxitem->setSelectionColours(colour(0.57f,0.39f,0.39f));
listboxitem->setSelectionBrushImage("TaharezLook", "ListboxSelectionBrush");
server->addItem(listboxitem);
Thanks for your help !