Correct EnsureVisible() to show last item entirely

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49195 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2007-10-17 09:21:04 +00:00
parent e2da67f6d7
commit 49fc3b9c03
2 changed files with 2 additions and 5 deletions

View 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

View 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 );
}