X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1dae1d009871aa905c235c0b236c359f14f1928a..edc1cd8baf42910840cd2f86351f417868f9c1a9:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index f40f6c861b..14801b5eac 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()); @@ -1785,6 +1788,19 @@ 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; +} + // ---------------------------------------------------------------------------- // wxRichEditModule // ----------------------------------------------------------------------------