From 65589e8c68201e1e0bdb973f568acf4aaa1f6ffa Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 3 Feb 2018 17:59:50 +0100 Subject: [PATCH] Remove unneeded wxRendererNative::GetDefault() in render sample This method is used to illustrate the difference between the default and the overridden GetHeaderButton() implementations, but doesn't need to be used for any other methods, that are not overridden in MyRenderer. No real changes, but just make the code shorter and less confusing. --- samples/render/render.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/samples/render/render.cpp b/samples/render/render.cpp index d626b301de..e1f68fe077 100644 --- a/samples/render/render.cpp +++ b/samples/render/render.cpp @@ -223,6 +223,8 @@ private: wxART_LIST); } + // Note that we need to use GetDefault() explicitly to show the default + // implementation. dc.DrawText("DrawHeaderButton() (default)", x1, y); wxRendererNative::GetDefault().DrawHeaderButton(this, dc, wxRect(x2, y, widthHdr, heightHdr), m_flags, @@ -282,7 +284,7 @@ private: const wxCoord widthGauge = 180; dc.DrawText("DrawGauge()", x1, y); - wxRendererNative::GetDefault().DrawGauge(this, dc, + renderer.DrawGauge(this, dc, wxRect(x2, y, widthGauge, heightGauge), 25, 100, m_flags); y += lineHeight + heightGauge; @@ -291,10 +293,10 @@ private: const wxCoord widthListItem = 260; dc.DrawText("DrawItemSelectionRect()", x1, y); - wxRendererNative::GetDefault().DrawItemSelectionRect(this, dc, + renderer.DrawItemSelectionRect(this, dc, wxRect(x2, y, widthListItem, heightListItem), m_flags | wxCONTROL_SELECTED); - wxRendererNative::GetDefault().DrawItemText(this, dc, "DrawItemText()", + renderer.DrawItemText(this, dc, "DrawItemText()", wxRect(x2, y, widthListItem, heightListItem).Inflate(-2, -2), m_align, m_flags | wxCONTROL_SELECTED); y += lineHeight + heightListItem;