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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user