From 49fc3b9c03107c3f3b79432ddb1c4bd58c8a9fc3 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 17 Oct 2007 09:21:04 +0000 Subject: [PATCH] Correct EnsureVisible() to show last item entirely git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dataview.h | 2 +- src/generic/datavgen.cpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/include/wx/dataview.h b/include/wx/dataview.h index ff88b73783..4af433f8f3 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -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 diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index f9a90df680..dfc95dbb3f 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -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 ); }