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
This commit is contained in:
Vadim Zeitlin
2006-09-10 23:47:11 +00:00
parent e5b5af9139
commit 3488be9c0a

View File

@@ -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 // do format the selection
bool ok = ::SendMessage(GetHwnd(), EM_SETPARAFORMAT, bool ok = ::SendMessage(GetHwnd(), EM_SETPARAFORMAT,
0, (LPARAM) &pf) != 0; 0, (LPARAM) &pf) != 0;
if ( !ok ) if ( !ok )
{ {
wxLogDebug(_T("SendMessage(EM_SETPARAFORMAT, 0) failed")); wxLogDebug(_T("SendMessage(EM_SETPARAFORMAT, 0) failed"));