Fix setting RTL direction for wxTextCtrl without wxTE_RICH in wxMSW.

Plain EDIT text controls don't support WS_EX_LAYOUTRTL, use WS_EX_RTLREADING
for them instead.

See #11583.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77658 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-09-10 16:51:42 +00:00
parent 6ea435350e
commit 060cf2666d
3 changed files with 92 additions and 0 deletions

View File

@@ -1793,6 +1793,41 @@ void wxTextCtrl::SetMaxLength(unsigned long len)
}
}
#ifndef __WXWINCE__
// ----------------------------------------------------------------------------
// RTL support
// ----------------------------------------------------------------------------
void wxTextCtrl::SetLayoutDirection(wxLayoutDirection dir)
{
// We only need to handle this specifically for plain EDIT controls, rich
// edit ones behave like any other window.
if ( IsRich() )
{
wxTextCtrlBase::SetLayoutDirection(dir);
}
else
{
if ( wxUpdateEditLayoutDirection(GetHwnd(), dir) )
{
// Update text layout by forcing the control to redo it, a simple
// Refresh() is not enough.
SendSizeEvent();
Refresh();
}
}
}
wxLayoutDirection wxTextCtrl::GetLayoutDirection() const
{
// Just as above, we need to handle plain EDIT controls specially.
return IsRich() ? wxTextCtrlBase::GetLayoutDirection()
: wxGetEditLayoutDirection(GetHwnd());
}
#endif // !__WXWINCE__
// ----------------------------------------------------------------------------
// Undo/redo
// ----------------------------------------------------------------------------