diff --git a/docs-mini/README.gui b/docs-mini/README.gui index 6e20d4a3b..34f4cbbbf 100644 --- a/docs-mini/README.gui +++ b/docs-mini/README.gui @@ -80,6 +80,11 @@ a simple, "hello world" dialog: 10 50 Hello, world + + 1.0 + 0.0 + 0.0 + @@ -117,6 +122,8 @@ properties, though they will ignore any that are not relevant: height - the height of the object, in pseudo-pixels. The default is the width of the parent container. + border - the border thickness, in pseudo-pixels. The default is 2. + color - a subgroup to specify the dialogs color: red - specify the red color component of the color scheme. green - specify the green color component of the color scheme. @@ -126,7 +133,7 @@ properties, though they will ignore any that are not relevant: font - a subgroup to specify a specific font type name - the name of the font (excluding it's .txf extension) size - size of the font - slant - the slant of the font (in pixels) + slant - the slant of the font (in pseudo-pixels) legend - the text legend to display in the object. @@ -142,8 +149,8 @@ properties, though they will ignore any that are not relevant: presses the [RETURN] key. Objects may appear nested within the top-level dialog or a "group" -object. Here are all the object types allowed, with their special -properties: +or a "frame" object. Here are all the object types allowed, with their +special properties: dialog @@ -180,14 +187,17 @@ Example: -group ------ +group and frame +--------------- A group of subobjects. This object does not draw anything on the screen, but all of its children specify their coordinates relative to the group; using groups makes it easy to move parts of a dialog around. +A frame is a visual representation of a group and has a border and an +adjustable background color. + Example: diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index ff263634e..0a70deab5 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -427,6 +427,13 @@ FGDialog::makeObject (SGPropertyNode * props, int parentWidth, int parentHeight) puGroup * group = new puGroup(x, y); setupGroup(group, props, width, height, color, false); return group; + } else if (type == "frame") { + puFrame * frame = new puFrame(x, y, width, height); + frame->setBorderThickness(1); + frame->setColorScheme(color[0], color[1], color[2], color[3]); + puGroup * group = new puGroup(x, y); + setupGroup(group, props, width, height, color, false); + return group; } else if (type == "list") { puList * list = new puList(x, y, x + width, y + height); setupObject(list, props); @@ -554,6 +561,9 @@ FGDialog::setupObject (puObject * object, SGPropertyNode * props) if (props->hasValue("label")) object->setLabel(props->getStringValue("label")); + if (props->hasValue("border")) + object->setBorderThickness( props->getIntValue("border", 2) ); + if ( SGPropertyNode *nft = props->getNode("font", false) ) { SGPath path( _font_path ); const char *name = nft->getStringValue("name", "default");