]> git.saurik.com Git - wxWidgets.git/commitdiff
don't let WM_RBUTTONDOWN reach def window proc as it would enter a local modal messag...
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2005 22:59:22 +0000 (22:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 5 Apr 2005 22:59:22 +0000 (22:59 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33361 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/msw/treectrl.h
src/msw/treectrl.cpp

index 21f4d1b74413c50a7a9abaa72c7363a23f2be70c..c315096dfd6c9e1d1a1530bf60d850b3de2453f3 100644 (file)
@@ -425,6 +425,7 @@ public:
 
 
     virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
+    virtual WXLRESULT MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
     virtual bool MSWCommand(WXUINT param, WXWORD id);
     virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
 
index 8cc634935eedc1d129c7556adf02e9fa53dffff1..c09e85d2056eb470f7e73e5fc4f0e540be2b17aa 100644 (file)
@@ -2275,13 +2275,6 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
                 // newly selected item
                 ::SelectItem(GetHwnd(), htItem);
                 ::SetFocus(GetHwnd(), htItem);
-
-                // default WM_RBUTTONUP handler enters modal loop inside
-                // DefWindowProc() waiting for WM_RBUTTONDOWN and then sends
-                // the resulting WM_CONTEXTMENU to the parent window, not us,
-                // which completely breaks everything so simply don't let it
-                // see this message at all
-                processed = true;
                 break;
 
 #if !wxUSE_CHECKBOXES_IN_MULTI_SEL_TREE
@@ -2541,6 +2534,19 @@ WXLRESULT wxTreeCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lPara
     return rc;
 }
 
+WXLRESULT
+wxTreeCtrl::MSWDefWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
+{
+    // default WM_RBUTTONDOWN handler enters modal loop inside DefWindowProc()
+    // waiting for WM_RBUTTONUP and then sends the resulting WM_CONTEXTMENU to
+    // the parent window, not us, which completely breaks everything so simply
+    // don't let it see this message at all
+    if ( nMsg == WM_RBUTTONDOWN )
+        return 0;
+
+    return wxControl::MSWDefWindowProc(nMsg, wParam, lParam);
+}
+
 // process WM_NOTIFY Windows message
 bool wxTreeCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
 {