Merge pull request #3670 from RaiKoHoff/Dev_RC

Enable context menu for status bar
This commit is contained in:
Pairi Daiza 2021-09-23 17:38:03 +02:00 committed by GitHub
commit 09e4e4e208
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}