class WXDLLIMPEXP_ADV wxDataViewItem
{
public:
- wxDataViewItem( void* id = NULL )
- { m_id = id; }
- wxDataViewItem( const wxDataViewItem &item )
- { m_id = item.m_id; }
+ wxDataViewItem() : m_id(NULL) {}
+ wxDataViewItem(const wxDataViewItem &item) : m_id(item.m_id) {}
+
+ wxEXPLICIT wxDataViewItem(void* id) : m_id(id) {}
+
bool IsOk() const { return m_id != NULL; }
void* GetID() const { return m_id; }
operator const void* () const { return m_id; }
// build initial index
unsigned int i;
for (i = 1; i < initial_size+1; i++)
- m_hash.Add( wxUIntToPtr(i) );
+ m_hash.Add( wxDataViewItem(wxUIntToPtr(i)) );
m_nextFreeID = initial_size + 1;
}
// build initial index
unsigned int i;
for (i = 1; i < new_size+1; i++)
- m_hash.Add( wxUIntToPtr(i) );
+ m_hash.Add( wxDataViewItem(wxUIntToPtr(i)) );
m_nextFreeID = new_size + 1;
unsigned int id = m_nextFreeID;
m_nextFreeID++;
- m_hash.Insert( wxUIntToPtr(id), 0 );
wxDataViewItem item( wxUIntToPtr(id) );
+ m_hash.Insert( item, 0 );
ItemAdded( wxDataViewItem(0), item );
}
unsigned int id = m_nextFreeID;
m_nextFreeID++;
- m_hash.Insert( wxUIntToPtr(id), before );
wxDataViewItem item( wxUIntToPtr(id) );
+ m_hash.Insert( item, before );
ItemAdded( wxDataViewItem(0), item );
}
unsigned int id = m_nextFreeID;
m_nextFreeID++;
- m_hash.Add( wxUIntToPtr(id) );
wxDataViewItem item( wxUIntToPtr(id) );
+ m_hash.Add( item );
ItemAdded( wxDataViewItem(0), item );
}
return wxPtrToUInt(item.GetID())-1;
// assert for not found
- return (unsigned int) m_hash.Index( item.GetID() );
+ return (unsigned int) m_hash.Index( item );
}
wxDataViewItem wxDataViewIndexListModel::GetItem( unsigned int row ) const
wxDataViewTreeStoreNodeList::compatibility_iterator node = parent_node->GetChildren().Item( pos );
if (node)
- return node->GetData();
+ return wxDataViewItem(node->GetData());
return wxDataViewItem(0);
}
void wxDataViewTreeStore::DeleteAllItems()
{
- DeleteChildren(m_root);
+ DeleteChildren(wxDataViewItem(m_root));
}
void
int LINKAGEMODE wxGenericTreeModelItemCmp( void ** id1, void ** id2)
{
- return g_model->Compare( *id1, *id2, g_column, g_asending );
+ return g_model->Compare( wxDataViewItem(*id1), wxDataViewItem(*id2), g_column, g_asending );
}
if( node->GetNodes().GetCount() == 0)
{
int index = static_cast<int>(row) - current - 1;
- ret = node->GetChildren().Item( index );
+ ret = wxDataViewItem(node->GetChildren().Item( index ));
return DoJob::OK;
}
return DoJob::CONT;
static
int LINKAGEMODE wxGtkTreeModelChildCmp( void** id1, void** id2 )
{
- int ret = gs_internal->GetDataViewModel()->Compare( *id1, *id2,
+ int ret = gs_internal->GetDataViewModel()->Compare( wxDataViewItem(*id1), wxDataViewItem(*id2),
gs_internal->GetSortColumn(), (gs_internal->GetSortOrder() == GTK_SORT_ASCENDING) );
return ret;
static
int LINKAGEMODE wxGtkTreeModelChildPtrCmp( void*** data1, void*** data2 )
{
- return gs_internal->GetDataViewModel()->Compare( **data1, **data2,
+ return gs_internal->GetDataViewModel()->Compare( wxDataViewItem(**data1), wxDataViewItem(**data2),
gs_internal->GetSortColumn(), (gs_internal->GetSortOrder() == GTK_SORT_ASCENDING) );
}