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
This commit is contained in:
Jaakko Salli 2009-12-14 15:33:50 +00:00
parent b5aaf62e97
commit 5ff9067686

View 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);
}
}
}