From 5ff906768649dc9be2977afb699948b5b15826f1 Mon Sep 17 00:00:00 2001 From: Jaakko Salli Date: Mon, 14 Dec 2009 15:33:50 +0000 Subject: [PATCH] Determine better whether the property editor needs to be refreshed in wxPGProperty::SetValue() git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/propgrid/property.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 774d37b580..4b4b316734 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -1366,16 +1366,23 @@ void wxPGProperty::SetValue( wxVariant value, wxVariant* pList, int flags ) UpdateParentValues(); // - // Update editor control - // - - // We need to check for these, otherwise GetGrid() may fail. + // Update editor control. if ( flags & wxPG_SETVAL_REFRESH_EDITOR ) { - RefreshEditor(); wxPropertyGrid* pg = GetGridIfDisplayed(); if ( pg ) + { + wxPGProperty* selected = pg->GetSelectedProperty(); + + // Only refresh the control if this was selected, or + // this was some parent of selected, or vice versa) + if ( selected && (selected == this || + selected->IsSomeParent(this) || + this->IsSomeParent(selected)) ) + RefreshEditor(); + pg->DrawItemAndValueRelated(this); + } } } -- 2.45.2