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

@@ -247,6 +247,12 @@ private:
wxRect(wxPoint(x2, y), sizeCheck), m_flags);
y += lineHeight + sizeCheck.y;
dc.DrawText("DrawCheckMark()", x1, y);
const wxSize sizeMark = renderer.GetCheckMarkSize(this);
renderer.DrawCheckMark(this, dc,
wxRect(wxPoint(x2, y), sizeMark), m_flags);
y += lineHeight + sizeMark.y;
dc.DrawText("DrawRadioBitmap()", x1, y);
renderer.DrawRadioBitmap(this, dc,
wxRect(wxPoint(x2, y), sizeCheck), m_flags);
@@ -259,9 +265,10 @@ private:
y += lineHeight + sizeCollapse.y;
dc.DrawText("DrawTreeItemButton()", x1, y);
const wxSize sizeExpand = renderer.GetExpanderSize(this);
renderer.DrawTreeItemButton(this, dc,
wxRect(x2, y, 20, 20), m_flags);
y += lineHeight + 20;
wxRect(wxPoint(x2, y), sizeExpand), m_flags);
y += lineHeight + sizeExpand.y;
#ifdef wxHAS_DRAW_TITLE_BAR_BITMAP
dc.DrawText("DrawTitleBarBitmap()", x1, y);