gboolean wxDataViewCtrlInternal::get_iter( GtkTreeIter *iter, GtkTreePath *path )
{
+
if (m_wx_model->IsVirtualListModel())
{
- wxDataViewIndexListModel *wx_model = (wxDataViewIndexListModel*) m_wx_model;
-
+ wxDataViewVirtualListModel *wx_model = (wxDataViewVirtualListModel*) m_wx_model;
+
unsigned int i = (unsigned int)gtk_tree_path_get_indices (path)[0];
-
- if (i >= wx_model->GetLastIndex() + 1)
+
+ if (i >= wx_model->GetCount())
return FALSE;
iter->stamp = m_gtk_model->stamp;
{
if (m_wx_model->IsVirtualListModel())
{
- wxDataViewIndexListModel *wx_model = (wxDataViewIndexListModel*) m_wx_model;
+ wxDataViewVirtualListModel *wx_model = (wxDataViewVirtualListModel*) m_wx_model;
// user_data is just the index +1
int n = ( (wxUIntPtr) iter->user_data ) -1;
if (n == -1)
return FALSE;
- if (n >= (int) wx_model->GetLastIndex())
+ if (n >= (int) wx_model->GetCount())
return FALSE;
// user_data is just the index +1 (+2 because we need the next)
return FALSE;
iter->stamp = m_gtk_model->stamp;
- iter->user_data = (gpointer) 0;
+ iter->user_data = (gpointer) 1;
return TRUE;
}
{
if (m_wx_model->IsVirtualListModel())
{
+ wxDataViewVirtualListModel *wx_model = (wxDataViewVirtualListModel*) m_wx_model;
+
+ if (iter == NULL)
+ return (gint) wx_model->GetCount();
+
// this is a list, nodes have no children
return FALSE;
}
{
if (m_wx_model->IsVirtualListModel())
{
- wxDataViewIndexListModel *wx_model = (wxDataViewIndexListModel*) m_wx_model;
+ wxDataViewVirtualListModel *wx_model = (wxDataViewVirtualListModel*) m_wx_model;
if (iter == NULL)
- return (gint) wx_model->GetLastIndex() + 1;
+ return (gint) wx_model->GetCount();
return 0;
}
{
if (m_wx_model->IsVirtualListModel())
{
- wxDataViewIndexListModel *wx_model = (wxDataViewIndexListModel*) m_wx_model;
+ wxDataViewVirtualListModel *wx_model = (wxDataViewVirtualListModel*) m_wx_model;
if (parent)
return FALSE;
if (n < 0)
return FALSE;
- if (n >= (gint) wx_model->GetLastIndex() + 1)
+ if (n >= (gint) wx_model->GetCount())
return FALSE;
iter->stamp = m_gtk_model->stamp;
// user_data is just the index +1
- iter->user_data = (gpointer) (n-1);
+ iter->user_data = (gpointer) (n+1);
return TRUE;
}