X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fbda518cb73c410f88838b8f9df3e525720106a6..01a9232b5e06fc1e24cbd051661d37a46827379d:/src/common/datavcmn.cpp diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index daf8f220c8..b82a73f598 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -332,6 +332,21 @@ wxDataViewItem wxDataViewIndexListModel::GetNextSibling( const wxDataViewItem &i return wxDataViewItem( m_hash[pos+1] ); } +//----------------------------------------------------------------------------- +// wxDataViewIconText +//----------------------------------------------------------------------------- + +IMPLEMENT_DYNAMIC_CLASS(wxDataViewIconText,wxObject) + +IMPLEMENT_VARIANT_OBJECT(wxDataViewIconText) + +bool operator == (const wxDataViewIconText &one, const wxDataViewIconText &two) +{ + if (one.GetText() != two.GetText()) return false; + if (one.IsSameAs(two)) return false; + return true; +} + // --------------------------------------------------------- // wxDataViewRendererBase // --------------------------------------------------------- @@ -372,6 +387,13 @@ bool wxDataViewRendererBase::StartEditing( const wxDataViewItem &item, wxRect la 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; } @@ -401,6 +423,13 @@ bool wxDataViewRendererBase::FinishEditing() 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; } @@ -539,18 +568,12 @@ IMPLEMENT_ABSTRACT_CLASS(wxDataViewCtrlBase, wxControl) 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(); @@ -694,34 +717,10 @@ wxDataViewCtrlBase::AppendBitmapColumn( const wxBitmap &label, unsigned int mode 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 ) const -{ - if( pos >= m_cols.GetCount() ) - return NULL; - - return (wxDataViewColumn*) m_cols[ pos ]; -} - // --------------------------------------------------------- // wxDataViewEvent // --------------------------------------------------------- @@ -735,6 +734,9 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING) 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) @@ -746,3 +748,4 @@ DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_VALUE_CHANGED) DEFINE_EVENT_TYPE(wxEVT_COMMAND_DATAVIEW_MODEL_CLEARED) #endif +