X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f1fbff28875d7bc58fa493f5d83d9a1de38e002e..ddfca47f05f821f034514bf5d5cf938d80fa2829:/src/msw/textctrl.cpp?ds=sidebyside diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 3824a797f4..a5a89ea845 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -1655,6 +1655,8 @@ bool wxTextCtrl::SetForegroundColour(const wxColour& colour) // styling support for rich edit controls // ---------------------------------------------------------------------------- +#if wxUSE_RICHEDIT + bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) { if ( !IsRich() ) @@ -1788,6 +1790,21 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) return ok; } +bool wxTextCtrl::SetDefaultStyle(const wxTextAttr& style) +{ + if ( !wxTextCtrlBase::SetDefaultStyle(style) ) + return FALSE; + + // we have to do this or the style wouldn't apply for the text typed by the + // user + long posLast = GetLastPosition(); + SetStyle(posLast, posLast, m_defaultStyle); + + return TRUE; +} + +#endif + // ---------------------------------------------------------------------------- // wxRichEditModule // ----------------------------------------------------------------------------