mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
Close Menu Implemented
closeMenu function on guiMenuBar implemented. Closes menu when selecting a popup menu action.
This commit is contained in:
parent
71d08e9e0c
commit
44df6dada7
|
|
@ -506,6 +506,16 @@ void GuiMenuBar::onAction()
|
|||
mouseDownMenu->popupMenu->showPopup(root, pos.x, pos.y);
|
||||
}
|
||||
|
||||
void GuiMenuBar::closeMenu()
|
||||
{
|
||||
if(mouseDownMenu)
|
||||
mouseDownMenu->popupMenu->hidePopup();
|
||||
|
||||
mouseOverMenu = NULL;
|
||||
mouseDownMenu = NULL;
|
||||
mMouseInMenu = false;
|
||||
}
|
||||
|
||||
// Process a tick
|
||||
void GuiMenuBar::processTick()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -247,6 +247,10 @@ void GuiPopupMenuTextListCtrl::onMouseUp(const GuiEvent &event)
|
|||
{
|
||||
if (item->mEnabled)
|
||||
{
|
||||
if(mMenuBar)
|
||||
{
|
||||
mMenuBar->closeMenu();
|
||||
}
|
||||
Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->mText.isNotEmpty() ? item->mText : String(""));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue