ComboBoc trouble

Redminnow

07-01-2009 20:07:46

Hi having problems getting items to add to a combo box.

Trying a really simple example of


opWindow = mGUI->createWidget<MyGUI::Widget>("Message", ((width/2)-((250*widthF)/2)), ((height/3)-((80*heightF)/2)), (250*widthF), (170*heightF), MyGUI::DEFAULT,"Back");
opCombox = opWindow->createWidget<MyGUI::ComboBox>("ComboBox",15,50,opWindow->getWidth()-30,30,MyGUI::DEFAULT,"Main");
opCombox->setComboModeDrop(true);
opCombox->addItem("test");


However nothing is being added to the drop down menu.

Any help would be greatly appreciated

Thanks!

mrmclovin

07-01-2009 20:14:44

Check your mygui.log for anything relevant

Redminnow

07-01-2009 20:32:49

Not really sure what im meant to be looking for in the log.
Don't really see anything that i think is causing problem.

Is that code correct? Am i doing something wrong elsewhere?

Thanks for the fast response

Altren

07-01-2009 21:13:37

Your code correct. What you see when pressing on combobox?
May be you forgot to addmGUI->injectFrameEntered(evt.timeSinceLastFrame);in frame start.

Redminnow

07-01-2009 21:39:52

No i have that, the rest of the widgets that i have on screen work. For instance i've made a chat box.

When i click the combo box down arrow on the right nothing happens. It just doesn't seem to add any items to the list.

Thanks in advance

my.name

07-01-2009 22:13:23

//wrong
opWindow = mGUI->createWidget<MyGUI::Widget>("Message", ((width/2)-((250*widthF)/2)), ((height/3)-((80*heightF)/2)), (250*widthF), (170*heightF), MyGUI::DEFAULT,"Back");
opCombox = opWindow->createWidget<MyGUI::ComboBox>("ComboBox",15,50,opWindow->getWidth()-30,30,MyGUI::DEFAULT,"Main");
opCombox->setComboModeDrop(true);
opCombox->addItem("test");



// ok, old format
opWindow = mGUI->createWidget<MyGUI::Widget>("WindowC", ((width/2)-((250*widthF)/2)), ((height/3)-((80*heightF)/2)), (250*widthF), (170*heightF), MyGUI::ALIGN_DEFAULT,"Back");
opCombox = opWindow->createWidget<MyGUI::ComboBox>("ComboBox",15,50,opWindow->getWidth()-30,30,MyGUI::ALIGN_DEFAULT);
opCombox->setComboModeDrop(true);
opCombox->addItem("test");

// ok, new format
opWindow = mGUI->createWidget<MyGUI::Widget>("WindowC", ((width/2)-((250*widthF)/2)), ((height/3)-((80*heightF)/2)), (250*widthF), (170*heightF), MyGUI::Align::Default,"Back");
opCombox = opWindow->createWidget<MyGUI::ComboBox>("ComboBox",15,50,opWindow->getWidth()-30,30,MyGUI::Align::Default);
opCombox->setComboModeDrop(true);
opCombox->addItem("test");

Redminnow

07-01-2009 22:32:29

Hi my.name thanks for the fast reply.

I've changed this now. Thanks for pointing out i was using obsolete code and that i didnt need to layer the combo box

I'm still having the same problem however :(

Any more ideas would be great

Thanks

Altren

08-01-2009 01:30:43

Show your code.

my.name

08-01-2009 01:36:18

=)

opWindow = mGUI->createWidget<MyGUI::Widget>("WindowC", ((width/2)-((250*widthF)/2)), ((height/3)-((80*heightF)/2)), (250*widthF), (170*heightF), MyGUI::ALIGN_DEFAULT,"Overlapped");
opCombox = opWindow->createWidget<MyGUI::ComboBox>("ComboBox",15,50,opWindow->getWidth()-30,30,MyGUI::ALIGN_DEFAULT);
opCombox->setComboModeDrop(true);
opCombox->addItem("test");

Redminnow

08-01-2009 11:19:27

Thanks for the suggestions guys, still not working however :(

Code now looks like this:


opWindow = mGUI->createWidget<MyGUI::Widget>("WindowC", ((width/2)-((250*widthF)/2)), ((height/3)-((80*heightF)/2)), (250*widthF), (170*heightF), MyGUI::Align::Default, "Overlapped");
opCombox = opWindow->createWidget<MyGUI::ComboBox>("ComboBox",15,50,opWindow->getWidth()-30,30,MyGUI::Align::Default);
opCombox->setComboModeDrop(true);
opCombox->addItem("test");


Any more suggestions would be great :)