MCPcopy Create free account
hub / github.com/GarageGames/Torque3D / closeMenu

Method closeMenu

Engine/source/gui/editor/guiMenuBar.cpp:1609–1641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1607}
1608
1609void GuiMenuBar::closeMenu()
1610{
1611 // First close any open submenu
1612 closeSubmenu();
1613
1614 // Get the selection from the text list:
1615 S32 selectionIndex = mTextList->getSelectedCell().y;
1616
1617 // Pop the background:
1618 if( getRoot() )
1619 getRoot()->popDialogControl(mBackground);
1620 else
1621 return;
1622
1623 // Kill the popup:
1624 mBackground->deleteObject();
1625 mBackground = NULL;
1626
1627 // Now perform the popup action:
1628 if ( selectionIndex != -1 )
1629 {
1630 MenuItem *list = mouseDownMenu->firstMenuItem;
1631
1632 while(selectionIndex && list)
1633 {
1634 list = list->nextMenuItem;
1635 selectionIndex--;
1636 }
1637 if(list)
1638 menuItemSelected(mouseDownMenu, list);
1639 }
1640 mouseDownMenu = NULL;
1641}
1642
1643// Called when a menu item is highlighted by the mouse
1644void GuiMenuBar::highlightedMenuItem(S32 selectionIndex, const RectI& bounds, Point2I cellSize)

Callers 3

onMouseDownMethod · 0.80
onKeyDownMethod · 0.80
onMouseUpMethod · 0.80

Calls 3

getSelectedCellMethod · 0.80
popDialogControlMethod · 0.80
deleteObjectMethod · 0.45

Tested by

no test coverage detected