Add wxRendererNative::DrawGauge() method.

Add the method with the native implementations for MSW and OS X and a generic
version fallback.

Closes #16406.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77023 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-08-08 01:03:31 +00:00
parent 7e6515e1ad
commit 86cf756ba9
8 changed files with 187 additions and 14 deletions

View File

@@ -1211,20 +1211,12 @@ bool wxDataViewProgressRenderer::GetValue( wxVariant &value ) const
bool
wxDataViewProgressRenderer::Render(wxRect rect, wxDC *dc, int WXUNUSED(state))
{
// deflate the rect to leave a small border between bars in adjacent rows
wxRect bar = rect.Deflate(0, 1);
dc->SetBrush( *wxTRANSPARENT_BRUSH );
dc->SetPen( *wxBLACK_PEN );
dc->DrawRectangle( bar );
bar.width = (int)(bar.width * m_value / 100.);
dc->SetPen( *wxTRANSPARENT_PEN );
const wxDataViewItemAttr& attr = GetAttr();
dc->SetBrush( attr.HasColour() ? wxBrush(attr.GetColour())
: *wxBLUE_BRUSH );
dc->DrawRectangle( bar );
wxRendererNative::Get().DrawGauge(
GetOwner()->GetOwner(),
*dc,
rect,
m_value,
100);
return true;
}