From 3f3b0ff65ff7c34fa27b47ee266f22f610acfe70 Mon Sep 17 00:00:00 2001 From: rkotten Date: Thu, 23 Sep 2021 17:15:10 +0200 Subject: [PATCH] +chg: enable context menu for status bar --- src/Notepad3.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Notepad3.c b/src/Notepad3.c index adb07c0f6..3b9beb51d 100644 --- a/src/Notepad3.c +++ b/src/Notepad3.c @@ -3311,16 +3311,16 @@ LRESULT MsgCopyData(HWND hwnd, WPARAM wParam, LPARAM lParam) // LRESULT MsgContextMenu(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) { - bool const bMargin = (SCN_MARGINRIGHTCLICK == umsg); - bool const bNCArea = (WM_NCRBUTTONDOWN == umsg); + bool const bMargin = (SCN_MARGINRIGHTCLICK == umsg); + bool const bNCArea = (WM_NCRBUTTONDOWN == umsg); int const nID = bMargin ? IDC_MARGIN : (bNCArea ? IDC_NCAREA : GetDlgCtrlID((HWND)wParam)); if ((nID != IDC_MARGIN) && (nID != IDC_EDIT) && - (nID != IDC_STATUSBAR) && (nID != IDC_REBAR) && (nID != IDC_TOOLBAR) && + (nID != IDC_STATUSBAR) && (nID != IDC_NCAREA)) { return DefWindowProc(hwnd, umsg, wParam, lParam); } @@ -3357,7 +3357,7 @@ LRESULT MsgContextMenu(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) case IDC_EDIT: { if (!IS_CTX_PT_VALID(pt)) { - // caused by keypoard near caret pos + // caused by keyboard near caret pos DocPos const iCurrentPos = SciCall_GetCurrentPos(); pt.x = (LONG)SciCall_PointXFromPosition(iCurrentPos); pt.y = (LONG)SciCall_PointYFromPosition(iCurrentPos); @@ -3387,7 +3387,8 @@ LRESULT MsgContextMenu(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) case IDC_TOOLBAR: case IDC_STATUSBAR: - case IDC_REBAR: { + case IDC_REBAR: + case IDC_NCAREA: { if (!IS_CTX_PT_VALID(pt)) { GetCursorPos(&pt); } @@ -3418,13 +3419,6 @@ LRESULT MsgContextMenu(HWND hwnd, UINT umsg, WPARAM wParam, LPARAM lParam) } } break; - case IDC_NCAREA: { - if (!IS_CTX_PT_VALID(pt)) { - GetCursorPos(&pt); - } - imenu = MNU_BAR; - } break; - default: break; } @@ -8145,6 +8139,12 @@ LRESULT MsgNotify(HWND hwnd, WPARAM wParam, LPARAM lParam) } break; + case NM_RCLICK: { + POINT pt = { 0, 0 }; + GetCursorPos(&pt); + MsgContextMenu(hwnd, 0, (WPARAM)Globals.hwndStatus, MAKELPARAM(pt.x, pt.y)); + } break; + default: break; }