From 0fac79547e50cd50d80b425ce90c9c053bb83fab Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 25 Jan 2007 15:39:58 +0000 Subject: [PATCH] changing text alignment dynamically doesn't always work under XP, recreate the control there too (backport from HEAD) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@44308 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textctrl.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 02f25eabc3..31cc2f55c9 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -608,10 +608,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) )