Respect alignment in wxOSX wxTextCtrl::SetStyle()

Honour the alignment specified in the style, if any.

Closes #17529.
This commit is contained in:
Andreas Falkenhahn
2016-11-22 02:31:11 +01:00
committed by Vadim Zeitlin
parent d5c008da03
commit 6615c06d31

View File

@@ -862,6 +862,22 @@ void wxNSTextViewControl::SetStyle(long start,
if ( style.HasTextColour() )
[storage addAttribute:NSForegroundColorAttributeName value:style.GetTextColour().OSXGetNSColor() range:range];
}
if ( style.HasAlignment() )
{
switch ( style.GetAlignment() )
{
case wxTEXT_ALIGNMENT_RIGHT:
[m_textView setAlignment:NSRightTextAlignment];
break;
case wxTEXT_ALIGNMENT_CENTER:
[m_textView setAlignment:NSCenterTextAlignment];
break;
default:
[m_textView setAlignment:NSLeftTextAlignment];
break;
}
}
}
void wxNSTextViewControl::CheckSpelling(bool check)