]> git.saurik.com Git - wxWidgets.git/commitdiff
don't generate wxEVT_CONTEXT_MENU messages for right clicks in the list control header
authorVadim Zeitlin <vadim@wxwidgets.org>
Mon, 10 Apr 2006 01:17:49 +0000 (01:17 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Mon, 10 Apr 2006 01:17:49 +0000 (01:17 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38644 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index b4d348ac46fdc359052faa0cb5cac9f577ce8ef4..3524895a5f687b2b4938490a1663d7cb2e7cd093 100644 (file)
@@ -2695,15 +2695,26 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
 WXLRESULT
 wxListCtrl::MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam)
 {
-#ifdef WM_PRINT
-    if ( nMsg == WM_PRINT )
+    switch ( nMsg )
     {
-        // we should bypass our own WM_PRINT handling as we don't handle
-        // PRF_CHILDREN flag, so leave it to the native control itself
-        return MSWDefWindowProc(nMsg, wParam, lParam);
-    }
+#ifdef WM_PRINT
+        case WM_PRINT:
+            // we should bypass our own WM_PRINT handling as we don't handle
+            // PRF_CHILDREN flag, so leave it to the native control itself
+            return MSWDefWindowProc(nMsg, wParam, lParam);
 #endif // WM_PRINT
 
+        case WM_CONTEXTMENU:
+            // because this message is propagated upwards the child-parent
+            // chain, we get it for the right clicks on the header window but
+            // this is confusing in wx as right clicking there already
+            // generates a separate wxEVT_COMMAND_LIST_COL_RIGHT_CLICK event
+            // so just ignore them
+            if ( (HWND)wParam == ListView_GetHeader(GetHwnd()) )
+                return 0;
+            //else: break
+    }
+
     return wxControl::MSWWindowProc(nMsg, wParam, lParam);
 }