Add support for wxTE_CHARWRAP to wxTextCtrl

Apparently various text wrapping modes are not supported natively by
NSTextView (apart from word wrapping which is used by default) and
non-default wrapping has to be implemented in the custom code.
To wrap lines at any character, NSLineBreakByCharWrapping style should be
applied at any text change to the entire text stored in NSTextStorage
associated with NSTextView. This is done in DoUpdateTextStyle() method
which is called from controlTextDidChange() when text is modified by
the user, or SetStringValue() and WriteText() when text is set
programmatically.
This commit is contained in:
Artur Wieczorek
2017-08-05 20:44:15 +02:00
parent 7626292fa4
commit ec55f11ff7
4 changed files with 33 additions and 1 deletions

View File

@@ -990,7 +990,7 @@ public:
scrollbar instead.
@style{wxTE_CHARWRAP}
For multiline controls only: wrap the lines too long to be shown
entirely at any position (wxUniv and wxGTK).
entirely at any position (wxUniv, wxGTK, wxOSX).
@style{wxTE_WORDWRAP}
For multiline controls only: wrap the lines too long to be shown
entirely at word boundaries (wxUniv, wxMSW, wxGTK, wxOSX).