unsigned int i;
for (i = 1; i < new_size+1; i++)
m_hash.Add( wxUIntToPtr(i) );
-
+
m_nextFreeID = new_size + 1;
wxDataViewModel::Cleared();
unsigned int id = m_nextFreeID;
m_nextFreeID++;
-
+
m_hash.Insert( wxUIntToPtr(id), 0 );
wxDataViewItem item( wxUIntToPtr(id) );
ItemAdded( wxDataViewItem(0), item );
-
+
}
void wxDataViewIndexListModel::RowInserted( unsigned int before )
unsigned int id = m_nextFreeID;
m_nextFreeID++;
-
+
m_hash.Insert( wxUIntToPtr(id), before );
wxDataViewItem item( wxUIntToPtr(id) );
ItemAdded( wxDataViewItem(0), item );
{
unsigned int id = m_nextFreeID;
m_nextFreeID++;
-
+
m_hash.Add( wxUIntToPtr(id) );
wxDataViewItem item( wxUIntToPtr(id) );
ItemAdded( wxDataViewItem(0), item );
void wxDataViewVirtualListModel::RowDeleted( unsigned int row )
{
+ m_size--;
wxDataViewItem item( wxUIntToPtr(row+1) );
wxDataViewModel::ItemDeleted( wxDataViewItem(0), item );
- m_size--;
}
void wxDataViewVirtualListModel::RowsDeleted( const wxArrayInt &rows )
{
+ m_size -= rows.GetCount();
+
wxArrayInt sorted = rows;
sorted.Sort( my_sort );
array.Add( item );
}
wxDataViewModel::ItemsDeleted( wxDataViewItem(0), array );
-
- m_size -= rows.GetCount();
}
void wxDataViewVirtualListModel::RowChanged( unsigned int row )
m_editorCtrl = CreateEditorCtrl( dv_ctrl->GetMainWindow(), labelRect, value );
- // there might be no editor control for the given item
+ // there might be no editor control for the given item
if(!m_editorCtrl)
return false;
RowPrepended();
}
-void wxDataViewListStore::InsertItem( unsigned int row, const wxVector<wxVariant> &values,
+void wxDataViewListStore::InsertItem( unsigned int row, const wxVector<wxVariant> &values,
wxClientData *data )
{
wxDataViewListStoreLine *line = new wxDataViewListStoreLine( data );
return AppendColumn( col, "string" );
}
-wxDataViewColumn *wxDataViewListCtrl::AppendTextColumn( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendTextColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("string") );
return ret;
}
-wxDataViewColumn *wxDataViewListCtrl::AppendToggleColumn( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendToggleColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("bool") );
return ret;
}
-wxDataViewColumn *wxDataViewListCtrl::AppendProgressColumn( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendProgressColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("long") );
return ret;
}
-wxDataViewColumn *wxDataViewListCtrl::AppendIconTextColumn( const wxString &label,
+wxDataViewColumn *wxDataViewListCtrl::AppendIconTextColumn( const wxString &label,
wxDataViewCellMode mode, int width, wxAlignment align, int flags )
{
GetStore()->AppendColumn( wxT("wxDataViewIconText") );
void wxDataViewTreeStore::DeleteAllItems()
{
- // TODO
+ DeleteChildren(m_root);
}
void
}
void wxDataViewTreeCtrl::SetItemText( const wxDataViewItem& item, const wxString &text )
-{
+{
GetStore()->SetItemText(item,text);
// notify control
}
void wxDataViewTreeCtrl::SetItemIcon( const wxDataViewItem& item, const wxIcon &icon )
-{
+{
GetStore()->SetItemIcon(item,icon);
// notify control
}
void wxDataViewTreeCtrl::SetItemExpandedIcon( const wxDataViewItem& item, const wxIcon &icon )
-{
+{
GetStore()->SetItemExpandedIcon(item,icon);
// notify control
}
void wxDataViewTreeCtrl::DeleteItem( const wxDataViewItem& item )
-{
+{
wxDataViewItem parent_item = GetStore()->GetParent( item );
GetStore()->DeleteItem(item);
}
void wxDataViewTreeCtrl::DeleteChildren( const wxDataViewItem& item )
-{
+{
wxDataViewTreeStoreContainerNode *node = GetStore()->FindContainerNode( item );
if (!node) return;
}
void wxDataViewTreeCtrl::DeleteAllItems()
-{
+{
GetStore()->DeleteAllItems();
GetStore()->Cleared();