int GetEndOfLastCol();
size_t GetFirstVisibleRow();
size_t GetLastVisibleRow();
- int GetRowCount();
+ size_t GetRowCount();
void SelectAllRows( bool on );
void SelectRow( size_t row, bool on );
return wxMin( GetRowCount()-1, (client_size.y/m_lineHeight)+1 );
}
-int wxDataViewMainWindow::GetRowCount()
+size_t wxDataViewMainWindow::GetRowCount()
{
return GetOwner()->GetModel()->GetNumberOfRows();
}
void wxDataViewMainWindow::SelectAllRows( bool on )
{
- if (GetRowCount() == 0) return;
+ if (IsEmpty())
+ return;
if (on)
{
m_selection.Clear();
- size_t i;
- for (i = 0; i < GetRowCount(); i++)
+ for (size_t i = 0; i < GetRowCount(); i++)
m_selection.Add( i );
Refresh();
}
void wxDataViewMainWindow::RefreshRowsAfter( size_t firstRow )
{
size_t count = GetRowCount();
- if (firstRow > count) return;
+ if (firstRow > count)
+ return;
wxRect rect( 0, firstRow*m_lineHeight, GetEndOfLastCol(), count * m_lineHeight );
m_owner->CalcScrolledPosition( rect.x, rect.y, &rect.x, &rect.y );
void wxDataViewMainWindow::OnArrowChar(size_t newCurrent, const wxKeyEvent& event)
{
- wxCHECK_RET( newCurrent < (size_t)GetRowCount(),
+ wxCHECK_RET( newCurrent < GetRowCount(),
_T("invalid item index in OnArrowChar()") );
// if there is no selection, we cannot move it anywhere
break;
case WXK_DOWN:
- if ( m_currentRow < (size_t)GetRowCount() - 1 )
+ if ( m_currentRow < GetRowCount() - 1 )
OnArrowChar( m_currentRow + 1, event );
break;