diff options
author | George Hazan <ghazan@miranda.im> | 2016-11-22 14:46:15 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2016-11-22 14:56:24 +0300 |
commit | 0edfbcc3fd42701475505e6ac7cf6a153bc1e25a (patch) | |
tree | a10f8148266b5abc041fc5b7cce83ab215913447 /src/mir_core | |
parent | 5e7f1af9e78f7f7ae019a03ba34c9ae7ea72cdff (diff) |
OnBuildMenu - new callback for handling rclicks
Diffstat (limited to 'src/mir_core')
-rw-r--r-- | src/mir_core/src/mir_core.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/mir_core64.def | 2 | ||||
-rw-r--r-- | src/mir_core/src/ui_utils.cpp | 14 |
3 files changed, 18 insertions, 0 deletions
diff --git a/src/mir_core/src/mir_core.def b/src/mir_core/src/mir_core.def index 21a64dc25f..5415d0021a 100644 --- a/src/mir_core/src/mir_core.def +++ b/src/mir_core/src/mir_core.def @@ -1031,3 +1031,5 @@ CallFunctionSync @1170 ?Start@CTimer@@QAEXH@Z @1188 NONAME
?Stop@CTimer@@QAEXXZ @1189 NONAME
?AddTimer@CDlgBase@@IAEXPAVCTimer@@@Z @1190 NONAME
+??0CCtrlBase@@AAE@PAUHWND__@@@Z @1191 NONAME
+?FindControl@CDlgBase@@AAEPAVCCtrlBase@@PAUHWND__@@@Z @1192 NONAME
diff --git a/src/mir_core/src/mir_core64.def b/src/mir_core/src/mir_core64.def index 50b1d8ed5d..1d24a768ff 100644 --- a/src/mir_core/src/mir_core64.def +++ b/src/mir_core/src/mir_core64.def @@ -1031,3 +1031,5 @@ CallFunctionSync @1170 ?Start@CTimer@@QEAAXH@Z @1188 NONAME
?Stop@CTimer@@QEAAXXZ @1189 NONAME
?AddTimer@CDlgBase@@IEAAXPEAVCTimer@@@Z @1190 NONAME
+??0CCtrlBase@@AEAA@PEAUHWND__@@@Z @1191 NONAME
+?FindControl@CDlgBase@@AEAAPEAVCCtrlBase@@PEAUHWND__@@@Z @1192 NONAME
diff --git a/src/mir_core/src/ui_utils.cpp b/src/mir_core/src/ui_utils.cpp index dc53f9dd71..ef726b6c49 100644 --- a/src/mir_core/src/ui_utils.cpp +++ b/src/mir_core/src/ui_utils.cpp @@ -210,6 +210,11 @@ INT_PTR CDlgBase::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam) }
return FALSE;
+ case WM_CONTEXTMENU:
+ if (CCtrlBase *ctrl = FindControl(HWND(wParam)))
+ ctrl->OnBuildMenu(ctrl);
+ break;
+
case WM_SIZE:
if (m_forceResizable || (GetWindowLongPtr(m_hwnd, GWL_STYLE) & WS_SIZEBOX))
Utils_ResizeDialog(m_hwnd, m_hInst, MAKEINTRESOURCEA(m_idDialog), GlobalDlgResizer);
@@ -297,6 +302,15 @@ CCtrlBase* CDlgBase::FindControl(int idCtrl) return m_controls.find(&search);
}
+CCtrlBase* CDlgBase::FindControl(HWND hwnd)
+{
+ for (int i = 0; i < m_controls.getCount(); i++)
+ if (m_controls[i]->GetHwnd() == hwnd)
+ return m_controls[i];
+
+ return NULL;
+}
+
void CDlgBase::AddTimer(CTimer *timer)
{
m_timers.insert(timer);
|