From 7dc1ab1c76e4545e73711529b845ce2f7dfc7ec3 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Mon, 1 Dec 2014 22:47:48 +0000 Subject: [PATCH] Use wxCONTROL_FOCUSED control state flag when drawing native wxPG check box in the "modified state" under wxOSX. Generally, wxCONTROL_PRESSED control flag is used when drawing native check box (wxPGEditor_CheckBox) in "modified state" but under wxOSX this flag is equivalent to wxCONTROL_CHECKED flag and hence it is necessary to indicate this state in an alternative way. Closes #16696 git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78212 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/editors.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index d9f23d2459..30093a2789 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1426,7 +1426,14 @@ static void DrawSimpleCheckBox( wxWindow* win, wxDC& dc, const wxRect& rect, if ( state & wxSCB_STATE_BOLD ) { + // wxCONTROL_CHECKED and wxCONTROL_PRESSED flags + // are equivalent for wxOSX so we have to use + // other flag to indicate "selected state". +#ifdef __WXOSX__ + cbFlags |= wxCONTROL_FOCUSED; +#else cbFlags |= wxCONTROL_PRESSED; +#endif } wxRendererNative::Get().DrawCheckBox(win, dc, r, cbFlags);