]> git.saurik.com Git - wxWidgets.git/commitdiff
Determine better whether the property editor needs to be refreshed in wxPGProperty...
authorJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 14 Dec 2009 15:33:50 +0000 (15:33 +0000)
committerJaakko Salli <jaakko.salli@dnainternet.net>
Mon, 14 Dec 2009 15:33:50 +0000 (15:33 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62884 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/propgrid/property.cpp

index 774d37b5807b646b20f05d9e9d7c3d8a6238e691..4b4b31673493d43267be01d55d462c364c397737 100644 (file)
@@ -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);
+        }
     }
 }