X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b0c42805875e71afdbf5e1ac013945da9c1fea20..2b65eb68b852ee023101f2ed621e0679dfb80306:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index c64bfb06e8..7b7d9d905e 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -438,12 +438,16 @@ void wxTextCtrl::SetValue(const wxString& value) WriteText(value); + // mark the control as being not dirty - we changed its text, not the + // user + DiscardEdits(); + // for compatibility, don't move the cursor when doing SetValue() SetInsertionPoint(0); } } -#if wxUSE_RICHEDIT +#if wxUSE_RICHEDIT && !wxUSE_UNICODE DWORD CALLBACK wxRichEditStreamIn(DWORD dwCookie, BYTE *buf, LONG cb, LONG *pcb) { @@ -468,7 +472,6 @@ extern long wxEncodingToCodepage(wxFontEncoding encoding); // from strconv.cpp bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding) { -#if !wxUSE_UNICODE // we have to use EM_STREAMIN to force richedit control 2.0+ to show any // text in the non default charset - otherwise it thinks it knows better // than we do and always shows it in the default one @@ -492,9 +495,6 @@ bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding) // finally, stream it in the control const wchar_t *wpc = wchBuf; -#else - const wchar_t *wpc = value.c_str(); -#endif EDITSTREAM eds; wxZeroMemory(eds); @@ -533,6 +533,7 @@ void wxTextCtrl::WriteText(const wxString& value) SetStyle(start, end, m_defaultStyle ); } +#if !wxUSE_UNICODE // next check if the text we're inserting must be shown in a non // default charset -- this only works for RichEdit > 1.0 if ( GetRichVersion() > 1 ) @@ -550,6 +551,7 @@ void wxTextCtrl::WriteText(const wxString& value) } } } +#endif // !wxUSE_UNICODE } if ( !done )