From 590547b87e0aed8159d3b406f71fb04a7e9e4c94 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Thu, 23 Jan 2020 19:40:02 +0100 Subject: [PATCH] Directly check value of wxPG_USE_RENDERER_NATIVE macro We can check wxPG_USE_RENDERER_NATIVE macro value directly and hence there is no need to introduce and check a helper macro wxPG_USE_NATIVE_FOCUS_RECT_RENDERER. --- src/propgrid/property.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index f8d90385cc..101ee980ba 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -48,20 +48,14 @@ const char* g_invalidStringContent = "@__TOTALLY_INVALID_STRING__@"; // ----------------------------------------------------------------------- -// In 3.0 comaptibilty mode we always need to use custom renderer because -// native renderer for this port requires a reference to the valid window -// to be drawn which is not passed to DrawCaptionSelectionRect function. -#if wxPG_USE_RENDERER_NATIVE && !WXWIN_COMPATIBILITY_3_0 - #define wxPG_USE_NATIVE_FOCUS_RECT_RENDERER 1 -#else - #define wxPG_USE_NATIVE_FOCUS_RECT_RENDERER 0 -#endif // wxPG_USE_RENDERER_NATIVE/!wxPG_USE_RENDERER_NATIVE - static void wxPGDrawFocusRect(wxWindow *win, wxDC& dc, int x, int y, int w, int h) { wxRect rect(x, y+((h-dc.GetCharHeight())/2), w, h); -#if wxPG_USE_NATIVE_FOCUS_RECT_RENDERER + // In 3.0 comaptibilty mode we always need to use custom renderer because + // native renderer for this port requires a reference to the valid window + // to be drawn which is not passed to DrawCaptionSelectionRect function. +#if wxPG_USE_RENDERER_NATIVE && !WXWIN_COMPATIBILITY_3_0 wxASSERT_MSG( win, wxS("Invalid window to be drawn") ); wxRendererNative::Get().DrawFocusRect(win, dc, rect); #else @@ -70,7 +64,7 @@ static void wxPGDrawFocusRect(wxWindow *win, wxDC& dc, dc.SetPen(wxPen(*wxBLACK,1,wxPENSTYLE_DOT)); dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(rect); -#endif // wxPG_USE_NATIVE_FOCUS_RECT_RENDERER/!wxPG_USE_NATIVE_FOCUS_RECT_RENDERER +#endif // wxPG_USE_RENDERER_NATIVE/!wxPG_USE_RENDERER_NATIVE } // -----------------------------------------------------------------------