OptionSelectionMenu::OptionSelectionMenu(OptionSelectionMenu* parentMenu) { DisplayState = Display_None; SelectedIndex = 0; SelectionActive = false; ParentMenu = parentMenu; PopupMessageTimeout = 0.0; PopupMessageBorder = false; // Setup handlers for menu navigation actions. NavShortcuts[Nav_Up].pNotify = new FunctionNotifyContext<OptionSelectionMenu, bool>(this, &OptionSelectionMenu::HandleUp); NavShortcuts[Nav_Down].pNotify = new FunctionNotifyContext<OptionSelectionMenu, bool>(this, &OptionSelectionMenu::HandleDown); NavShortcuts[Nav_Left].pNotify = new FunctionNotifySimple<OptionSelectionMenu>(this, &OptionSelectionMenu::HandleLeft); NavShortcuts[Nav_Right].pNotify = new FunctionNotifySimple<OptionSelectionMenu>(this, &OptionSelectionMenu::HandleRight); NavShortcuts[Nav_Select].pNotify = new FunctionNotifySimple<OptionSelectionMenu>(this, &OptionSelectionMenu::HandleSelect); NavShortcuts[Nav_Back].pNotify = new FunctionNotifySimple<OptionSelectionMenu>(this, &OptionSelectionMenu::HandleBack); ToggleShortcut.pNotify = new FunctionNotifySimple<OptionSelectionMenu>(this, &OptionSelectionMenu::HandleMenuToggle); ToggleSingleItemShortcut.pNotify = new FunctionNotifySimple<OptionSelectionMenu>(this, &OptionSelectionMenu::HandleSingleItemToggle); // Bind keys and buttons to menu navigation actions. NavShortcuts[Nav_Up].AddShortcut(ShortcutKey(Key_Up, ShortcutKey::Shift_Modify)); NavShortcuts[Nav_Up].AddShortcut(Gamepad_Up); NavShortcuts[Nav_Down].AddShortcut(ShortcutKey(Key_Down, ShortcutKey::Shift_Modify)); NavShortcuts[Nav_Down].AddShortcut(Gamepad_Down); NavShortcuts[Nav_Left].AddShortcut(ShortcutKey(Key_Left)); NavShortcuts[Nav_Left].AddShortcut(Gamepad_Left); NavShortcuts[Nav_Right].AddShortcut(ShortcutKey(Key_Right)); NavShortcuts[Nav_Right].AddShortcut(Gamepad_Right); NavShortcuts[Nav_Select].AddShortcut(ShortcutKey(Key_Return)); NavShortcuts[Nav_Select].AddShortcut(Gamepad_A); NavShortcuts[Nav_Back].AddShortcut(ShortcutKey(Key_Escape)); NavShortcuts[Nav_Back].AddShortcut(Gamepad_B); ToggleShortcut.AddShortcut(ShortcutKey(Key_Tab, ShortcutKey::Shift_Ignore)); ToggleShortcut.AddShortcut(Gamepad_Start); ToggleSingleItemShortcut.AddShortcut(ShortcutKey(Key_Backspace, ShortcutKey::Shift_Ignore)); }
DlgPreferencesAction::DlgPreferencesAction(wxWindow* parent) : DlgPreferencesAction(parent, ShortcutKey(), nullptr) { }