]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/layout-props.cxx
Support for multiple data dirs.
[flightgear.git] / src / GUI / layout-props.cxx
index b2fe085daaa91fef3239c81ada3d115754005fd1..2d691036fae35047df8c763f14d20937fbcb474b 100644 (file)
@@ -42,11 +42,16 @@ LayoutWidget LayoutWidget::parent()
 
 int LayoutWidget::nChildren()
 {
-    // Hack: assume that any non-leaf nodes are widgets...
+    // Hack: assume that any non-leaf nodes but "hrule" and "vrule"
+    // are widgets...
     int n = 0;
-    for(int i=0; i<_prop->nChildren(); i++)
-        if(_prop->getChild(i)->nChildren() != 0)
+    for(int i=0; i<_prop->nChildren(); i++) {
+        SGPropertyNode* p = _prop->getChild(i);
+        const char* name = p->getName();
+        if(p->nChildren() != 0 || !strcmp(name, "hrule")
+                || !strcmp(name, "vrule"))
             n++;
+    }
     return n;
 }
 
@@ -57,7 +62,9 @@ LayoutWidget LayoutWidget::getChild(int idx)
     int n = 0;
     for(int i=0; i<_prop->nChildren(); i++) {
         SGPropertyNode* p = _prop->getChild(i);
-        if(p->nChildren() != 0) {
+        const char* name = p->getName();
+        if(p->nChildren() != 0 || !strcmp(name, "hrule")
+                || !strcmp(name, "vrule")) {
             if(idx == n) return LayoutWidget(p);
             n++;
         }
@@ -75,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)