mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #1365 from Olathuss/closeMenu
Close Menu Implemented
This commit is contained in:
commit
4a0bb46b49
2 changed files with 14 additions and 0 deletions
|
|
@ -506,6 +506,16 @@ void GuiMenuBar::onAction()
|
||||||
mouseDownMenu->popupMenu->showPopup(root, pos.x, pos.y);
|
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
|
// Process a tick
|
||||||
void GuiMenuBar::processTick()
|
void GuiMenuBar::processTick()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -247,6 +247,10 @@ void GuiPopupMenuTextListCtrl::onMouseUp(const GuiEvent &event)
|
||||||
{
|
{
|
||||||
if (item->mEnabled)
|
if (item->mEnabled)
|
||||||
{
|
{
|
||||||
|
if(mMenuBar)
|
||||||
|
{
|
||||||
|
mMenuBar->closeMenu();
|
||||||
|
}
|
||||||
Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->mText.isNotEmpty() ? item->mText : String(""));
|
Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->mText.isNotEmpty() ? item->mText : String(""));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue