From 47bba8764ac07b88e9cbe79cc67e8f968a648689 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 9 Mar 2019 14:17:07 +0100 Subject: [PATCH] Fix drawing invalid wxPGProperty Invalid wxPGProperty needs to be redrawn after setting wxPG_FL_CELL_OVERRIDES_SEL because this flag is used to select proper colors to mark property as invalid. This order of operations is important under e.g. wxMSW when redrawing with DrawItemAndChildren() is done immediately. Closes #18351. --- src/propgrid/propgrid.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index 72b88c0fce..01b8759733 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -3271,8 +3271,6 @@ bool wxPropertyGrid::DoOnValidationFailure( wxPGProperty* property, wxVariant& W cell.SetBgCol(vfbBg); } - DrawItemAndChildren(property); - if ( property == GetSelection() ) { SetInternalFlag(wxPG_FL_CELL_OVERRIDES_SEL); @@ -3284,6 +3282,8 @@ bool wxPropertyGrid::DoOnValidationFailure( wxPGProperty* property, wxVariant& W editor->SetBackgroundColour(vfbBg); } } + + DrawItemAndChildren(property); } if ( vfb & (wxPG_VFB_SHOW_MESSAGE |