From df9d094d71d546f90c0c2cfa61935120dae267c5 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Wed, 16 Feb 2011 23:19:32 +0000 Subject: [PATCH] Applied #11389: dataview GetValueByRow, SetValueByRow git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@66925 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/dataview.h | 32 +++++++++++++++++++++++++------- version-script.in | 6 ++++++ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/include/wx/dataview.h b/include/wx/dataview.h index d209d6dac0..e0b679a462 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -120,6 +120,24 @@ public: // set value, call ValueChanged() afterwards! virtual bool SetValue( wxVariant &variant, unsigned int col, unsigned int row ) = 0; +#if wxABI_VERSION >= 20812 + // Notes: + // - In wx 2.9 GetValue/SetValue are removed, replaced with GetValueByRow and SetValueByRow + // - GetValueByRow/SetValueByRow has (row,col) parameters, GetValue/SetValue is vice versa, (col,row) + + // virtual in wx 2.9 + void GetValueByRow(wxVariant& variant, unsigned row, unsigned col) const + { + const_cast(this)->GetValue(variant, col, row); + } + + // virtual in wx 2.9 + bool SetValueByRow(const wxVariant& variant, unsigned row, unsigned col) + { + return SetValue((wxVariant&)variant, col, row); + } +#endif // wx >= 2.8.12 + // delegated notifiers virtual bool RowAppended(); virtual bool RowPrepended(); @@ -198,7 +216,7 @@ private: wxDataViewListModel *m_child; wxDataViewSortedIndexArray m_array; wxDataViewListModelNotifier *m_notifierOnChild; - + void InitStatics(); // BAD protected: @@ -273,9 +291,9 @@ public: virtual void SetBitmap( const wxBitmap &bitmap ); virtual const wxBitmap &GetBitmap(); - + virtual void SetAlignment( wxAlignment align ) = 0; - + virtual void SetSortable( bool sortable ) = 0; virtual bool GetSortable() = 0; virtual void SetSortOrder( bool ascending ) = 0; @@ -320,11 +338,11 @@ public: wxDataViewListModel* GetModel(); // short cuts - bool AppendTextColumn( const wxString &label, unsigned int model_column, + bool AppendTextColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1 ); bool AppendToggleColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = 30 ); - bool AppendProgressColumn( const wxString &label, unsigned int model_column, + bool AppendProgressColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = 80 ); bool AppendDateColumn( const wxString &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1 ); @@ -340,7 +358,7 @@ public: wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1 ); bool AppendBitmapColumn( const wxBitmap &label, unsigned int model_column, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1 ); - + virtual bool AppendColumn( wxDataViewColumn *col ); virtual unsigned int GetNumberOfColumns(); virtual bool DeleteColumn( unsigned int pos ); @@ -352,7 +370,7 @@ public: virtual void Unselect( unsigned int row ) = 0; virtual void SetSelectionRange( unsigned int from, unsigned int to ) = 0; virtual void SetSelections( const wxArrayInt& aSelections) = 0; - + virtual bool IsSelected( unsigned int row ) const = 0; virtual int GetSelection() const = 0; virtual int GetSelections(wxArrayInt& aSelections) const = 0; diff --git a/version-script.in b/version-script.in index 4b162b6bdd..2ce4eb3c75 100644 --- a/version-script.in +++ b/version-script.in @@ -23,6 +23,12 @@ # released with the generic branch version due to the final wildcard below, # and once released its version cannot be changed. +# public symbols added in 2.8.12 (please keep in alphabetical order): +@WX_VERSION_TAG@.12 { + *wxDataViewListModel*GetValueByRow*; + *wxDataViewListModel*SetValueByRow*; +}; + # public symbols added in 2.8.11 (please keep in alphabetical order): # # NB: Convert{From,To}IeeeExtended() were not really added but they were not