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");
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)
{
*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"));
// 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);
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;
// 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")) {
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);