word wrapping for EditBox - starting implementation, issue #206

This commit is contained in:
Vadim Lopatin 2016-03-21 17:19:42 +03:00
parent 3e4d5b6622
commit e525e13e73
2 changed files with 26 additions and 0 deletions

View File

@ -441,6 +441,13 @@ alias TokenProp = ubyte;
/// TokenCategory string
alias TokenPropString = TokenProp[];
struct LineSpan {
/// start index of line
int start;
/// number of lines it spans
int len;
}
/// interface for custom syntax highlight, comments toggling, smart indents, and other language dependent features for source code editors
interface SyntaxSupport {

View File

@ -285,6 +285,25 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
return 1;
}
protected bool _wordWrap;
/// true if word wrap mode is set
@property bool wordWrap() {
return _wordWrap;
}
/// true if word wrap mode is set
@property EditWidgetBase wordWrap(bool v) {
_wordWrap = v;
invalidate();
return this;
}
void wrapLine(dstring line, int maxWidth) {
}
/// information about line span into several lines - in word wrap mode
protected LineSpan[] _span;
/// override to add custom items on left panel
protected void updateLeftPaneWidth() {
_iconsWidth = _showIcons ? _iconsPaneWidth : 0;