Add wxRenderer::DrawCheckButton for use inside

wxDataViewCtrl.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38794 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling
2006-04-18 16:14:12 +00:00
parent f6630099a7
commit 862d8041ab
4 changed files with 116 additions and 14 deletions

View File

@@ -78,6 +78,11 @@ public:
const wxRect& rect,
int flags = 0);
virtual void DrawCheckButton(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags = 0);
virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win);
virtual wxRendererVersion GetVersion() const
@@ -395,6 +400,30 @@ wxRendererGeneric::DrawDropArrow(wxWindow *win,
dc.DrawPolygon(WXSIZEOF(pt), pt, rect.x, rect.y);
}
void
wxRendererGeneric::DrawCheckButton(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags)
{
if (flags & wxCONTROL_DISABLED)
dc.SetPen( *wxGREY_PEN );
else
dc.SetPen( *wxBLACK_PEN );
dc.SetBrush( *wxTRANSPARENT_BRUSH );
wxRect my_rect = rect;
dc.DrawRectangle( my_rect );
if (flags & wxCONTROL_CHECKED)
{
my_rect.x += 2;
my_rect.y += 2;
my_rect.width -= 4;
my_rect.height -= 4;
dc.DrawLine( my_rect.x, my_rect.y, my_rect.x+my_rect.width, my_rect.y+my_rect.height );
dc.DrawLine( my_rect.x+my_rect.width, my_rect.y, my_rect.x, my_rect.y+my_rect.height );
}
}
// ----------------------------------------------------------------------------
// A module to allow cleanup of generic renderer.
// ----------------------------------------------------------------------------