ZealAddon
04-11-2010 18:52:39
I am trying to create a tiered PopupMenu (where one item in the menu can expand when you hover over it, spawning another popup menu with more options), however I am noticing a problem - The PopupMenu widget seems to auto hide itself when any item is clicked. Is there anyway to disable this behavior?
Thanks
Altren
04-11-2010 20:37:57
Hm, how you create submenus? I guess you doing something wrong, because by default PopupMenu hide itself only if item without subitems was clicked.
ZealAddon
09-11-2010 03:29:00
Ahh ok maybe I am doing it wrong. I was planning on just creating a new popup menu next to the 'root' menu when a item was clicked. Youre suggesting I use child items instead? I am looking at the API now... I dont see how you create a tiered/child popup menu... Can you give an example?
ZealAddon
09-11-2010 16:30:19
Well the point is I dont see a command in the api to do what I want. I have a popupmenu with a item, and I want it to expand to a new 'child' popup menu when you hover over it, and/or click it.
MyGUI::PopupMenu* w = gui.createWidget<MyGUI::PopupMenu>("PopupMenu", 0, 0, 300, 143, MyGUI::Align::Default, "Main");
w->addItem("#ffffffExpandable Item >");
It would also be nice if the 'Expandable Item' also had a '>' arrow indicating there was a sub menu there.
Altren
09-11-2010 17:57:52
MyGUI::PopupMenu* w = gui.createWidget<MyGUI::PopupMenu>("PopupMenu", 0, 0, 300, 143, MyGUI::Align::Default, "Main");
w->addItem("#ffffffExpandable Item >", MyGUI::MenuItemType::Popup);
MyGUI::MenuCtrl* child = w->createItemChildAt(0);
child->addItem("Common Item");
child->addItem("Expandable Item", MyGUI::MenuItemType::Popup);
MyGUI::MenuCtrl* child2 = child->createItemChildAt(1);
child2->addItem("Common Item");
ZealAddon
09-11-2010 20:26:04
Ah ok cool so it looks like the trick is using the "MyGUI::MenuItemType::Popup" when adding a item..
Thanks!