X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/af01f1ba0d697c07173f436ab661b4c833258a91..d21d2e5adf7a5acf3b496a9c4e87eab220bd75d8:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 4282e711fe..27a8a37462 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -91,6 +91,10 @@ } ENLINK; #endif // ENLINK +#ifndef SF_UNICODE + #define SF_UNICODE 0x0010 +#endif + // ---------------------------------------------------------------------------- // private functions // ---------------------------------------------------------------------------- @@ -439,7 +443,7 @@ void wxTextCtrl::SetValue(const wxString& value) } } -#if wxUSE_RICHEDIT +#if wxUSE_RICHEDIT && !wxUSE_UNICODE DWORD CALLBACK wxRichEditStreamIn(DWORD dwCookie, BYTE *buf, LONG cb, LONG *pcb) { @@ -491,7 +495,8 @@ bool wxTextCtrl::StreamIn(const wxString& value, wxFontEncoding encoding) EDITSTREAM eds; wxZeroMemory(eds); eds.dwCookie = (DWORD)&wpc; - eds.pfnCallback = wxRichEditStreamIn; + // the cast below is needed for broken (very) old mingw32 headers + eds.pfnCallback = (EDITSTREAMCALLBACK)wxRichEditStreamIn; if ( !::SendMessage(GetHwnd(), EM_STREAMIN, SF_TEXT | SF_UNICODE | SFF_SELECTION, @@ -524,6 +529,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 ) @@ -541,6 +547,7 @@ void wxTextCtrl::WriteText(const wxString& value) } } } +#endif // !wxUSE_UNICODE } if ( !done )