1
0
Fork 0

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
This commit is contained in:
mfranz 2005-11-09 17:59:53 +00:00
parent cff9e51840
commit feb555b087
2 changed files with 14 additions and 2 deletions

View 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]);

View 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.