Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed2002-11-07 15:43:25 +0000
committerGrant Gayed2002-11-07 15:43:25 +0000
commit6a7d30056544d5a12c0e58e8be7a462799d68bc2 (patch)
tree2a26a2a2aecd63eb8970dc7a5ab3979e1f1d61e3
parent058b9db8285e30b2d98cb65ae7fd4e99e9205b65 (diff)
downloadeclipse.platform.swt-6a7d30056544d5a12c0e58e8be7a462799d68bc2.tar.gz
eclipse.platform.swt-6a7d30056544d5a12c0e58e8be7a462799d68bc2.tar.xz
eclipse.platform.swt-6a7d30056544d5a12c0e58e8be7a462799d68bc2.zip
25781
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java26
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Button.java26
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java26
3 files changed, 60 insertions, 18 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java
index 96ce8ae607..c1084a83c1 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Button.java
@@ -525,13 +525,27 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
void selectRadio () {
- int index = 0;
+ /*
+ * This code is intentionally commented. When two groups
+ * of radio buttons with the same parent are separated by
+ * another control, the correct behavior should be that
+ * the two groups act independently. This is consistent
+ * with radio tool and menu items. The commented code
+ * implements this behavior.
+ */
+// int index = 0;
+// Control [] children = parent._getChildren ();
+// while (index < children.length && children [index] != this) index++;
+// int i = index - 1;
+// while (i >= 0 && children [i].setRadioSelection (false)) --i;
+// int j = index + 1;
+// while (j < children.length && children [j].setRadioSelection (false)) j++;
+// setSelection (true);
Control [] children = parent._getChildren ();
- while (index < children.length && children [index] != this) index++;
- int i = index - 1;
- while (i >= 0 && children [i].setRadioSelection (false)) --i;
- int j = index + 1;
- while (j < children.length && children [j].setRadioSelection (false)) j++;
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ if (this != child) child.setRadioSelection (false);
+ }
setSelection (true);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Button.java
index 0be16f4295..7e9dc5c574 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/motif/org/eclipse/swt/widgets/Button.java
@@ -514,13 +514,27 @@ public void removeSelectionListener(SelectionListener listener) {
eventTable.unhook(SWT.DefaultSelection,listener);
}
void selectRadio () {
- int index = 0;
+ /*
+ * This code is intentionally commented. When two groups
+ * of radio buttons with the same parent are separated by
+ * another control, the correct behavior should be that
+ * the two groups act independently. This is consistent
+ * with radio tool and menu items. The commented code
+ * implements this behavior.
+ */
+// int index = 0;
+// Control [] children = parent._getChildren ();
+// while (index < children.length && children [index] != this) index++;
+// int i = index - 1;
+// while (i >= 0 && children [i].setRadioSelection (false)) --i;
+// int j = index + 1;
+// while (j < children.length && children [j].setRadioSelection (false)) j++;
+// setSelection (true);
Control [] children = parent._getChildren ();
- while (index < children.length && children [index] != this) index++;
- int i = index - 1;
- while (i >= 0 && children [i].setRadioSelection (false)) --i;
- int j = index + 1;
- while (j < children.length && children [j].setRadioSelection (false)) j++;
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ if (this != child) child.setRadioSelection (false);
+ }
setSelection (true);
}
/**
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
index 0062210017..d54f045a20 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/photon/org/eclipse/swt/widgets/Button.java
@@ -473,13 +473,27 @@ public void removeSelectionListener (SelectionListener listener) {
}
void selectRadio () {
- int index = 0;
+ /*
+ * This code is intentionally commented. When two groups
+ * of radio buttons with the same parent are separated by
+ * another control, the correct behavior should be that
+ * the two groups act independently. This is consistent
+ * with radio tool and menu items. The commented code
+ * implements this behavior.
+ */
+// int index = 0;
+// Control [] children = parent._getChildren ();
+// while (index < children.length && children [index] != this) index++;
+// int i = index - 1;
+// while (i >= 0 && children [i].setRadioSelection (false)) --i;
+// int j = index + 1;
+// while (j < children.length && children [j].setRadioSelection (false)) j++;
+// setSelection (true);
Control [] children = parent._getChildren ();
- while (index < children.length && children [index] != this) index++;
- int i = index - 1;
- while (i >= 0 && children [i].setRadioSelection (false)) --i;
- int j = index + 1;
- while (j < children.length && children [j].setRadioSelection (false)) j++;
+ for (int i=0; i<children.length; i++) {
+ Control child = children [i];
+ if (this != child) child.setRadioSelection (false);
+ }
setSelection (true);
}

Back to the top