Make generic wxDataViewCtrl EnsureVisible() overload non-virtual

There doesn't seem to be any reason for this method to be virtual other than
preventing "virtual function hiding" warnings from gcc, so just rename it to
have a different name than the virtual EnsureVisible() inherited from the base
class instead.
This commit is contained in:
Vadim Zeitlin
2016-03-05 18:40:06 +01:00
parent b70109ee7a
commit 062444ee50
2 changed files with 8 additions and 8 deletions

View File

@@ -245,7 +245,7 @@ public:
void SetAlternateRowColour(const wxColour& colour); void SetAlternateRowColour(const wxColour& colour);
protected: protected:
virtual void EnsureVisible( int row, int column ); void EnsureVisibleRowCol( int row, int column );
// Notice that row here may be invalid (i.e. >= GetRowCount()), this is not // Notice that row here may be invalid (i.e. >= GetRowCount()), this is not
// an error and this function simply returns an invalid item in this case. // an error and this function simply returns an invalid item in this case.

View File

@@ -3884,7 +3884,7 @@ void wxDataViewMainWindow::OnVerticalNavigation(const wxKeyEvent& event, int del
RefreshRow( m_currentRow ); RefreshRow( m_currentRow );
} }
GetOwner()->EnsureVisible( m_currentRow, -1 ); GetOwner()->EnsureVisibleRowCol( m_currentRow, -1 );
} }
void wxDataViewMainWindow::OnLeftKey(wxKeyEvent& event) void wxDataViewMainWindow::OnLeftKey(wxKeyEvent& event)
@@ -3932,7 +3932,7 @@ void wxDataViewMainWindow::OnLeftKey(wxKeyEvent& event)
SelectRow( row, false); SelectRow( row, false);
SelectRow( parent, true ); SelectRow( parent, true );
ChangeCurrentRow( parent ); ChangeCurrentRow( parent );
GetOwner()->EnsureVisible( parent, -1 ); GetOwner()->EnsureVisibleRowCol( parent, -1 );
SendSelectionChangedEvent( parent_node->GetItem() ); SendSelectionChangedEvent( parent_node->GetItem() );
} }
} }
@@ -3965,7 +3965,7 @@ void wxDataViewMainWindow::OnRightKey(wxKeyEvent& event)
SelectRow( row, false ); SelectRow( row, false );
SelectRow( row + 1, true ); SelectRow( row + 1, true );
ChangeCurrentRow( row + 1 ); ChangeCurrentRow( row + 1 );
GetOwner()->EnsureVisible( row + 1, -1 ); GetOwner()->EnsureVisibleRowCol( row + 1, -1 );
SendSelectionChangedEvent( GetItemByRow(row+1) ); SendSelectionChangedEvent( GetItemByRow(row+1) );
} }
} }
@@ -4046,7 +4046,7 @@ bool wxDataViewMainWindow::TryAdvanceCurrentColumn(wxDataViewTreeNode *node, wxK
} }
} }
GetOwner()->EnsureVisible(m_currentRow, idx); GetOwner()->EnsureVisibleRowCol(m_currentRow, idx);
if ( idx < 1 ) if ( idx < 1 )
{ {
@@ -5266,7 +5266,7 @@ void wxDataViewCtrl::UnselectAll()
m_clientArea->UnselectAllRows(); m_clientArea->UnselectAllRows();
} }
void wxDataViewCtrl::EnsureVisible( int row, int column ) void wxDataViewCtrl::EnsureVisibleRowCol( int row, int column )
{ {
if( row < 0 ) if( row < 0 )
row = 0; row = 0;
@@ -5293,9 +5293,9 @@ void wxDataViewCtrl::EnsureVisible( const wxDataViewItem & item, const wxDataVie
if( row >= 0 ) if( row >= 0 )
{ {
if( column == NULL ) if( column == NULL )
EnsureVisible(row, -1); EnsureVisibleRowCol(row, -1);
else else
EnsureVisible( row, GetColumnIndex(column) ); EnsureVisibleRowCol( row, GetColumnIndex(column) );
} }
} }