1
0
Fork 0

move <text> before <property> part, so that <format>s are applied initially

This commit is contained in:
mfranz 2009-01-31 16:30:38 +00:00 committed by Tim Moore
parent 11d18d3e5f
commit ec03d4ce01

View file

@ -845,6 +845,22 @@ FGDialog::setupObject (puObject *object, SGPropertyNode *props)
object->setLabelFont(*_font);
}
string type = props->getName();
if (type == "input" && props->getBoolValue("live"))
object->setDownCallback(action_callback);
if (type == "text") {
const char *format = props->getStringValue("format", 0);
if (format) {
info->fmt_type = validate_format(format);
if (info->fmt_type != f_INVALID)
info->format = format;
else
SG_LOG(SG_GENERAL, SG_ALERT, "DIALOG: invalid <format> '"
<< format << '\'');
}
}
if (props->hasValue("property")) {
const char *name = props->getStringValue("name");
if (name == 0)
@ -882,22 +898,6 @@ FGDialog::setupObject (puObject *object, SGPropertyNode *props)
}
object->setCallback(action_callback);
}
string type = props->getName();
if (type == "input" && props->getBoolValue("live"))
object->setDownCallback(action_callback);
if (type == "text") {
const char *format = props->getStringValue("format", 0);
if (format) {
info->fmt_type = validate_format(format);
if (info->fmt_type != f_INVALID)
info->format = format;
else
SG_LOG(SG_GENERAL, SG_ALERT, "DIALOG: invalid <format> '"
<< format << '\'');
}
}
}
void