Add wxDataViewCtrl::SetRowHeight() and provide its generic implementation.

Allow changing the (fixed) row height without using wxDV_VARIABLE_LINE_HEIGHT
which may slow down the control display too much.

The new method is not implemented for the native GTK and OS X implementations
yet but should be simple to implement there.

See #12749.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67885 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-06-07 22:49:56 +00:00
parent 208f99c3e3
commit bbfd454841
4 changed files with 33 additions and 1 deletions

View File

@@ -532,6 +532,8 @@ public:
int GetLineHeight( unsigned int row ) const; // m_lineHeight in fixed mode
int GetLineAt( unsigned int y ) const; // y / m_lineHeight in fixed mode
void SetRowHeight( int lineHeight ) { m_lineHeight = lineHeight; }
// Some useful functions for row and item mapping
wxDataViewItem GetItemByRow( unsigned int row ) const;
int GetRowByItem( const wxDataViewItem & item ) const;
@@ -4124,6 +4126,16 @@ unsigned int wxDataViewCtrl::GetColumnCount() const
return m_cols.GetCount();
}
bool wxDataViewCtrl::SetRowHeight( int lineHeight )
{
if ( !m_clientArea )
return false;
m_clientArea->SetRowHeight(lineHeight);
return true;
}
wxDataViewColumn* wxDataViewCtrl::GetColumn( unsigned int idx ) const
{
return m_cols[idx];