From aedc6f0614bf20170be35f899ac176666a87215e Mon Sep 17 00:00:00 2001 From: mfranz Date: Tue, 5 Aug 2008 05:27:07 +0000 Subject: [PATCH] use false flag for widgets that shouldn't be drawn instead of true. This is consistent with other places in fgfs, like menu entries, hud elements, subsystem switches, etc. --- src/GUI/dialog.cxx | 2 +- src/GUI/layout-props.cxx | 4 ++-- src/GUI/layout.cxx | 8 ++++---- src/GUI/layout.hxx | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index a74cd9ef9..40d718e19 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -517,7 +517,7 @@ FGDialog::display (SGPropertyNode * props) puObject * FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight) { - if (props->getBoolValue("hide")) + if (!props->getBoolValue("enabled", true)) return 0; bool presetSize = props->hasValue("width") && props->hasValue("height"); diff --git a/src/GUI/layout-props.cxx b/src/GUI/layout-props.cxx index 8533c17c8..2d691036f 100644 --- a/src/GUI/layout-props.cxx +++ b/src/GUI/layout-props.cxx @@ -82,9 +82,9 @@ int LayoutWidget::getNum(const char* f) return _prop->getIntValue(f); } -bool LayoutWidget::getBool(const char* f) +bool LayoutWidget::getBool(const char* f, bool dflt) { - return _prop->getBoolValue(f); + return _prop->getBoolValue(f, dflt); } const char* LayoutWidget::getStr(const char* f) diff --git a/src/GUI/layout.cxx b/src/GUI/layout.cxx index 12d13df7d..aeec747c6 100644 --- a/src/GUI/layout.cxx +++ b/src/GUI/layout.cxx @@ -39,7 +39,7 @@ void LayoutWidget::calcPrefSize(int* w, int* h) { *w = *h = 0; // Ask for nothing by default - if (getBool("hide") || isType("nasal")) + if (!getBool("enabled", true) || isType("nasal")) return; int legw = stringLength(getStr("legend")); @@ -97,7 +97,7 @@ void LayoutWidget::calcPrefSize(int* w, int* h) // Set up geometry such that the widget lives "inside" the specified void LayoutWidget::layout(int x, int y, int w, int h) { - if (getBool("hide") || isType("nasal")) + if (!getBool("enabled", true) || isType("nasal")) return; setNum("__bx", x); @@ -198,7 +198,7 @@ void LayoutWidget::doHVBox(bool doLayout, bool vertical, int* w, int* h) int nEq = 0, eqA = 0, eqB = 0, eqTotalA = 0; for(i=0; i