// wxDataViewModel
// ---------------------------------------------------------
+#include <wx/listimpl.cpp>
+WX_DEFINE_LIST(wxDataViewModelNotifiers);
+
wxDataViewModel::wxDataViewModel()
{
m_notifiers.DeleteContents( true );
{
bool ret = true;
- wxList::compatibility_iterator node = m_notifiers.GetFirst();
- while (node)
+ wxDataViewModelNotifiers::iterator iter;
+ for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
{
- wxDataViewModelNotifier* notifier = (wxDataViewModelNotifier*) node->GetData();
+ wxDataViewModelNotifier* notifier = *iter;
if (!notifier->ItemAdded( parent, item ))
ret = false;
- node = node->GetNext();
}
return ret;
}
-bool wxDataViewModel::ItemDeleted( const wxDataViewItem &item )
+bool wxDataViewModel::ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item )
{
bool ret = true;
- wxList::compatibility_iterator node = m_notifiers.GetFirst();
- while (node)
+ wxDataViewModelNotifiers::iterator iter;
+ for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
{
- wxDataViewModelNotifier* notifier = (wxDataViewModelNotifier*) node->GetData();
- if (!notifier->ItemDeleted( item ))
+ wxDataViewModelNotifier* notifier = *iter;
+ if (!notifier->ItemDeleted( parent, item ))
ret = false;
- node = node->GetNext();
}
return ret;
{
bool ret = true;
- wxList::compatibility_iterator node = m_notifiers.GetFirst();
- while (node)
+ wxDataViewModelNotifiers::iterator iter;
+ for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
{
- wxDataViewModelNotifier* notifier = (wxDataViewModelNotifier*) node->GetData();
+ wxDataViewModelNotifier* notifier = *iter;
if (!notifier->ItemChanged( item ))
ret = false;
- node = node->GetNext();
}
return ret;
{
bool ret = true;
- wxList::compatibility_iterator node = m_notifiers.GetFirst();
- while (node)
+ wxDataViewModelNotifiers::iterator iter;
+ for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
{
- wxDataViewModelNotifier* notifier = (wxDataViewModelNotifier*) node->GetData();
+ wxDataViewModelNotifier* notifier = *iter;
if (!notifier->ValueChanged( item, col ))
ret = false;
- node = node->GetNext();
}
return ret;
{
bool ret = true;
- wxList::compatibility_iterator node = m_notifiers.GetFirst();
- while (node)
+ wxDataViewModelNotifiers::iterator iter;
+ for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
{
- wxDataViewModelNotifier* notifier = (wxDataViewModelNotifier*) node->GetData();
+ wxDataViewModelNotifier* notifier = *iter;
if (!notifier->Cleared())
ret = false;
- node = node->GetNext();
}
return ret;
void wxDataViewModel::Resort()
{
- wxList::compatibility_iterator node = m_notifiers.GetFirst();
- while (node)
+ wxDataViewModelNotifiers::iterator iter;
+ for (iter = m_notifiers.begin(); iter != m_notifiers.end(); ++iter)
{
- wxDataViewModelNotifier* notifier = (wxDataViewModelNotifier*) node->GetData();
+ wxDataViewModelNotifier* notifier = *iter;
notifier->Resort();
- node = node->GetNext();
}
}
void wxDataViewModel::AddNotifier( wxDataViewModelNotifier *notifier )
{
- m_notifiers.Append( notifier );
+ m_notifiers.push_back( notifier );
notifier->SetOwner( this );
}
{
wxDataViewItem item( m_hash[row] );
m_hash.RemoveAt( row );
- wxDataViewModel::ItemDeleted( item );
+ wxDataViewModel::ItemDeleted( wxDataViewItem(0), item );
}
void wxDataViewIndexListModel::RowChanged( unsigned int row )