From: Václav Slavík Date: Mon, 8 Aug 2011 10:11:04 +0000 (+0000) Subject: Remove selection methods taking int from generic wxDataViewCtrl. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/04675edfb19c0895d4a719431f79e11ef62ffb1d Remove selection methods taking int from generic wxDataViewCtrl. Current public API uses wxDataViewItem, this code dated back to 2.8. They were now protected instead of public, the code wasn't used anywhere and wasn't portable, it existed only in the generic version. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68597 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index f56f2a5ffc..6e728635de 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -190,14 +190,6 @@ public: virtual void StartEditor( const wxDataViewItem & item, unsigned int column ); protected: - virtual int GetSelections( wxArrayInt & sel ) const; - virtual void SetSelections( const wxArrayInt & sel ); - virtual void Select( int row ); - virtual void Unselect( int row ); - virtual bool IsSelected( int row ) const; - virtual void SelectRange( int from, int to ); - virtual void UnselectRange( int from, int to ); - virtual void EnsureVisible( int row, int column ); virtual wxDataViewItem GetItemByRow( unsigned int row ) const; diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 34ae5bc84e..76c7344fea 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -4498,73 +4498,6 @@ bool wxDataViewCtrl::IsSelected( const wxDataViewItem & item ) const return false; } -// Selection code with row number as parameter -int wxDataViewCtrl::GetSelections( wxArrayInt & sel ) const -{ - sel.Empty(); - wxDataViewSelection selection = m_clientArea->GetSelections(); - int len = selection.GetCount(); - for( int i = 0; i < len; i ++) - { - unsigned int row = selection[i]; - sel.Add( row ); - } - return len; -} - -void wxDataViewCtrl::SetSelections( const wxArrayInt & sel ) -{ - wxDataViewSelection selection(wxDataViewSelectionCmp); - int len = sel.GetCount(); - for( int i = 0; i < len; i ++ ) - { - int row = sel[i]; - if( row >= 0 ) - selection.Add( static_cast(row) ); - } - m_clientArea->SetSelections( selection ); -} - -void wxDataViewCtrl::Select( int row ) -{ - if( row >= 0 ) - { - if (m_clientArea->IsSingleSel()) - m_clientArea->SelectAllRows(false); - m_clientArea->SelectRow( row, true ); - } -} - -void wxDataViewCtrl::Unselect( int row ) -{ - if( row >= 0 ) - m_clientArea->SelectRow(row, false); -} - -bool wxDataViewCtrl::IsSelected( int row ) const -{ - if( row >= 0 ) - return m_clientArea->IsRowSelected(row); - return false; -} - -void wxDataViewCtrl::SelectRange( int from, int to ) -{ - wxArrayInt sel; - for( int i = from; i < to; i ++ ) - sel.Add( i ); - m_clientArea->Select(sel); -} - -void wxDataViewCtrl::UnselectRange( int from, int to ) -{ - wxDataViewSelection sel = m_clientArea->GetSelections(); - for( int i = from; i < to; i ++ ) - if( sel.Index( i ) != wxNOT_FOUND ) - sel.Remove( i ); - m_clientArea->SetSelections(sel); -} - void wxDataViewCtrl::SelectAll() { m_clientArea->SelectAllRows(true);