Add wxDataViewCtrl::SetHeaderAttr() too

This is currently only implemented in the generic version but could be
implemented at least for GTK+ native one as well in the future.
This commit is contained in:
Vadim Zeitlin
2016-04-22 00:58:38 +02:00
parent 5388c7a72e
commit bed7d9fe74
6 changed files with 67 additions and 1 deletions

View File

@@ -41,6 +41,7 @@
#include "wx/renderer.h"
#include "wx/dcbuffer.h"
#include "wx/icon.h"
#include "wx/itemattr.h"
#include "wx/list.h"
#include "wx/listimpl.cpp"
#include "wx/imaglist.h"
@@ -5202,6 +5203,24 @@ bool wxDataViewCtrl::IsSelected( const wxDataViewItem & item ) const
return false;
}
bool wxDataViewCtrl::SetHeaderAttr(const wxItemAttr& attr)
{
if ( !m_headerArea )
return false;
// Call all functions unconditionally to reset the previously set
// attributes, if any.
m_headerArea->SetForegroundColour(attr.GetTextColour());
m_headerArea->SetBackgroundColour(attr.GetBackgroundColour());
m_headerArea->SetFont(attr.GetFont());
// If the font has changed, the size of the header might need to be
// updated.
Layout();
return true;
}
void wxDataViewCtrl::SetAlternateRowColour(const wxColour& colour)
{
m_alternateRowColour = colour;