diff --git a/interface/wx/propgrid/property.h b/interface/wx/propgrid/property.h index 8dfb65ec18..6de57de2c7 100644 --- a/interface/wx/propgrid/property.h +++ b/interface/wx/propgrid/property.h @@ -1664,6 +1664,10 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + Unlike wxPropertyGridInterface::SetPropertyBackgroundColour(), + this does not automatically update the display. */ void SetBackgroundColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -1753,8 +1757,11 @@ public: /** Sets property's label. - @remarks Properties under same parent may have same labels. However, - property names must still remain unique. + @remarks + - Properties under same parent may have same labels. However, + property names must still remain unique. + - Unlike wxPropertyGridInterface::SetPropertyLabel(), + this does not automatically update the display. */ void SetLabel( const wxString& label ); @@ -1796,6 +1803,10 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + Unlike wxPropertyGridInterface::SetPropertyTextColour(), + this does not automatically update the display. */ void SetTextColour( const wxColour& colour, int flags = wxPG_RECURSE ); @@ -1807,6 +1818,10 @@ public: Default is wxPG_RECURSE which causes colours to be set recursively. Omit this flag to only set colours for the property in question and not any of its children. + + @remarks + Unlike wxPropertyGridInterface::SetPropertyColoursToDefault(), + this does not automatically update the display. */ void SetDefaultColours(int flags = wxPG_RECURSE); diff --git a/interface/wx/propgrid/propgridiface.h b/interface/wx/propgrid/propgridiface.h index b5931ea2d7..855d8ae2a8 100644 --- a/interface/wx/propgrid/propgridiface.h +++ b/interface/wx/propgrid/propgridiface.h @@ -156,6 +156,9 @@ public: /** Disables a property. + @remarks + Property is refreshed with new settings. + @see EnableProperty(), wxPGProperty::Enable() */ bool DisableProperty( wxPGPropArg id ); @@ -176,6 +179,9 @@ public: @param enable If @false, property is disabled instead. + @remarks + Property is refreshed with new settings. + @see wxPGProperty::Enable() */ bool EnableProperty( wxPGPropArg id, bool enable = true ); @@ -603,6 +609,9 @@ public: /** Disables (limit = @true) or enables (limit = @false) wxTextCtrl editor of a property, if it is not the sole mean to edit the value. + + @remarks + Property is refreshed with new settings. */ void LimitPropertyEditing( wxPGPropArg id, bool limit = true ); @@ -768,8 +777,10 @@ public: Optional. Use wxPG_RECURSE to set the attribute to child properties recursively. - @remarks Setting attribute's value to wxNullVariant will simply remove it - from property's set of attributes. + @remarks + - Setting attribute's value to wxNullVariant will simply remove it + from property's set of attributes. + - Property is refreshed with new settings. */ void SetPropertyAttribute( wxPGPropArg id, const wxString& attrName, wxVariant value, long argFlags = 0 ); @@ -778,11 +789,14 @@ public: Sets property attribute for all applicapple properties. Be sure to use this method only after all properties have been added to the grid. + + @remarks + Properties are refreshed with new settings. */ void SetPropertyAttributeAll( const wxString& attrName, wxVariant value ); /** - Sets background colour of a property. + Sets background colour of given property. @param id Property name or pointer. @@ -794,6 +808,10 @@ public: Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + - If category is tried to set recursively, only its children are affected. + - Property is redrawn with new colour. */ void SetPropertyBackgroundColour( wxPGPropArg id, const wxColour& colour, @@ -823,12 +841,17 @@ public: /** Resets text and background colours of given property. + @param id Property name or pointer. @param flags Default is wxPG_DONT_RECURSE which causes colour to be reset only for the property in question (for backward compatibility). + + @remarks + - If category is tried to set recursively, only its children are affected. + - Property is redrawn with new colours. */ void SetPropertyColoursToDefault(wxPGPropArg id, int flags = wxPG_DONT_RECURSE); @@ -887,8 +910,10 @@ public: By default changes are applied recursively. Set this parameter to wxPG_DONT_RECURSE to prevent this. - @remarks This is mainly for use with textctrl editor. Only some other - editors fully support it. + @remarks + - This is mainly for use with textctrl editor. Only some other + editors fully support it. + - Property is refreshed with new settings. */ void SetPropertyReadOnly( wxPGPropArg id, bool set = true, int flags = wxPG_RECURSE ); @@ -936,18 +961,22 @@ public: /** - Sets text colour of a property. + Sets text colour of given property. @param id Property name or pointer. @param colour - New background colour. + New text colour. @param flags Default is wxPG_RECURSE which causes colour to be set recursively. Omit this flag to only set colour for the property in question and not any of its children. + + @remarks + - If category is tried to set recursively, only its children are affected. + - Property is redrawn with new colour. */ void SetPropertyTextColour( wxPGPropArg id, const wxColour& colour, diff --git a/src/propgrid/propgridiface.cpp b/src/propgrid/propgridiface.cpp index 9394649a84..85e8f95c2a 100644 --- a/src/propgrid/propgridiface.cpp +++ b/src/propgrid/propgridiface.cpp @@ -669,7 +669,16 @@ wxPropertyGridInterface::SetPropertyBackgroundColour( wxPGPropArg id, { wxPG_PROP_ARG_CALL_PROLOG() p->SetBackgroundColour(colour, flags); - RefreshProperty(p); + + // Redraw the control + wxPropertyGrid* pg = m_pState->GetGrid(); + if ( pg == p->GetGrid() ) + { + if ( flags & wxPG_RECURSE ) + pg->DrawItemAndChildren(p); + else + pg->DrawItem(p); + } } // ----------------------------------------------------------------------- @@ -680,7 +689,16 @@ void wxPropertyGridInterface::SetPropertyTextColour( wxPGPropArg id, { wxPG_PROP_ARG_CALL_PROLOG() p->SetTextColour(colour, flags); - RefreshProperty(p); + + // Redraw the control + wxPropertyGrid* pg = m_pState->GetGrid(); + if ( pg == p->GetGrid() ) + { + if ( flags & wxPG_RECURSE ) + pg->DrawItemAndChildren(p); + else + pg->DrawItem(p); + } } // ----------------------------------------------------------------------- @@ -695,8 +713,17 @@ void wxPropertyGridInterface::SetPropertyColoursToDefault(wxPGPropArg id) void wxPropertyGridInterface::SetPropertyColoursToDefault(wxPGPropArg id, int flags) { wxPG_PROP_ARG_CALL_PROLOG() - p->SetDefaultColours(flags); + + // Redraw the control + wxPropertyGrid* pg = m_pState->GetGrid(); + if ( pg == p->GetGrid() ) + { + if ( flags & wxPG_RECURSE ) + pg->DrawItemAndChildren(p); + else + pg->DrawItem(p); + } } // -----------------------------------------------------------------------