Close down the submenu controls
| 1914 | |
| 1915 | // Close down the submenu controls |
| 1916 | void GuiMenuBar::closeSubmenu() |
| 1917 | { |
| 1918 | if(!mSubmenuBackground || !mSubmenuTextList) |
| 1919 | return; |
| 1920 | |
| 1921 | // Get the selection from the text list: |
| 1922 | S32 selectionIndex = mSubmenuTextList->getSelectedCell().y; |
| 1923 | |
| 1924 | // Pop the background: |
| 1925 | if( getRoot() ) |
| 1926 | getRoot()->popDialogControl(mSubmenuBackground); |
| 1927 | |
| 1928 | // Kill the popup: |
| 1929 | mSubmenuBackground->deleteObject(); |
| 1930 | mSubmenuBackground = NULL; |
| 1931 | mSubmenuTextList = NULL; |
| 1932 | |
| 1933 | // Now perform the popup action: |
| 1934 | if ( selectionIndex != -1 ) |
| 1935 | { |
| 1936 | MenuItem *list = NULL; |
| 1937 | if(mouseOverSubmenu) |
| 1938 | { |
| 1939 | list = mouseOverSubmenu->submenu->firstMenuItem; |
| 1940 | |
| 1941 | while(selectionIndex && list) |
| 1942 | { |
| 1943 | list = list->nextMenuItem; |
| 1944 | selectionIndex--; |
| 1945 | } |
| 1946 | } |
| 1947 | if(list) |
| 1948 | menuItemSelected(list->submenuParentMenu, list); |
| 1949 | } |
| 1950 | mouseOverSubmenu = NULL; |
| 1951 | } |
| 1952 | |
| 1953 | // Find if the mouse pointer is within a menu item |
| 1954 | GuiMenuBar::MenuItem *GuiMenuBar::findHitMenuItem(Point2I mousePoint) |
nothing calls this directly
no test coverage detected