| 1607 | } |
| 1608 | |
| 1609 | void 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 |
| 1644 | void GuiMenuBar::highlightedMenuItem(S32 selectionIndex, const RectI& bounds, Point2I cellSize) |
no test coverage detected