Add DrawCheckMark and GetCheckMarkSize to wxRendererNative

Show its use in the render sample. Also use the recently added GetExpanderSize
for the size of DrawTreeItemButton.
This commit is contained in:
Maarten Bent
2019-08-08 00:52:06 +02:00
parent 97320c312e
commit 2874dab7f0
5 changed files with 152 additions and 3 deletions

View File

@@ -250,9 +250,20 @@ public:
const wxRect& rect,
int flags = 0) = 0;
// draw check mark
//
// flags may use wxCONTROL_DISABLED
virtual void DrawCheckMark(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags = 0) = 0;
// Returns the default size of a check box.
virtual wxSize GetCheckBoxSize(wxWindow *win) = 0;
// Returns the default size of a check mark.
virtual wxSize GetCheckMarkSize(wxWindow *win) = 0;
// Returns the default size of a expander.
virtual wxSize GetExpanderSize(wxWindow *win) = 0;
@@ -479,10 +490,19 @@ public:
int flags = 0) wxOVERRIDE
{ m_rendererNative.DrawCheckBox( win, dc, rect, flags ); }
virtual void DrawCheckMark(wxWindow *win,
wxDC& dc,
const wxRect& rect,
int flags = 0) wxOVERRIDE
{ m_rendererNative.DrawCheckMark( win, dc, rect, flags ); }
virtual wxSize GetCheckBoxSize(wxWindow *win) wxOVERRIDE
{ return m_rendererNative.GetCheckBoxSize(win); }
virtual wxSize GetExpanderSize(wxWindow *win) wxOVERRIDE
virtual wxSize GetCheckMarkSize(wxWindow *win) wxOVERRIDE
{ return m_rendererNative.GetCheckMarkSize(win); }
virtual wxSize GetExpanderSize(wxWindow *win) wxOVERRIDE
{ return m_rendererNative.GetExpanderSize(win); }
virtual void DrawPushButton(wxWindow *win,