mirror of
https://github.com/rizonesoft/Notepad3.git
synced 2026-06-14 21:09:05 +08:00
Merge pull request #3670 from RaiKoHoff/Dev_RC
Enable context menu for status bar
This commit is contained in:
commit
09e4e4e208
@ -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;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user