wxDataViewListModel::~wxDataViewListModel()
{
- wxList::compatibility_iterator node = m_notifiers.GetFirst();
- while (node)
- {
- wxDataViewListModelNotifier* notifier = (wxDataViewListModelNotifier*) node->GetData();
- notifier->Freed();
- node = node->GetNext();
- }
}
bool wxDataViewListModel::RowAppended()
public:
wxDataViewSortedListModelNotifier( wxDataViewSortedListModel *model )
{ m_model = model; }
+
+ ~wxDataViewSortedListModelNotifier()
+ { m_model->DetachChild(); }
virtual bool RowAppended()
{ return m_model->ChildRowAppended(); }
virtual bool Cleared()
{ return m_model->ChildCleared(); }
- virtual bool Freed()
- { m_model->m_child = NULL; return wxDataViewListModelNotifier::Freed(); }
-
wxDataViewSortedListModel *m_model;
};
wxDataViewSortedListModel::~wxDataViewSortedListModel()
{
if (m_child)
- m_child->RemoveNotifier( m_notifierOnChild );
+ m_child->RemoveNotifier( m_notifierOnChild );
+}
+
+void wxDataViewSortedListModel::DetachChild()
+{
+ m_child = NULL;
}
// FIXME
m_child->GetValue( variant, col, child_row );
}
-bool wxDataViewSortedListModel::SetValue( wxVariant &variant, unsigned int col, unsigned int row )
+bool wxDataViewSortedListModel::SetValue( const wxVariant &variant, unsigned int col, unsigned int row )
{
unsigned int child_row = m_array[row];
bool ret = m_child->SetValue( variant, col, child_row );
void wxDataViewRendererBase::CancelEditing()
{
- // m_editorCtrl->PopEventHandler( true );
-
- delete m_editorCtrl;
+ wxPendingDelete.Append( m_editorCtrl );
GetOwner()->GetOwner()->GetMainWindow()->SetFocus();
+
+ // m_editorCtrl->PopEventHandler( true );
}
bool wxDataViewRendererBase::FinishEditing()
{
- // m_editorCtrl->PopEventHandler( true );
-
wxVariant value;
GetValueFromEditorCtrl( m_editorCtrl, value );
- delete m_editorCtrl;
+ wxPendingDelete.Append( m_editorCtrl );
GetOwner()->GetOwner()->GetMainWindow()->SetFocus();
GetOwner()->GetOwner()->GetModel()->SetValue( value, col, m_row );
GetOwner()->GetOwner()->GetModel()->ValueChanged( col, m_row );
+ // m_editorCtrl->PopEventHandler( true );
+
return true;
}
m_owner->FinishEditing();
}
- // We must let the native text control handle focus
event.Skip();
}