Allow changing alignment styles after wxTextCtrl creation (wxOSX)

Update NSTextView/NSTextField alignment mode when wxTextCtrl alignment styles are changed with SetWindowStyleFlag().

Closes #17952.
This commit is contained in:
Andreas Falkenhahn
2017-09-25 15:38:24 +02:00
committed by Artur Wieczorek
parent cd1c3fab0c
commit ccc513bca9
7 changed files with 57 additions and 3 deletions

View File

@@ -482,6 +482,17 @@ void wxTextCtrl::Command(wxCommandEvent & event)
ProcessCommand(event);
}
void wxTextCtrl::SetWindowStyleFlag(long style)
{
long styleOld = GetWindowStyleFlag();
wxTextCtrlBase::SetWindowStyleFlag(style);
static const long flagsAlign = wxTE_LEFT | wxTE_CENTRE | wxTE_RIGHT;
if ( (style & flagsAlign) != (styleOld & flagsAlign) )
GetTextPeer()->SetJustification();
}
// ----------------------------------------------------------------------------
// standard handlers for standard edit menu events
// ----------------------------------------------------------------------------
@@ -774,4 +785,7 @@ int wxTextWidgetImpl::GetLineLength(long lineNo) const
return 0 ;
}
void wxTextWidgetImpl::SetJustification()
{
}
#endif // wxUSE_TEXTCTRL