| 1295 | |
| 1296 | |
| 1297 | void UserMenu::UpdateAccelerators() |
| 1298 | { |
| 1299 | if (!mMenu) |
| 1300 | // Menu doesn't exist yet, so can't be attached (directly or indirectly) to any GUIs. |
| 1301 | return; |
| 1302 | |
| 1303 | if (mMenuType == MENU_TYPE_BAR) |
| 1304 | { |
| 1305 | for (GuiType* gui = g_firstGui; gui; gui = gui->mNextGui) |
| 1306 | if (GetMenu(gui->mHwnd) == mMenu) |
| 1307 | { |
| 1308 | gui->UpdateAccelerators(*this); |
| 1309 | // Continue in case there are other GUIs using this menu. |
| 1310 | //break; |
| 1311 | } |
| 1312 | } |
| 1313 | else |
| 1314 | { |
| 1315 | // This menu isn't a menu bar, but perhaps it is contained by one. |
| 1316 | for (UserMenu *menu = g_script.mFirstMenu; menu; menu = menu->mNextMenu) |
| 1317 | if (menu->mMenuType == MENU_TYPE_BAR && menu->ContainsMenu(this)) |
| 1318 | { |
| 1319 | menu->UpdateAccelerators(); |
| 1320 | // Continue in case there are other menus which contain this submenu. |
| 1321 | //break; |
| 1322 | } |
| 1323 | return; |
| 1324 | } |
| 1325 | } |
| 1326 | |
| 1327 | |
| 1328 |
nothing calls this directly
no test coverage detected