]> git.mxchange.org Git - flightgear.git/commitdiff
Add support for altering the border thickness of objects and add a 'frame' object...
authorehofman <ehofman>
Fri, 6 May 2005 11:46:52 +0000 (11:46 +0000)
committerehofman <ehofman>
Fri, 6 May 2005 11:46:52 +0000 (11:46 +0000)
docs-mini/README.gui
src/GUI/dialog.cxx

index 6e20d4a3b7fa7369b6293781d98d31e07e3c68a1..34f4cbbbf2391f1276d56db796a6dbbefb7ed11e 100644 (file)
@@ -80,6 +80,11 @@ a simple, "hello world" dialog:
     <x>10</x>
     <y>50</y>
     <label>Hello, world</label>
+    <color>
+     <red>1.0</red>
+     <green>0.0</green>
+     <blue>0.0</blue>
+    </color>
    </text>
 
    <button>
@@ -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:
 </PropertyList>
 
 
-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:
 
   <group>
index ff263634e0c01457db6966b437d55bd5b25aa7e1..0a70deab589f1c74d3afbdca169508d4ef36f105 100644 (file)
@@ -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");