Extend functionality of wxPropertyGridInterface::SetPropertyColoursToDefault method.

SetPropertyTextColour, SetPropertyBackgroundColour methods are able to set colours recursively for sub-properties but SetPropertyColoursToDefault method is not.
For the sake of consistency, SetPropertyColoursToDefault method is extended to have the same capabilities as SetPropertyTextColour and SetPropertyBackgroundColour. Behaviour and signature in default case (no recursion) is preserved.
For internal purposes there were also implemented helper methods in wxPGProperty class: SetDefaultColours, ClearCells.
This commit is contained in:
Artur Wieczorek
2015-08-27 19:14:52 +02:00
parent 503c6a48c7
commit 7ce6cff5ab
4 changed files with 76 additions and 3 deletions

View File

@@ -685,11 +685,18 @@ void wxPropertyGridInterface::SetPropertyTextColour( wxPGPropArg id,
// -----------------------------------------------------------------------
void wxPropertyGridInterface::SetPropertyColoursToDefault( wxPGPropArg id )
#if WXWIN_COMPATIBILITY_3_0
void wxPropertyGridInterface::SetPropertyColoursToDefault(wxPGPropArg id)
{
SetPropertyColoursToDefault(id, wxPG_DONT_RECURSE);
}
#endif // WXWIN_COMPATIBILITY_3_0
void wxPropertyGridInterface::SetPropertyColoursToDefault(wxPGPropArg id, int flags)
{
wxPG_PROP_ARG_CALL_PROLOG()
p->m_cells.clear();
p->SetDefaultColours(flags);
}
// -----------------------------------------------------------------------