CEGUI ComboBox list menu[SOLVED]

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

Blender+C++
Just popping in
Just popping in
Posts: 16
Joined: Sat Jun 23, 2012 01:40
Location: Brazil

CEGUI ComboBox list menu[SOLVED]

Postby Blender+C++ » Sat Jun 23, 2012 01:47

Hi everyone im new to CEGUI as well as to ogre..and i started to customize my own buttons(widgets) and stuff..but im also trying to implement some functionality to it..so im using ogre..and i tried this code here :

Code: Select all

CEGUI::Combobox* objectComboBox = (CEGUI::Combobox*)CEGUI::WindowManager::getSingleton().createWindow((CEGUI::utf8*)"TaharezLook/Combobox", (CEGUI::utf8*)"CEGUIDemo/Menu");
   objectComboBox = static_cast<CEGUI::Combobox*>(wmgr.getWindow("CEGUIDemo/Menu"));
   objectComboBox->setReadOnly(true);


   CEGUI::ListboxTextItem* itemCombobox = new CEGUI::ListboxTextItem("Value 1", 1);
            itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
            objectComboBox->addItem(itemCombobox);
         itemCombobox = new CEGUI::ListboxTextItem("Value 2", 2);
            itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
            objectComboBox->addItem(itemCombobox);
            itemCombobox->setSelected(true); // Select this item
            objectComboBox->setText(itemCombobox->getText()); // Copy the item's text into the Editbox
         itemCombobox = new CEGUI::ListboxTextItem("Value 3", 3);
            itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
            objectComboBox->addItem(itemCombobox);
         itemCombobox = new CEGUI::ListboxTextItem("Value 4", 4);
            itemCombobox->setSelectionBrushImage("TaharezLook", "MultiListSelectionBrush");
            objectComboBox->addItem(itemCombobox);


   objectComboBox->setSize(CEGUI::UVector2(CEGUI::UDim(0.25, 0), CEGUI::UDim(0.05, 0)));
   objectComboBox->setPosition(CEGUI::UVector2(CEGUI::UDim(0.2f, 0), CEGUI::UDim(0.1f, 0)));
   objectComboBox->setText("SelectCharater");
   objectComboBox->setAlwaysOnTop(true);
   CEGUI::String valueCombobox = objectComboBox->getText(); // Retrieve the displayed text
   CEGUI::uint idCombobox = objectComboBox->getSelectedItem()->getID(); // Retrieve the ID of the selected combobox item
   objectComboBox->show();
   sheet->addChildWindow(objectComboBox);


im sorry bout the code..its disorganized, but when i click on the little arrow to show the ComboBox items, it simply doesnt show anything, just a small blank window...what am i missing on this?
any help is greatly appreciated..
i took the code from here :
http://www.cegui.org.uk/wiki/index.php/ ... ll_Widgets

thx in advance,
Romulo Romero
Last edited by Blender+C++ on Sat Jun 23, 2012 19:09, edited 1 time in total.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: CEGUI ComboBox list menu

Postby CrazyEddie » Sat Jun 23, 2012 07:17

Hi,

The height of a Combobox also includes the list portion (even though most of the time that is hidden), so in this case the scale size of 0.05f is likely too small - try setting a larger value (perhaps 0.3f) and the list should then be visible.

HTH

CE.

Blender+C++
Just popping in
Just popping in
Posts: 16
Joined: Sat Jun 23, 2012 01:40
Location: Brazil

Re: CEGUI ComboBox list menu

Postby Blender+C++ » Sat Jun 23, 2012 14:28

Aww...that worked lol..wow i didnt expect the solution to be so easy like that!! thanks a lot for ur fast reply CrazyEddie i really apreciate that!!!
ok cya on the next time dude ( lol), ill prolly have more doubts later :D
All the best,
Romulo Romero


Return to “Help”

Who is online

Users browsing this forum: No registered users and 22 guests