]> git.mxchange.org Git - flightgear.git/blobdiff - src/GUI/layout.cxx
Added two missing files from JSBSim.org that were missing in the last sync.
[flightgear.git] / src / GUI / layout.cxx
index 12d13df7d476046695a9e6d8ce1dbd9fdcc8db30..f9581b3d5503a957313a340b7ec867960bbbfe40 100644 (file)
@@ -1,5 +1,12 @@
+
+#ifdef HAVE_CONFIG_H
+#  include <config.h>
+#endif
+
 #include "layout.hxx"
 
+#include <simgear/math/SGMath.hxx>
+
 // This file contains the actual layout engine.  It has no dependence
 // on outside libraries; see layout-props.cxx for the glue code.
 
@@ -39,7 +46,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"));
@@ -72,7 +79,8 @@ void LayoutWidget::calcPrefSize(int* w, int* h)
         *w = *h = 17*UNIT;
         if(getBool("vertical")) *w = 4*UNIT;
         else                    *h = 4*UNIT;
-    } else if (isType("list") || isType("airport-list") || isType("dial")) {
+    } else if (isType("list") || isType("airport-list")
+            || isType("property-list") || isType("dial")) {
         *w = *h = 12*UNIT;
     } else if (isType("hrule")) {
         *h = 1;
@@ -97,7 +105,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 +206,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 +244,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")) {