]> git.saurik.com Git - wxWidgets.git/commitdiff
Correct EnsureVisible() to show last item entirely
authorRobert Roebling <robert@roebling.de>
Wed, 17 Oct 2007 09:21:04 +0000 (09:21 +0000)
committerRobert Roebling <robert@roebling.de>
Wed, 17 Oct 2007 09:21:04 +0000 (09:21 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

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

index ff88b737830b681ab76ec35646a5b4bd921e636c..4af433f8f3f98ad7ad8d4b63b54952281093774d 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 f9a90df680e8c3dc4cced0a089c178b680b7e76f..dfc95dbb3facb92cc0baac8a838dd0968bc0c61c 100644 (file)
@@ -499,7 +499,6 @@ public:
         return wxSystemSettings::GetColour(wxSYS_COLOUR_3DLIGHT);
     }
 
-    //void EnsureVisible( unsigned int row );
     wxRect GetLineRect( unsigned int row ) const;
 
     //Some useful functions for row and item mapping
@@ -2541,9 +2540,7 @@ unsigned int wxDataViewMainWindow::GetLastVisibleRow()
                                      &client_size.x, &client_size.y );
 
     //we should deal with the pixel here
-    unsigned int row = (client_size.y)/m_lineHeight;
-    if( client_size.y % m_lineHeight < m_lineHeight/2 )
-        row -= 1;
+    unsigned int row = ((client_size.y)/m_lineHeight) - 1;
 
     return wxMin( GetRowCount()-1, row );
 }