X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5900bb7c5f0c3c52585e8112d3dc8a5948f3fc6a..2ec335db7806c058a02d022d2f75b4144ce69d2a:/src/propgrid/property.cpp diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 774d37b580..1e9f6100bd 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -264,6 +264,10 @@ void wxPGDefaultRenderer::Render( wxDC& dc, const wxRect& rect, { text = vInlineHelp.GetString(); dc.SetTextForeground(propertyGrid->GetCellDisabledTextColour()); + + // Must make the editor NULL to override it's own rendering + // code. + editor = NULL; } } } @@ -924,8 +928,10 @@ wxString wxPGProperty::GetValueAsString( int argFlags ) const } #endif + wxPropertyGrid* pg = GetGrid(); + if ( IsValueUnspecified() ) - return wxEmptyString; + return pg->GetUnspecifiedValueText(argFlags); if ( m_commonValue == -1 ) { @@ -935,7 +941,6 @@ wxString wxPGProperty::GetValueAsString( int argFlags ) const // // Return common value's string representation - wxPropertyGrid* pg = GetGrid(); const wxPGCommonValue* cv = pg->GetCommonValue(m_commonValue); if ( argFlags & wxPG_FULL_VALUE ) @@ -1366,16 +1371,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); + } } }