use <enabled>false</enabled> flag for widgets that shouldn't be drawn
instead of <hide>true</hide>. This is consistent with other places in fgfs, like menu entries, hud elements, subsystem switches, etc.
This commit is contained in:
parent
403eaeb25e
commit
aedc6f0614
4 changed files with 8 additions and 8 deletions
|
@ -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");
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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<nc; i++) {
|
||||
LayoutWidget child = getChild(i);
|
||||
if (child.getBool("hide"))
|
||||
if (!child.getBool("enabled", true))
|
||||
continue;
|
||||
|
||||
int a, b;
|
||||
|
@ -236,7 +236,7 @@ void LayoutWidget::doHVBox(bool doLayout, bool vertical, int* w, int* h)
|
|||
// from top to bottom instead of along the cartesian Y axis.
|
||||
int idx = vertical ? (nc-i-1) : i;
|
||||
LayoutWidget child = getChild(idx);
|
||||
if (child.getBool("hide"))
|
||||
if (!child.getBool("enabled", true))
|
||||
continue;
|
||||
|
||||
if(child.getBool("equal")) {
|
||||
|
|
|
@ -31,7 +31,7 @@ public:
|
|||
LayoutWidget getChild(int i);
|
||||
bool hasField(const char* f);
|
||||
int getNum(const char* f);
|
||||
bool getBool(const char* f);
|
||||
bool getBool(const char* f, bool dflt = false);
|
||||
const char* getStr(const char* f);
|
||||
void setNum(const char* f, int num);
|
||||
|
||||
|
|
Loading…
Reference in a new issue