]> git.saurik.com Git - wxWidgets.git/blobdiff - src/msw/listctrl.cpp
Updated to Scintilla 1.67
[wxWidgets.git] / src / msw / listctrl.cpp
index 9ad44f0969236b29c1a548bf608c9de4a6353b67..3516a389731d71306ac12fa0f751ef48265c119a 100644 (file)
@@ -2483,7 +2483,8 @@ static void HandleItemPaint(LPNMLVCUSTOMDRAW pLVCD, HFONT hfont)
     }
 
     // same thing for CDIS_FOCUS (except simpler as there is only one of them)
-    if ( ListView_GetNextItem(hwndList, -1, LVNI_FOCUSED) == item )
+    if ( ::GetFocus() == hwndList &&
+            ListView_GetNextItem(hwndList, -1, LVNI_FOCUSED) == item )
     {
         nmcd.uItemState |= CDIS_FOCUS;
     }
@@ -2544,12 +2545,12 @@ static WXLPARAM HandleItemPrepaint(wxListCtrl *listctrl,
 
 
     // set the colours to use for text drawing
-    pLVCD->clrText = wxColourToRGB(attr->HasTextColour()
-                                    ? attr->GetTextColour()
-                                    : listctrl->GetTextColour());
-    pLVCD->clrTextBk = wxColourToRGB(attr->HasBackgroundColour()
-                                        ? attr->GetBackgroundColour()
-                                        : listctrl->GetBackgroundColour());
+    pLVCD->clrText = attr->HasTextColour()
+                     ? wxColourToRGB(attr->GetTextColour())
+                     : wxColourToRGB(listctrl->GetTextColour());
+    pLVCD->clrTextBk = attr->HasBackgroundColour()
+                       ? wxColourToRGB(attr->GetBackgroundColour())
+                       : wxColourToRGB(listctrl->GetBackgroundColour());
 
     // select the font if non default one is specified
     if ( attr->HasFont() )