]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct focus rect to not appear in unfocussed controls (currently doesn't appear...
authorRobert Roebling <robert@roebling.de>
Wed, 17 Oct 2007 09:43:19 +0000 (09:43 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 17 Oct 2007 09:43:19 +0000 (09:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49196 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

include/wx/dataview.h
src/generic/datavgen.cpp

index 4af433f8f3f98ad7ad8d4b63b54952281093774d..ff88b737830b681ab76ec35646a5b4bd921e636c 100644 (file)
@@ -26,7 +26,7 @@
 
 #if defined(__WXGTK20__)
     // for testing
-    #define wxUSE_GENERICDATAVIEWCTRL 1
+    // #define wxUSE_GENERICDATAVIEWCTRL 1
 #elif defined(__WXMAC__)
 #else
     #define wxUSE_GENERICDATAVIEWCTRL 1
index dfc95dbb3facb92cc0baac8a838dd0968bc0c61c..f91f29dc78e6d33dc1e69d6a19c26651f84165ff 100644 (file)
@@ -2351,6 +2351,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
                     x, item_last * m_lineHeight);
     }
 
+    bool has_focus = (FindFocus() == this);
     // redraw the background for the items which are selected/current
     for (unsigned int item = item_start; item < item_last; item++)
     {
@@ -2358,7 +2359,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) )
         if (selected || item == m_currentRow)
         {
             int flags = selected ? (int)wxCONTROL_SELECTED : 0;
-            if (item == m_currentRow)
+            if ((item == m_currentRow) && has_focus)
                 flags |= wxCONTROL_CURRENT;
             if (m_hasFocus)
                 flags |= wxCONTROL_FOCUSED;