ItemDeleted now has (parent, item)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47719 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2007-07-25 18:18:51 +00:00
parent d47db7e06a
commit 469d3e9b7b
4 changed files with 13 additions and 14 deletions

View File

@ -111,7 +111,7 @@ public:
// delegated notifiers
virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item );
virtual bool ItemDeleted( const wxDataViewItem &item );
virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item );
virtual bool ItemChanged( const wxDataViewItem &item );
virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col );
virtual bool Cleared();
@ -204,7 +204,7 @@ public:
virtual ~wxDataViewModelNotifier() { m_owner = NULL; }
virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
virtual bool ItemDeleted( const wxDataViewItem &item ) = 0;
virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
virtual bool ItemChanged( const wxDataViewItem &item ) = 0;
virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ) = 0;
virtual bool Cleared() = 0;

View File

@ -577,7 +577,7 @@ void MyFrame::OnDeleteMusic(wxCommandEvent& WXUNUSED(event) )
{
wxDataViewItem item = m_musicCtrl->GetSelection();
if (item.IsOk())
m_music_model->Delete( item );
m_music_model->Delete( m_music_model->GetParent(item), item );
}
void MyFrame::OnPrependList( wxCommandEvent& WXUNUSED(event) )
@ -589,7 +589,7 @@ void MyFrame::OnDeleteList( wxCommandEvent& WXUNUSED(event) )
{
wxDataViewItem item = m_listCtrl->GetSelection();
if (item.IsOk())
m_list_model->DeleteItem( item );
m_list_model->DeleteItem( m_list_model->GetParent(item), item );
}
void MyFrame::OnItemAdded( wxDataViewEvent &event )

View File

@ -59,7 +59,7 @@ bool wxDataViewModel::ItemAdded( const wxDataViewItem &parent, const wxDataViewI
return ret;
}
bool wxDataViewModel::ItemDeleted( const wxDataViewItem &item )
bool wxDataViewModel::ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item )
{
bool ret = true;
@ -67,7 +67,7 @@ bool wxDataViewModel::ItemDeleted( const wxDataViewItem &item )
while (node)
{
wxDataViewModelNotifier* notifier = (wxDataViewModelNotifier*) node->GetData();
if (!notifier->ItemDeleted( item ))
if (!notifier->ItemDeleted( parent, item ))
ret = false;
node = node->GetNext();
}
@ -250,7 +250,7 @@ void wxDataViewIndexListModel::RowDeleted( unsigned int row )
{
wxDataViewItem item( m_hash[row] );
m_hash.RemoveAt( row );
wxDataViewModel::ItemDeleted( item );
wxDataViewModel::ItemDeleted( wxDataViewItem(0), item );
}
void wxDataViewIndexListModel::RowChanged( unsigned int row )

View File

@ -79,7 +79,7 @@ public:
GtkWxTreeModel* GetGtkModel() { return m_gtk_model; }
bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item );
bool ItemDeleted( const wxDataViewItem &item );
bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item );
bool ItemChanged( const wxDataViewItem &item );
bool ValueChanged( const wxDataViewItem &item, unsigned int col );
bool Cleared();
@ -1022,7 +1022,7 @@ public:
~wxGtkDataViewModelNotifier();
virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item );
virtual bool ItemDeleted( const wxDataViewItem &item );
virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item );
virtual bool ItemChanged( const wxDataViewItem &item );
virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col );
virtual bool Cleared();
@ -1069,7 +1069,7 @@ bool wxGtkDataViewModelNotifier::ItemAdded( const wxDataViewItem &parent, const
return true;
}
bool wxGtkDataViewModelNotifier::ItemDeleted( const wxDataViewItem &item )
bool wxGtkDataViewModelNotifier::ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item )
{
GtkTreeIter iter;
iter.stamp = m_wxgtk_model->stamp;
@ -1081,7 +1081,7 @@ bool wxGtkDataViewModelNotifier::ItemDeleted( const wxDataViewItem &item )
GTK_TREE_MODEL(m_wxgtk_model), path );
gtk_tree_path_free (path);
m_owner->GtkGetInternal()->ItemDeleted( item );
m_owner->GtkGetInternal()->ItemDeleted( parent, item );
return true;
}
@ -2296,9 +2296,9 @@ bool wxDataViewCtrlInternal::ItemAdded( const wxDataViewItem &parent, const wxDa
return true;
}
bool wxDataViewCtrlInternal::ItemDeleted( const wxDataViewItem &item )
bool wxDataViewCtrlInternal::ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item )
{
wxGtkTreeModelNode *parent = FindParentNode( item );
wxGtkTreeModelNode *parent = FindNode( parent );
parent->DeleteChild( item.GetID() );
wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_MODEL_ITEM_DELETED, m_owner->GetId() );
@ -2753,7 +2753,6 @@ void gtk_dataviewctrl_size_callback( GtkWidget *WXUNUSED(widget),
GtkAllocation *alloc,
wxDataViewCtrl *win )
{
wxWindowList::compatibility_iterator node = win->GetChildren().GetFirst();
while (node)
{