node->setFloatValue(object->getFloatValue());
break;
default:
- // Special case to handle lists, as getStringValue cannot be overridden
- if(object->getType() & PUCLASS_LIST)
- {
- const char *s = ((puList *) object)->getListStringValue();
- if (s)
- node->setStringValue(s);
- }
- else
- {
- node->setStringValue(object->getStringValue());
- }
+ const char *s = object->getStringValue();
+ if (s)
+ node->setStringValue(s);
break;
}
}
puObject *
FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight)
{
- if (props->getBoolValue("hide"))
+ if (!props->getBoolValue("enabled", true))
return 0;
bool presetSize = props->hasValue("width") && props->hasValue("height");
fgComboBox * obj = new fgComboBox(x, y, x + width, y + height, props,
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") {
} else if (type == "select") {
fgSelectBox * obj = new fgSelectBox(x, y, x + width, y + height, props);
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;
{ LABEL, PUCOL_LABEL, "label", "color-label" },
{ LEGEND, PUCOL_LEGEND, "legend", "color-legend" },
{ 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]);
fgList::update()
{
fgValueList::update();
+ int top = getTopItem();
newList(_list);
+ setTopItem(top);
}
// end of dialog.cxx