From edf03984f2a65b274b5662292b73d04a5e1abe4b Mon Sep 17 00:00:00 2001 From: ansstuff Date: Tue, 10 Apr 2012 15:00:58 +0000 Subject: [PATCH] bold items in some context menus, fix #3516233 --- src/drivers/win/cheat.cpp | 2 +- src/drivers/win/debugger.cpp | 2 +- src/drivers/win/res.rc | 2 +- src/drivers/win/taseditor/piano_roll.cpp | 14 +++++++------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/drivers/win/cheat.cpp b/src/drivers/win/cheat.cpp index a4ce8671..57710b92 100644 --- a/src/drivers/win/cheat.cpp +++ b/src/drivers/win/cheat.cpp @@ -361,7 +361,7 @@ BOOL CALLBACK CheatConsoleCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM l if (selcheat >= 0) { // Open IDC_LIST_CHEATS Context Menu hCheatcontextsub = GetSubMenu(hCheatcontext,0); - + SetMenuDefaultItem(hCheatcontextsub, CHEAT_CONTEXT_TOGGLECHEAT, false); if (lParam != -1) TrackPopupMenu(hCheatcontextsub,TPM_RIGHTBUTTON,LOWORD(lParam),HIWORD(lParam),0,hwndDlg,0); //Create menu else { // Handle the context menu keyboard key diff --git a/src/drivers/win/debugger.cpp b/src/drivers/win/debugger.cpp index e175ea64..444c3173 100644 --- a/src/drivers/win/debugger.cpp +++ b/src/drivers/win/debugger.cpp @@ -1197,7 +1197,7 @@ BOOL CALLBACK DebuggerCallB(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lPara if (SendDlgItemMessage(hwndDlg,IDC_DEBUGGER_BP_LIST,LB_GETCURSEL,0,0) >= 0) { // Open IDC_LIST_CHEATS Context Menu hDebugcontextsub = GetSubMenu(hDebugcontext,0); - + SetMenuDefaultItem(hDebugcontextsub, DEBUGGER_CONTEXT_TOGGLEBREAK, false); if (lParam != -1) TrackPopupMenu(hDebugcontextsub,TPM_RIGHTBUTTON,LOWORD(lParam),HIWORD(lParam),0,hwndDlg,0); //Create menu else { // Handle the context menu keyboard key diff --git a/src/drivers/win/res.rc b/src/drivers/win/res.rc index 67a95cf1..665967f9 100644 --- a/src/drivers/win/res.rc +++ b/src/drivers/win/res.rc @@ -384,7 +384,7 @@ TASEDITORCONTEXTMENUS MENU BEGIN POPUP "Selected" BEGIN - MENUITEM "Set Markers", ID_SELECTED_SETMARKERS + MENUITEM "Set Markers\tDbl-Clk", ID_SELECTED_SETMARKERS MENUITEM "Remove Markers", ID_SELECTED_REMOVEMARKERS MENUITEM SEPARATOR MENUITEM "Deselect", ID_SELECTED_DESELECT diff --git a/src/drivers/win/taseditor/piano_roll.cpp b/src/drivers/win/taseditor/piano_roll.cpp index 0ef4cab4..97f9425b 100644 --- a/src/drivers/win/taseditor/piano_roll.cpp +++ b/src/drivers/win/taseditor/piano_roll.cpp @@ -1282,6 +1282,7 @@ void PIANO_ROLL::RightClick(LVHITTESTINFO& info) { SelectionFrames* current_selection = selection.MakeStrobe(); HMENU sub = GetSubMenu(hrmenu, 0); + SetMenuDefaultItem(sub, ID_SELECTED_SETMARKERS, false); // inspect current selection and disable inappropriate menu items SelectionFrames::iterator current_selection_begin(current_selection->begin()); SelectionFrames::iterator current_selection_end(current_selection->end()); @@ -1293,15 +1294,14 @@ void PIANO_ROLL::RightClick(LVHITTESTINFO& info) else unset_found = true; } - if (set_found) - EnableMenuItem(sub, ID_SELECTED_REMOVEMARKER, MF_BYCOMMAND | MF_ENABLED); - else - EnableMenuItem(sub, ID_SELECTED_REMOVEMARKER, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); if (unset_found) - EnableMenuItem(sub, ID_SELECTED_SETMARKER, MF_BYCOMMAND | MF_ENABLED); + EnableMenuItem(sub, ID_SELECTED_SETMARKERS, MF_BYCOMMAND | MF_ENABLED); else - EnableMenuItem(sub, ID_SELECTED_SETMARKER, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); - + EnableMenuItem(sub, ID_SELECTED_SETMARKERS, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); + if (set_found) + EnableMenuItem(sub, ID_SELECTED_REMOVEMARKERS, MF_BYCOMMAND | MF_ENABLED); + else + EnableMenuItem(sub, ID_SELECTED_REMOVEMARKERS, MF_BYCOMMAND | MF_DISABLED | MF_GRAYED); POINT pt = info.pt; ClientToScreen(hwndList, &pt); TrackPopupMenu(sub, 0, pt.x, pt.y, 0, taseditor_window.hwndTasEditor, 0);