Add possibility to set item background in generic wxDataViewCtrl.

Added wxDataViewItemAttr::SetBackgroundColour() and code to honour it in the
generic implementation of wxDataViewCtrl.

Closes #12621.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@70050 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2011-12-19 12:54:38 +00:00
parent 02106526ea
commit 1c959a62ce
6 changed files with 63 additions and 2 deletions

View File

@@ -822,6 +822,18 @@ bool wxDataViewCustomRendererBase::ActivateCell(const wxRect& cell,
return Activate(cell, model, item, col);
}
void wxDataViewCustomRendererBase::RenderBackground(wxDC* dc, const wxRect& rect)
{
if ( !m_attr.HasBackgroundColour() )
return;
const wxColour& colour = m_attr.GetBackgroundColour();
wxDCPenChanger changePen(*dc, colour);
wxDCBrushChanger changeBrush(*dc, colour);
dc->DrawRectangle(rect);
}
void
wxDataViewCustomRendererBase::WXCallRender(wxRect rectCell, wxDC *dc, int state)
{