From c3ba52d821522fc476ebf5508f6c92a1a13fdee3 Mon Sep 17 00:00:00 2001 From: ehofman Date: Mon, 2 May 2005 14:45:04 +0000 Subject: [PATCH] Allow for defining the label color. --- src/GUI/dialog.cxx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index 5c03b2d70..22ad22c22 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -546,6 +546,30 @@ FGDialog::setupObject (puObject * object, SGPropertyNode * props) if (props->hasValue("label")) object->setLabel(props->getStringValue("label")); +#if 0 + if (props->hasValue("style")) { + int style = PUSTYLE_DEFAULT; + string s = props->getStringValue("style"); + if (s == "underline") style = PUSTYLE_SPECIAL_UNDERLINED; + else if (s == "small-bevelled") style = PUSTYLE_SMALL_BEVELLED; + else if (s == "small-shaded") style = PUSTYLE_SMALL_SHADED; + else if (s == "boxed") style = PUSTYLE_BOXED; + else if (s == "bevelled") style = PUSTYLE_BEVELLED; + else if (s == "shaded") style = PUSTYLE_SHADED; + else if (s == "dropshadow") style = PUSTYLE_DROPSHADOW; + object->setStyle(style); + } +#endif + + if ( SGPropertyNode *ncs = props->getNode("color", false) ) { + sgVec4 color; + color[0] = ncs->getFloatValue("red", 0.0); + color[1] = ncs->getFloatValue("green", 0.0); + color[2] = ncs->getFloatValue("blue", 0.0); + color[3] = ncs->getFloatValue("alpha", 1.0); + object->setColor(PUCOL_LABEL, color[0], color[1], color[2], color[3]); + } + if (props->hasValue("property")) { const char * name = props->getStringValue("name"); if (name == 0)