mirror of https://github.com/buggins/dlangui.git
Merge pull request #509 from denizzzka/input_fix
Adds InputBox.text set/get
This commit is contained in:
commit
dd702747f0
|
@ -614,7 +614,7 @@ class EditableContent {
|
|||
@property EditStateMark[] editMarks() { return _editMarks; }
|
||||
|
||||
/// returns all lines concatenated delimited by '\n'
|
||||
@property dstring text() {
|
||||
@property dstring text() const {
|
||||
if (_lines.length == 0)
|
||||
return "";
|
||||
if (_lines.length == 1)
|
||||
|
|
|
@ -1210,7 +1210,7 @@ class FileNameEditLine : HorizontalLayout {
|
|||
@property void caption(dstring s) { _caption = s; }
|
||||
|
||||
/// returns widget content text (override to support this)
|
||||
override @property dstring text() { return _edFileName.text; }
|
||||
override @property dstring text() const { return _edFileName.text; }
|
||||
/// sets widget content text (override to support this)
|
||||
override @property Widget text(dstring s) { _edFileName.text = s; return this; }
|
||||
/// sets widget content text (override to support this)
|
||||
|
|
|
@ -56,4 +56,18 @@ class InputBox : Dialog {
|
|||
_editor.selectAll();
|
||||
_editor.setFocus();
|
||||
}
|
||||
|
||||
override dstring text() const {
|
||||
return _text;
|
||||
}
|
||||
|
||||
override Widget text(dstring t) {
|
||||
_text = t;
|
||||
return this;
|
||||
}
|
||||
|
||||
override Widget text(UIString s) {
|
||||
_text = s;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -284,7 +284,7 @@ class ComboBox : ComboBoxBase {
|
|||
return cast(StringListAdapter)_adapter;
|
||||
}
|
||||
|
||||
@property override dstring text() {
|
||||
@property override dstring text() const {
|
||||
return _body.text;
|
||||
}
|
||||
|
||||
|
@ -403,7 +403,7 @@ class IconTextComboBox : ComboBoxBase {
|
|||
return cast(StringListAdapter)_adapter;
|
||||
}
|
||||
|
||||
@property override dstring text() {
|
||||
@property override dstring text() const {
|
||||
return _body.text;
|
||||
}
|
||||
|
||||
|
|
|
@ -355,7 +355,7 @@ class ImageTextButton : HorizontalLayout {
|
|||
protected TextWidget _label;
|
||||
|
||||
/// Get label text
|
||||
override @property dstring text() { return _label.text; }
|
||||
override @property dstring text() const { return _label.text; }
|
||||
/// Set label plain unicode string
|
||||
override @property Widget text(dstring s) { _label.text = s; requestLayout(); return this; }
|
||||
/// Set label string resource Id
|
||||
|
|
|
@ -995,7 +995,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
|||
protected bool _lastReportedModifiedState;
|
||||
|
||||
/// get widget text
|
||||
override @property dstring text() { return _content.text; }
|
||||
override @property dstring text() const { return _content.text; }
|
||||
|
||||
/// set text
|
||||
override @property Widget text(dstring s) {
|
||||
|
|
|
@ -53,7 +53,7 @@ class GroupBox : LinearLayout {
|
|||
}
|
||||
|
||||
/// get widget text
|
||||
override @property dstring text() { return _caption.text; }
|
||||
override @property dstring text() const { return _caption.text; }
|
||||
/// set text to show
|
||||
override @property Widget text(dstring s) {
|
||||
_caption.text = s;
|
||||
|
|
|
@ -38,7 +38,7 @@ class StatusLineTextPanel : StatusLinePanelBase {
|
|||
addChild(_text);
|
||||
}
|
||||
/// returns widget content text (override to support this)
|
||||
override @property dstring text() { return _text.text; }
|
||||
override @property dstring text() const { return _text.text; }
|
||||
/// sets widget content text (override to support this)
|
||||
override @property Widget text(dstring s) { _text.text = s; return this; }
|
||||
/// sets widget content text (override to support this)
|
||||
|
|
|
@ -570,11 +570,17 @@ public:
|
|||
@property FontRef font() const { return stateStyle.font; }
|
||||
|
||||
/// returns widget content text (override to support this)
|
||||
@property dstring text() { return ""; }
|
||||
@property dstring text() const {
|
||||
assert(false, __FUNCTION__~" isn't implemented");
|
||||
}
|
||||
/// sets widget content text (override to support this)
|
||||
@property Widget text(dstring s) { return this; }
|
||||
@property Widget text(dstring s) {
|
||||
assert(false, __FUNCTION__~" isn't implemented");
|
||||
}
|
||||
/// sets widget content text (override to support this)
|
||||
@property Widget text(UIString s) { return this; }
|
||||
@property Widget text(UIString s) {
|
||||
assert(false, __FUNCTION__~" isn't implemented");
|
||||
}
|
||||
|
||||
/// override to handle font changes
|
||||
protected void handleFontChanged() {}
|
||||
|
|
Loading…
Reference in New Issue