From d63cb402e359760174e73eab8c7255a228b1d8ad Mon Sep 17 00:00:00 2001 From: Denis Feklushkin Date: Wed, 8 Nov 2017 14:11:52 +0700 Subject: [PATCH] Widget: prevents using text() without override --- src/dlangui/widgets/widget.d | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/dlangui/widgets/widget.d b/src/dlangui/widgets/widget.d index b32b3b9c..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() const { 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() {}