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:
@@ -124,9 +124,14 @@ public:
|
||||
|
||||
virtual wxSize GetBestSize() const wxOVERRIDE;
|
||||
|
||||
virtual void controlTextDidChange() wxOVERRIDE;
|
||||
|
||||
protected:
|
||||
void DoUpdateTextStyle();
|
||||
|
||||
NSScrollView* m_scrollView;
|
||||
NSTextView* m_textView;
|
||||
bool m_useCharWrapping;
|
||||
};
|
||||
|
||||
class wxNSComboBoxControl : public wxNSTextFieldControl, public wxComboWidgetImpl
|
||||
|
Reference in New Issue
Block a user