the previous default style didn't set them neither, the global font or colours
of the text control itself are used as fall back.
+However if the {\it style} parameter is the default wxTextAttr, then the
+default style is just reset (instead of being combined with the new style which
+wouldn't change it at all).
+
\wxheading{Parameters}
\docparam{style}{The style for the new text.}
// change default text attributes
bool wxTextCtrlBase::SetDefaultStyle(const wxTextAttr& style)
{
- // keep the old attributes if the new style doesn't specify them
- m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this);
+ // keep the old attributes if the new style doesn't specify them unless the
+ // new style is empty - then reset m_defaultStyle (as there is no other way
+ // to do it)
+ if ( style.IsDefault() )
+ m_defaultStyle = style;
+ else
+ m_defaultStyle = wxTextAttr::Combine(style, m_defaultStyle, this);
return TRUE;
}