wxDataViewItem wxDataViewIndexListModel::GetItem( unsigned int row ) const
{
+ wxASSERT( row < m_hash.GetCount() );
return wxDataViewItem( m_hash[row] );
}
m_editorCtrl->SetFocus();
#endif
+ // Now we should send Editing Started event
+ wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED, GetOwner()->GetOwner()->GetId() );
+ event.SetDataViewColumn( GetOwner() );
+ event.SetModel( GetOwner()->GetOwner()->GetModel() );
+ event.SetItem( item );
+ GetOwner()->GetOwner()->GetEventHandler()->ProcessEvent( event );
+
return true;
}
GetOwner()->GetOwner()->GetModel()->ValueChanged( m_item, col );
// m_editorCtrl->PopEventHandler( true );
+
+ // Now we should send Editing Done event
+ wxDataViewEvent event( wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE, GetOwner()->GetOwner()->GetId() );
+ event.SetDataViewColumn( GetOwner() );
+ event.SetModel( GetOwner()->GetOwner()->GetModel() );
+ event.SetItem( m_item );
+ GetOwner()->GetOwner()->GetEventHandler()->ProcessEvent( event );
return true;
}
wxDataViewCtrlBase::wxDataViewCtrlBase()
{
m_model = NULL;
- m_cols.DeleteContents( true );
m_expander_column = 0;
m_indent = 8;
}
wxDataViewCtrlBase::~wxDataViewCtrlBase()
{
- // IMPORTANT: before calling DecRef() on our model (since it may
- // result in a free() call), erase all columns (since
- // they hold a pointer to our model)
- m_cols.Clear();
-
if (m_model)
{
m_model->DecRef();
bool
wxDataViewCtrlBase::AppendColumn( wxDataViewColumn *col )
{
- m_cols.Append( (wxObject*) col );
col->SetOwner( (wxDataViewCtrl*) this );
return true;
}
-unsigned int wxDataViewCtrlBase::GetColumnCount() const
-{
- return m_cols.GetCount();
-}
-
-bool wxDataViewCtrlBase::DeleteColumn( unsigned int WXUNUSED(pos) )
-{
- return false;
-}
-
-bool wxDataViewCtrlBase::ClearColumns()
-{
- return false;
-}
-
-wxDataViewColumn* wxDataViewCtrlBase::GetColumn( unsigned int pos )
-{
- if( pos >= m_cols.GetCount() )
- return NULL;
-
- return (wxDataViewColumn*) m_cols[ pos ];
-}
-
// ---------------------------------------------------------
// wxDataViewEvent
// ---------------------------------------------------------
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED)
+DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE)
+
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED)
DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_CLEARED)
#endif
+