Fix setting layout direction for wxComboBox in wxMSW.
The EDIT control used by the native combobox is different from normal EDIT controls and has to be handled specially. We also need to explicitly forward WS_EX_LAYOUTRTL to the dropdown window as it doesn't inherit it from the combobox itself automatically. See #11583. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77754 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1135,31 +1135,8 @@ void wxWindowMSW::SetLayoutDirection(wxLayoutDirection dir)
|
||||
#ifdef __WXWINCE__
|
||||
wxUnusedVar(dir);
|
||||
#else
|
||||
wxCHECK_RET( GetHwnd(),
|
||||
wxT("layout direction must be set after window creation") );
|
||||
|
||||
LONG styleOld = wxGetWindowExStyle(this);
|
||||
|
||||
LONG styleNew = styleOld;
|
||||
switch ( dir )
|
||||
if ( wxUpdateLayoutDirection(GetHwnd(), dir) )
|
||||
{
|
||||
case wxLayout_LeftToRight:
|
||||
styleNew &= ~WS_EX_LAYOUTRTL;
|
||||
break;
|
||||
|
||||
case wxLayout_RightToLeft:
|
||||
styleNew |= WS_EX_LAYOUTRTL;
|
||||
break;
|
||||
|
||||
default:
|
||||
wxFAIL_MSG(wxT("unsupported layout direction"));
|
||||
break;
|
||||
}
|
||||
|
||||
if ( styleNew != styleOld )
|
||||
{
|
||||
wxSetWindowExStyle(this, styleNew);
|
||||
|
||||
// Update layout: whether we have children or are drawing something, we
|
||||
// need to redo it with the new layout.
|
||||
SendSizeEvent();
|
||||
|
Reference in New Issue
Block a user