GUI: Added Widget::setVisible convenience wrapper

svn-id: r35572
This commit is contained in:
Max Horn 2008-12-27 14:36:28 +00:00
parent 69f4b7a383
commit f26f85ee96
6 changed files with 44 additions and 36 deletions

View file

@ -145,6 +145,13 @@ Widget *Widget::findWidgetInChain(Widget *w, const char *name) {
return 0;
}
void Widget::setEnabled(bool e) {
if (e)
setFlags(WIDGET_ENABLED);
else
clearFlags(WIDGET_ENABLED);
}
bool Widget::isEnabled() const {
if (g_gui.xmlEval()->getVar("Dialog." + _name + ".Enabled", 1) == 0) {
return false;
@ -152,6 +159,13 @@ bool Widget::isEnabled() const {
return ((_flags & WIDGET_ENABLED) != 0);
}
void Widget::setVisible(bool e) {
if (e)
clearFlags(WIDGET_INVISIBLE);
else
setFlags(WIDGET_INVISIBLE);
}
bool Widget::isVisible() const {
if (g_gui.xmlEval()->getVar("Dialog." + _name + ".Visible", 1) == 0)
return false;