X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dae1d009871aa905c235c0b236c359f14f1928a..db70a2f20ac7b47299fe7ab66bae9ef613a0fe6b:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index f40f6c861b..a5a89ea845 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -678,7 +678,10 @@ void wxTextCtrl::DoWriteText(const wxString& value, bool selectionOnly) { if ( !selectionOnly ) { - SetSelection(-1, -1); + //SetSelection(-1, -1); + // This eliminates an annoying flashing effect + // when replacing all text. + Clear(); } ::SendMessage(GetHwnd(), EM_REPLACESEL, 0, (LPARAM)valueDos.c_str()); @@ -1652,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() ) @@ -1785,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 // ----------------------------------------------------------------------------