X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/176da26d22b03c7444ccb6d02675fcbf644c8bb4..07aaf32633ecf18ec3edfbb41793a112914792d0:/src/msw/textctrl.cpp?ds=inline diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index fcdb1ab111..930b37cd6d 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -511,9 +511,23 @@ bool wxTextCtrl::MSWCreateText(const wxString& value, // classic mode, i.e. without themes. Also, the margin can be reset to // 0 easily by calling SetMargins() explicitly but setting it to the // default value is not currently supported. - ::SendMessage(GetHwnd(), EM_SETMARGINS, - EC_LEFTMARGIN | EC_RIGHTMARGIN, - MAKELPARAM(EC_USEFONTINFO, EC_USEFONTINFO)); + // + // Finally, notice that EC_USEFONTINFO is used differently for plain + // and rich text controls. + WPARAM wParam; + LPARAM lParam; + if ( IsRich() ) + { + wParam = EC_USEFONTINFO; + lParam = 0; + } + else // plain EDIT, EC_USEFONTINFO is used in lParam with them. + { + wParam = EC_LEFTMARGIN | EC_RIGHTMARGIN; + lParam = MAKELPARAM(EC_USEFONTINFO, EC_USEFONTINFO); + } + + ::SendMessage(GetHwnd(), EM_SETMARGINS, wParam, lParam); } #endif // !__WXWINCE__ @@ -1009,7 +1023,7 @@ wxTextCtrl::StreamOut(wxFontEncoding encoding, bool selectionOnly) const EDITSTREAM eds; wxZeroMemory(eds); - eds.dwCookie = (DWORD)&data; + eds.dwCookie = (DWORD_PTR)&data; eds.pfnCallback = wxRichEditStreamOut; ::SendMessage