From 7e3d28e79f1391b965330efb43a0f290b83f3a4a Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 4 Feb 2018 22:31:23 +0100 Subject: [PATCH] Rename wxDataViewEvent::SetEditCanceled() and remove its argument This method should be only used when the edit is really cancelled, so it doesn't need to take a boolean argument. It should also use the same spelling as IsEditCancelled() (and for consistency with the rest of wxWidgets API which uses British English). Also remove this method from the documentation, it is not part of the public API. --- include/wx/dataview.h | 2 +- interface/wx/dataview.h | 1 - src/common/datavcmn.cpp | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/wx/dataview.h b/include/wx/dataview.h index 79b200cc09..58b0fdafe4 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -859,7 +859,6 @@ public: // for wxEVT_DATAVIEW_ITEM_EDITING_DONE only bool IsEditCancelled() const { return m_editCancelled; } - void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; } // for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only wxDataViewColumn *GetDataViewColumn() const { return m_column; } @@ -907,6 +906,7 @@ public: #endif // WXWIN_COMPATIBILITY_3_0 void SetColumn( int col ) { m_col = col; } + void SetEditCancelled() { m_editCancelled = true; } protected: wxDataViewItem m_item; diff --git a/interface/wx/dataview.h b/interface/wx/dataview.h index cbb5ba2566..81c493efa4 100644 --- a/interface/wx/dataview.h +++ b/interface/wx/dataview.h @@ -3818,7 +3818,6 @@ public: */ wxDataViewItem GetItem() const; void SetItem( const wxDataViewItem &item ); - void SetEditCanceled(bool editCancelled); void SetPosition( int x, int y ); void SetCache(int from, int to); wxDataObject *GetDataObject() const; diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp index df7ad9cd1f..a7d7597fff 100644 --- a/src/common/datavcmn.cpp +++ b/src/common/datavcmn.cpp @@ -798,7 +798,8 @@ bool wxDataViewRendererBase::FinishEditing() // Now we should send Editing Done event wxDataViewEvent event(wxEVT_DATAVIEW_ITEM_EDITING_DONE, dv_ctrl, column, m_item); event.SetValue( value ); - event.SetEditCanceled( !isValid ); + if ( !isValid ) + event.SetEditCancelled(); dv_ctrl->GetEventHandler()->ProcessEvent( event ); bool accepted = false;