]> git.saurik.com Git - wxWidgets.git/commitdiff
don't draw focus rect for custom drawn items when the list control doesn't have focus
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Mar 2006 01:27:59 +0000 (01:27 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 8 Mar 2006 01:27:59 +0000 (01:27 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@37897 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/listctrl.cpp

index 1102ccc5e3f303550296ef081b9cdfeb74c3a15d..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;
     }