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

Method closeSubmenu

Engine/source/gui/editor/guiMenuBar.cpp:1916–1951  ·  view source on GitHub ↗

Close down the submenu controls

Source from the content-addressed store, hash-verified

1914
1915// Close down the submenu controls
1916void 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
1954GuiMenuBar::MenuItem *GuiMenuBar::findHitMenuItem(Point2I mousePoint)

Callers

nothing calls this directly

Calls 3

getSelectedCellMethod · 0.80
popDialogControlMethod · 0.80
deleteObjectMethod · 0.45

Tested by

no test coverage detected