// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#ifdef __BORLANDC__
+ #pragma hdrstop
+#endif
+
#if wxUSE_DATAVIEWCTRL
#include "wx/dataview.h"
#ifndef WX_PRECOMP
#include "wx/sizer.h"
#include "wx/log.h"
+ #include "wx/dcclient.h"
+ #include "wx/timer.h"
+ #include "wx/settings.h"
#endif
#include "wx/stockitem.h"
-#include "wx/dcclient.h"
#include "wx/calctrl.h"
#include "wx/popupwin.h"
#include "wx/renderer.h"
-#include "wx/timer.h"
-#include "wx/settings.h"
#ifdef __WXMSW__
#include "wx/msw/wrapwin.h"
int GetEndOfLastCol();
size_t GetFirstVisibleRow();
size_t GetLastVisibleRow();
- int GetRowCount();
+ size_t GetRowCount();
void SelectAllRows( bool on );
void SelectRow( size_t row, bool on );
wxSize client_size = GetClientSize();
m_owner->CalcUnscrolledPosition( client_size.x, client_size.y, &client_size.x, &client_size.y );
- return wxMin( GetRowCount()-1, (client_size.y/m_lineHeight)+1 );
+ return wxMin( GetRowCount()-1, ((unsigned)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;