Merge branch 'subtree'
[fanfix.git] / src / jexer / TRadioGroup.java
index 7f8c99c404e31c410aa6b4ad1a0f7dda17606c20..d6bd7ff38ee34c2b71a3546fb1cf1347e29c1dfe 100644 (file)
@@ -60,6 +60,24 @@ public class TRadioGroup extends TWidget {
     // Constructors -----------------------------------------------------------
     // ------------------------------------------------------------------------
 
+    /**
+     * Public constructor.
+     *
+     * @param parent parent widget
+     * @param x column relative to parent
+     * @param y row relative to parent
+     * @param width width of group
+     * @param label label to display on the group box
+     */
+    public TRadioGroup(final TWidget parent, final int x, final int y,
+        final int width, final String label) {
+
+        // Set parent and window
+        super(parent, x, y, width, 2);
+
+        this.label = label;
+    }
+
     /**
      * Public constructor.
      *
@@ -239,7 +257,7 @@ public class TRadioGroup extends TWidget {
     public void setRequiresSelection(final boolean requiresSelection) {
         this.requiresSelection = requiresSelection;
         if (requiresSelection) {
-            if (getChildren().size() > 0) {
+            if ((getChildren().size() > 0) && (selectedButton == null)) {
                 setSelected(1);
             }
         }