From feb555b0873a56e19409abde6c8fe2d643810062 Mon Sep 17 00:00:00 2001 From: mfranz Date: Wed, 9 Nov 2005 17:59:53 +0000 Subject: [PATCH] prepare for pending plib change: set combobox/selectbox input field colors 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 | 13 ++++++++++++- src/GUI/dialog.hxx | 3 ++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index ca8e19753..4fcabba5d 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -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]); diff --git a/src/GUI/dialog.hxx b/src/GUI/dialog.hxx index 452334973..0895ce9c2 100644 --- a/src/GUI/dialog.hxx +++ b/src/GUI/dialog.hxx @@ -108,7 +108,8 @@ private: HIGHLIGHT = 0x04, LABEL = 0x08, LEGEND = 0x10, - MISC = 0x20 + MISC = 0x20, + EDITFIELD = 0x40 }; // Private copy constructor to avoid unpleasant surprises. -- 2.39.5