summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Northover <steve>2003-08-06 15:44:00 +0000
committerSteve Northover <steve>2003-08-06 15:44:00 +0000
commitda194abf36dfeaf1cef432501bc0d6c396c87dde (patch)
tree157b151f11c60c9f78bb52cc41b8458932c6d9fb
parent57469fb2ebb3dc1ee61c8eb4895aad2a79325273 (diff)
downloadeclipse.platform.swt-da194abf36dfeaf1cef432501bc0d6c396c87dde.tar.gz
eclipse.platform.swt-da194abf36dfeaf1cef432501bc0d6c396c87dde.tar.xz
eclipse.platform.swt-da194abf36dfeaf1cef432501bc0d6c396c87dde.zip
38415
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Combo.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Combo.java b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Combo.java
index ca2fc5cbe3..0709012cf8 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Combo.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/carbon/org/eclipse/swt/widgets/Combo.java
@@ -957,6 +957,9 @@ public void remove (int index) {
if (0 > index || index >= count) error (SWT.ERROR_INVALID_RANGE);
if ((style & SWT.READ_ONLY) != 0) {
OS.DeleteMenuItems (menuHandle, (short)(index+1), 1);
+ if (index == OS.GetControlValue (handle) - 1) {
+ OS.SetControl32BitValue (handle, 0);
+ }
} else {
OS.HIComboBoxRemoveItemAtIndex (handle, index);
}
@@ -989,7 +992,10 @@ public void remove (int start, int end) {
int newEnd = Math.min (end, count - 1);
if ((style & SWT.READ_ONLY) != 0) {
OS.DeleteMenuItems (menuHandle, (short)(start+1), newEnd-start+1);
- OS.SetControl32BitMaximum (handle, OS.CountMenuItems (menuHandle));
+ int index = OS.GetControlValue (handle) - 1;
+ if (start <= index && index <= end) {
+ OS.SetControl32BitValue (handle, 0);
+ }
} else {
// NEEDS WORK
for (int i=newEnd; i>=start; i--) {
@@ -1045,6 +1051,7 @@ public void removeAll () {
int count = getItemCount ();
if ((style & SWT.READ_ONLY) != 0) {
OS.DeleteMenuItems (menuHandle, (short)1, count);
+ OS.SetControl32BitValue (handle, 0);
} else {
// NEEDS WORK
if (count > 0) {