diff options
-rw-r--r-- | gui/widget.cpp | 6 | ||||
-rw-r--r-- | gui/widget.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gui/widget.cpp b/gui/widget.cpp index ebac5d6baf..62d8f8eef5 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -133,6 +133,12 @@ Widget *Widget::findWidgetInChain(Widget *w, const char *name) { } return 0; } +bool Widget::isEnabled() const { + if (g_gui.evaluator()->getVar(_name + ".enabled") == 0) { + return false; + } + return _flags & WIDGET_ENABLED; +} bool Widget::isVisible() const { if (g_gui.evaluator()->getVar(_name + ".visible") == 0) diff --git a/gui/widget.h b/gui/widget.h index c19059d32c..1381bbfb4b 100644 --- a/gui/widget.h +++ b/gui/widget.h @@ -148,7 +148,7 @@ public: int getHints() const { return _hints; } void setEnabled(bool e) { if (e) setFlags(WIDGET_ENABLED); else clearFlags(WIDGET_ENABLED); } - bool isEnabled() const { return _flags & WIDGET_ENABLED; } + bool isEnabled() const; bool isVisible() const; protected: |