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