diff --git a/src/dlangui/core/editable.d b/src/dlangui/core/editable.d index 991556a7..3973d65c 100644 --- a/src/dlangui/core/editable.d +++ b/src/dlangui/core/editable.d @@ -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) diff --git a/src/dlangui/dialogs/filedlg.d b/src/dlangui/dialogs/filedlg.d index a78815d1..1030e00d 100644 --- a/src/dlangui/dialogs/filedlg.d +++ b/src/dlangui/dialogs/filedlg.d @@ -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) diff --git a/src/dlangui/dialogs/inputbox.d b/src/dlangui/dialogs/inputbox.d index 04c6afe1..ede2cb8a 100644 --- a/src/dlangui/dialogs/inputbox.d +++ b/src/dlangui/dialogs/inputbox.d @@ -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; + } } diff --git a/src/dlangui/widgets/combobox.d b/src/dlangui/widgets/combobox.d index 964721fe..1e979989 100644 --- a/src/dlangui/widgets/combobox.d +++ b/src/dlangui/widgets/combobox.d @@ -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; } diff --git a/src/dlangui/widgets/controls.d b/src/dlangui/widgets/controls.d index d5c65705..68e61ce8 100644 --- a/src/dlangui/widgets/controls.d +++ b/src/dlangui/widgets/controls.d @@ -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 diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 438d9b98..de246dbe 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -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) { diff --git a/src/dlangui/widgets/groupbox.d b/src/dlangui/widgets/groupbox.d index ec3c6f52..a094feed 100644 --- a/src/dlangui/widgets/groupbox.d +++ b/src/dlangui/widgets/groupbox.d @@ -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; diff --git a/src/dlangui/widgets/statusline.d b/src/dlangui/widgets/statusline.d index 19e64460..0a46abae 100644 --- a/src/dlangui/widgets/statusline.d +++ b/src/dlangui/widgets/statusline.d @@ -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) diff --git a/src/dlangui/widgets/widget.d b/src/dlangui/widgets/widget.d index 7111524a..21756e6a 100644 --- a/src/dlangui/widgets/widget.d +++ b/src/dlangui/widgets/widget.d @@ -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() {}