From 2a536c359cf9475ebda7c37647f50a49f4b0c2ae Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 12 Mar 2021 21:41:40 +0100 Subject: [PATCH] Fix visual state of enabled/disabled wxPropertyGrid wxPropertyGrid needs to be refreshed while enabling/disabling to display proper visual states of all wxPGProperty items. --- include/wx/propgrid/propgrid.h | 1 + src/propgrid/propgrid.cpp | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/include/wx/propgrid/propgrid.h b/include/wx/propgrid/propgrid.h index 6f2bff9894..1e8ccc94aa 100644 --- a/include/wx/propgrid/propgrid.h +++ b/include/wx/propgrid/propgrid.h @@ -1457,6 +1457,7 @@ protected: virtual void DoThaw() wxOVERRIDE; virtual wxSize DoGetBestSize() const wxOVERRIDE; + virtual void DoEnable(bool enable) wxOVERRIDE; #ifndef wxPG_ICON_WIDTH wxBitmap *m_expandbmp, *m_collbmp; diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp index fc515e5a0f..0b2dc71a8d 100644 --- a/src/propgrid/propgrid.cpp +++ b/src/propgrid/propgrid.cpp @@ -1185,6 +1185,12 @@ wxSize wxPropertyGrid::DoGetBestSize() const return wxSize(width, lineHeight*numLines + 40); } +void wxPropertyGrid::DoEnable(bool enable) +{ + wxControl::DoEnable(enable); + Refresh(false); +} + // ----------------------------------------------------------------------- void wxPropertyGrid::OnTLPChanging( wxWindow* newTLP )