X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b7bc9d806b57f20e1d3135025ba0e6f603e7450e..5e9238f9c641b597bca67931ecb5896d7d835135:/src/propgrid/property.cpp diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index 10ba288e65..1897d12761 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -149,8 +149,10 @@ int wxPGCellRenderer::PreDrawCell( wxDC& dc, const wxRect& rect, const wxPGCell& dc.SetTextForeground(cell.GetFgCol()); } - // Draw Background - dc.DrawRectangle(rect); + // Draw Background, but only if not rendering in control + // (as control already has rendered correct background). + if ( !(flags & (Control|ChoicePopup)) ) + dc.DrawRectangle(rect); const wxBitmap& bmp = cell.GetBitmap(); if ( bmp.Ok() && @@ -637,10 +639,10 @@ int wxPGProperty::Index( const wxPGProperty* p ) const return wxNOT_FOUND; } -void wxPGProperty::UpdateControl( wxWindow* primary ) +void wxPGProperty::UpdateControl( wxWindow* editorWnd ) { - if ( primary ) - GetEditorClass()->UpdateControl(this, primary); + if ( editorWnd ) + GetEditorClass()->UpdateControl(this, editorWnd); } bool wxPGProperty::ValidateValue( wxVariant& WXUNUSED(value), wxPGValidationInfo& WXUNUSED(validationInfo) ) const @@ -1334,18 +1336,13 @@ void wxPGProperty::SetFlagRecursively( FlagType flag, bool set ) void wxPGProperty::RefreshEditor() { - if ( m_parent && GetParentState() ) - { - wxPropertyGrid* pg = GetParentState()->GetGrid(); - if ( pg->GetSelectedProperty() == this ) - { - wxWindow* editor = pg->GetEditorControl(); - if ( editor ) - GetEditorClass()->UpdateControl( this, editor ); - } - } -} + if ( !m_parent ) + return; + wxPropertyGrid* pg = GetGrid(); + if ( pg && pg->GetSelectedProperty() == this ) + UpdateControl(pg->GetEditorControl()); +} wxVariant wxPGProperty::GetDefaultValue() const { @@ -2274,6 +2271,17 @@ void wxPGProperty::Empty() m_children.clear(); } +void wxPGProperty::DeleteChildren() +{ + wxPropertyGridPageState* state = m_parentState; + + while ( GetChildCount() ) + { + wxPGProperty* child = Item(GetChildCount()-1); + state->DoDelete(child, true); + } +} + void wxPGProperty::ChildChanged( wxVariant& WXUNUSED(thisValue), int WXUNUSED(childIndex), wxVariant& WXUNUSED(childValue) ) const