Change EnsureVisble() to including column parameter, implemented it for wxGTK

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48206 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2007-08-19 21:44:34 +00:00
parent 6798451bb2
commit 6154212e51
5 changed files with 11 additions and 5 deletions

View File

@@ -484,7 +484,8 @@ public:
virtual void SelectAll() = 0; virtual void SelectAll() = 0;
virtual void UnselectAll() = 0; virtual void UnselectAll() = 0;
virtual void EnsureVisible( const wxDataViewItem & item ) = 0; virtual void EnsureVisible( const wxDataViewItem & item,
wxDataViewColumn *column = NULL ) = 0;
protected: protected:
virtual void DoSetExpanderColumn() = 0 ; virtual void DoSetExpanderColumn() = 0 ;

View File

@@ -371,7 +371,7 @@ public:
virtual void UnselectAll(); virtual void UnselectAll();
virtual void EnsureVisible( int row ); 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 wxDataViewItem GetItemByRow( unsigned int row ) const;
virtual int GetRowByItem( const wxDataViewItem & item ) const; virtual int GetRowByItem( const wxDataViewItem & item ) const;

View File

@@ -315,7 +315,7 @@ public:
virtual void SelectAll(); virtual void SelectAll();
virtual void UnselectAll(); virtual void UnselectAll();
virtual void EnsureVisible( const wxDataViewItem & item ); virtual void EnsureVisible( const wxDataViewItem & item, wxDataViewColumn *column = NULL );
static wxVisualAttributes static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL); GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);

View File

@@ -3622,7 +3622,7 @@ void wxDataViewCtrl::EnsureVisible( int row )
m_clientArea->ScrollTo( 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); int row = m_clientArea->GetRowByItem(item);
if( row >= 0 ) if( row >= 0 )

View File

@@ -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() void wxDataViewCtrl::DoSetExpanderColumn()