diff --git a/include/wx/dataview.h b/include/wx/dataview.h index d7811f9513..6a8ede95ba 100644 --- a/include/wx/dataview.h +++ b/include/wx/dataview.h @@ -484,7 +484,8 @@ public: virtual void SelectAll() = 0; virtual void UnselectAll() = 0; - virtual void EnsureVisible( const wxDataViewItem & item ) = 0; + virtual void EnsureVisible( const wxDataViewItem & item, + wxDataViewColumn *column = NULL ) = 0; protected: virtual void DoSetExpanderColumn() = 0 ; diff --git a/include/wx/generic/dataview.h b/include/wx/generic/dataview.h index 6d28f1c6c0..083d4b1cfb 100644 --- a/include/wx/generic/dataview.h +++ b/include/wx/generic/dataview.h @@ -371,7 +371,7 @@ public: virtual void UnselectAll(); virtual void EnsureVisible( int row ); - virtual void EnsureVisible( const wxDataViewItem & item ); + virtual void EnsureVisible( const wxDataViewItem & item, wxDataViewColumn *column = NULL ); virtual wxDataViewItem GetItemByRow( unsigned int row ) const; virtual int GetRowByItem( const wxDataViewItem & item ) const; diff --git a/include/wx/gtk/dataview.h b/include/wx/gtk/dataview.h index 82b5e001a7..d98ec0fb10 100644 --- a/include/wx/gtk/dataview.h +++ b/include/wx/gtk/dataview.h @@ -315,7 +315,7 @@ public: virtual void SelectAll(); virtual void UnselectAll(); - virtual void EnsureVisible( const wxDataViewItem & item ); + virtual void EnsureVisible( const wxDataViewItem & item, wxDataViewColumn *column = NULL ); static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 2fb1c5b35a..0f609572ed 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -3622,7 +3622,7 @@ void wxDataViewCtrl::EnsureVisible( int row ) m_clientArea->ScrollTo( row ); } -void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item ) +void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item, wxDataViewColumn *column ) { int row = m_clientArea->GetRowByItem(item); if( row >= 0 ) diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index dd8038be46..a56518a0b9 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -3033,8 +3033,13 @@ void wxDataViewCtrl::UnselectAll() { } -void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item ) +void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item, wxDataViewColumn *column ) { + GtkTreeIter iter; + iter.user_data = (gpointer) item.GetID(); + GtkTreePath *path = m_internal->get_path( &iter ); + gtk_tree_view_scroll_to_cell( GTK_TREE_VIEW(m_treeview), path, NULL, false, 0.0, 0.0 ); + gtk_tree_path_free( path ); } void wxDataViewCtrl::DoSetExpanderColumn()