From 3488be9c0a357a54f5ac9b022055df7f3ec186cb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 10 Sep 2006 23:47:11 +0000 Subject: [PATCH] use RTL paragraphs in rich edit control in RTL mode (patch 1553298) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/textctrl.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 2b41db8590..f4193cf875 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2564,11 +2564,23 @@ bool wxTextCtrl::SetStyle(long start, long end, const wxTextAttr& style) } } - if (pf.dwMask != 0) +#if wxUSE_RICHEDIT2 + if ( m_verRichEdit > 1 ) + { + if ( wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft ) + { + // Use RTL paragraphs in RTL mode to get proper layout + pf.dwMask |= PFM_RTLPARA; + pf.wEffects |= PFE_RTLPARA; + } + } +#endif // wxUSE_RICHEDIT2 + + if ( pf.dwMask ) { // do format the selection bool ok = ::SendMessage(GetHwnd(), EM_SETPARAFORMAT, - 0, (LPARAM) &pf) != 0; + 0, (LPARAM) &pf) != 0; if ( !ok ) { wxLogDebug(_T("SendMessage(EM_SETPARAFORMAT, 0) failed")); -- 2.45.2