From 6d3fd35d0ccdbafb08e2578bb8a8d41780b4d216 Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sat, 4 Apr 2015 10:16:00 +0200 Subject: [PATCH] Check if wxPGProperty is visible when it is attempted to refresh it. Check if property page state (not its parent state) is the same as selected page state before refreshing. Closes #16922. --- src/propgrid/manager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/propgrid/manager.cpp b/src/propgrid/manager.cpp index 019530e1c7..44bff1a1a2 100644 --- a/src/propgrid/manager.cpp +++ b/src/propgrid/manager.cpp @@ -1433,10 +1433,14 @@ void wxPropertyGridManager::Refresh(bool eraseBackground, const wxRect* rect ) void wxPropertyGridManager::RefreshProperty( wxPGProperty* p ) { - wxPropertyGrid* grid = p->GetGrid(); + wxASSERT( p->IsRoot() || + p->GetParentState() == p->GetParent()->GetParentState() ); - if ( GetPage(m_selPage)->GetStatePtr() == p->GetParent()->GetParentState() ) + if ( GetPage(m_selPage)->GetStatePtr() == p->GetParentState() ) + { + wxPropertyGrid* grid = p->GetGrid(); grid->RefreshProperty(p); + } } // -----------------------------------------------------------------------