]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
added constructor for compliance with wxPython
[wxWidgets.git] / src / msw / listctrl.cpp
index bdab497417cd78cb47a104aee087da37a449075d..b21c61756cd06b6f9ac6ac93d08d7a3d0e497bd4 100644 (file)
@@ -280,7 +280,7 @@ bool wxListCtrl::DoCreateControl(int x, int y, int w, int h)
                       0, LVS_EX_FULLROWSELECT);
     }
 
-    SetBackgroundColour(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_WINDOW));
+    SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
     SetForegroundColour(GetParent()->GetForegroundColour());
 
     SubclassWin(m_hWnd);
@@ -752,8 +752,9 @@ bool wxListCtrl::SetItemState(long item, long state, long stateMask)
     wxConvertToMSWFlags(state, stateMask, lvItem);
 
     // for the virtual list controls we need to refresh the previously focused
-    // item manually when changing focus programmatically because otherwise it
-    // keeps its focus rectangle until next repaint (yet another comctl32 bug)
+    // item manually when changing focus without changing selection
+    // programmatically because otherwise it keeps its focus rectangle until
+    // next repaint (yet another comctl32 bug)
     long focusOld;
     if ( IsVirtual() &&
          (stateMask & wxLIST_STATE_FOCUSED) &&
@@ -776,7 +777,13 @@ bool wxListCtrl::SetItemState(long item, long state, long stateMask)
 
     if ( focusOld != -1 )
     {
-        RefreshItem(focusOld);
+        // no need to refresh the item if it was previously selected, it would
+        // only result in annoying flicker
+        if ( !(GetItemState(focusOld,
+                            wxLIST_STATE_SELECTED) & wxLIST_STATE_SELECTED) )
+        {
+            RefreshItem(focusOld);
+        }
     }
 
     return TRUE;
@@ -1502,7 +1509,11 @@ bool wxListCtrl::MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result)
     // is it a message from the header?
     if ( nmhdr->hwndFrom == hwndHdr )
     {
+#ifdef __WATCOMC__
+        HD_NOTIFY *nmHDR = (HD_NOTIFY *)nmhdr;
+#else
         NMHEADER *nmHDR = (NMHEADER *)nmhdr;
+#endif
         event.m_itemIndex = -1;
 
         switch ( nmhdr->code )
@@ -2014,7 +2025,7 @@ void wxListCtrl::OnPaint(wxPaintEvent& event)
     if ((GetWindowStyle() & wxLC_REPORT) == 0)
         return;
 
-    wxPen pen(wxSystemSettings::GetSystemColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
+    wxPen pen(wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT), 1, wxSOLID);
     dc.SetPen(pen);
     dc.SetBrush(* wxTRANSPARENT_BRUSH);