| 379 | } |
| 380 | |
| 381 | void EventManager::aboutToOpenMenu(wxMenu& menu) |
| 382 | { |
| 383 | // Grey out any menu items which cannot currently be run |
| 384 | for (wxMenuItem* item: menu.GetMenuItems()) { |
| 385 | // Not everything in the menu may have a command ID (e.g. separators) |
| 386 | if (auto i = _commandsByMenuID.find(item->GetId()); i != _commandsByMenuID.end()) { |
| 387 | item->Enable(GlobalCommandSystem().canExecute(i->second)); |
| 388 | } |
| 389 | } |
| 390 | } |
| 391 | |
| 392 | Accelerator& EventManager::connectAccelerator(int keyCode, unsigned int modifierFlags, const std::string& command) |
| 393 | { |
nothing calls this directly
no test coverage detected