Set layout direction of wxComboBox edit control only if it exists.
Doesn't update layout direction of edit control if wxComboBox is in read-only mode because editor control doesn't exist in this case.
This commit is contained in:
committed by
Vadim Zeitlin
parent
6b84e6e1b9
commit
35379a9633
@@ -716,17 +716,20 @@ void wxComboBox::SetLayoutDirection(wxLayoutDirection dir)
|
|||||||
// extended style flags), so its layout direction should be set using the
|
// extended style flags), so its layout direction should be set using the
|
||||||
// same extended flag as for ordinary window but reset simply with
|
// same extended flag as for ordinary window but reset simply with
|
||||||
// alignment flags.
|
// alignment flags.
|
||||||
if ( dir == wxLayout_RightToLeft )
|
if ( !HasFlag(wxCB_READONLY) )
|
||||||
{
|
{
|
||||||
wxUpdateLayoutDirection(GetEditHWND(), dir);
|
if ( dir == wxLayout_RightToLeft )
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
LONG_PTR style = ::GetWindowLongPtr(GetEditHWND(), GWL_STYLE);
|
|
||||||
if ( !(style & ES_CENTER) )
|
|
||||||
{
|
{
|
||||||
style &= ~ES_RIGHT;
|
wxUpdateLayoutDirection(GetEditHWND(), dir);
|
||||||
::SetWindowLongPtr(GetEditHWND(), GWL_STYLE, style);
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
LONG_PTR style = ::GetWindowLongPtr(GetEditHWND(), GWL_STYLE);
|
||||||
|
if ( !(style & ES_CENTER) )
|
||||||
|
{
|
||||||
|
style &= ~ES_RIGHT;
|
||||||
|
::SetWindowLongPtr(GetEditHWND(), GWL_STYLE, style);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user