X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9b99c1e36a5481f2c24bee87414c68269baae4c7..091e74e76b63f04a4058995c5dcc6f5b8b6db362:/src/msw/textctrl.cpp diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 02f25eabc3..04cc73d26a 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -37,6 +37,7 @@ #include "wx/menu.h" #include "wx/math.h" #include "wx/module.h" + #include "wx/wxcrtvararg.h" #endif #include "wx/sysopt.h" @@ -608,10 +609,12 @@ WXDWORD wxTextCtrl::MSWGetStyle(long style, WXDWORD *exstyle) const void wxTextCtrl::SetWindowStyleFlag(long style) { - // changing the alignment of the control dynamically only works under XP - // (but not older Windows version) and only for plain EDIT controls (not - // RICH ones) and we have to recreate the control to make it always work - if ( IsRich() || wxGetWinVersion() < wxWinVersion_XP ) + // changing the alignment of the control dynamically works under Win2003 + // (but not older Windows version: it seems to work under some versions of + // XP but not other ones, and we have no way to determine it so be + // conservative here) and only for plain EDIT controls (not RICH ones) and + // we have to recreate the control to make it always work + if ( IsRich() || wxGetWinVersion() < wxWinVersion_2003 ) { const long alignMask = wxTE_LEFT | wxTE_CENTRE | wxTE_RIGHT; if ( (style & alignMask) != (GetWindowStyle() & alignMask) ) @@ -1113,7 +1116,7 @@ void wxTextCtrl::DoWriteText(const wxString& value, int flags) ::SendMessage(GetHwnd(), selectionOnly ? EM_REPLACESEL : WM_SETTEXT, // EM_REPLACESEL takes 1 to indicate the operation should be redoable - selectionOnly ? 1 : 0, (LPARAM)valueDos.c_str()); + selectionOnly ? 1 : 0, (LPARAM)valueDos.wx_str()); if ( !ucf.GotUpdate() && (flags & SetValue_SendEvent) ) {