]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Spacing tweak
[wxWidgets.git] / src / msw / listctrl.cpp
index e680736293876948a0ea51aaf2642909a5f18f78..3524895a5f687b2b4938490a1663d7cb2e7cd093 100644 (file)
@@ -2491,7 +2491,7 @@ static void HandleItemPaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont)
 
     // same thing for CDIS_FOCUS (except simpler as there is only one of them)
     if ( ::GetFocus() == hwndList &&
-            ListView_GetNextItem(hwndList, -1, LVNI_FOCUSED) == item )
+            ListView_GetNextItem(hwndList, (WPARAM)-1, LVNI_FOCUSED) == item )
     {
         nmcd.uItemState |= CDIS_FOCUS;
     }
@@ -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);
 }