]> git.mxchange.org Git - flightgear.git/commitdiff
prepare for pending plib change: set combobox/selectbox input field colors
authormfranz <mfranz>
Wed, 9 Nov 2005 17:59:53 +0000 (17:59 +0000)
committermfranz <mfranz>
Wed, 9 Nov 2005 17:59:53 +0000 (17:59 +0000)
to other color than "Yeukky Pink"; #undef'ed for older plib versions; plib
patch will be made available in case fgfs 0.9.9 is released before plib 0.8.5

src/GUI/dialog.cxx
src/GUI/dialog.hxx

index ca8e19753f53224aa22df321ec4bcb5d24d1024a..4fcabba5d5897fadb106c9482d5d4baf88ccd765 100644 (file)
@@ -597,7 +597,11 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
         puComboBox * obj = new puComboBox(x, y, x + width, y + height, entries,
                            props->getBoolValue("editable", false));
         setupObject(obj, props);
+#ifdef PUCOL_EDITFIELD  // plib > 0.8.4
+        setColor(obj, props, EDITFIELD);
+#else
         setColor(obj, props, FOREGROUND|LABEL);
+#endif
         return obj;
 
     } else if (type == "slider") {
@@ -653,7 +657,11 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
         puSelectBox * obj =
             new puSelectBox(x, y, x + width, y + height, entries);
         setupObject(obj, props);
+#ifdef PUCOL_EDITFIELD  // plib > 0.8.4
+        setColor(obj, props, EDITFIELD);
+#else
         setColor(obj, props, FOREGROUND|LABEL);
+#endif
         return obj;
     } else {
         return 0;
@@ -769,7 +777,10 @@ FGDialog::setColor(puObject * object, SGPropertyNode * props, int which)
         { HIGHLIGHT,  PUCOL_HIGHLIGHT,  "highlight",  "color-highlight" },
         { LABEL,      PUCOL_LABEL,      "label",      "color-label" },
         { LEGEND,     PUCOL_LEGEND,     "legend",     "color-legend" },
-        { MISC,       PUCOL_MISC,       "misc",       "color-misc" }
+        { MISC,       PUCOL_MISC,       "misc",       "color-misc" },
+#ifdef PUCOL_EDITFIELD  // plib > 0.8.4
+        { EDITFIELD,  PUCOL_EDITFIELD,  "editfield",  "color-editfield" },
+#endif
     };
 
     const int numcol = sizeof(pucol) / sizeof(pucol[0]);
index 45233497307ba163522e5d4e2293fafaf0a75dca..0895ce9c27473f7c3a439cccab27d4c8d3c36393 100644 (file)
@@ -108,7 +108,8 @@ private:
         HIGHLIGHT = 0x04,
         LABEL = 0x08,
         LEGEND = 0x10,
-        MISC = 0x20
+        MISC = 0x20,
+        EDITFIELD = 0x40
     };
 
     // Private copy constructor to avoid unpleasant surprises.