summaryrefslogtreecommitdiffstats
path: root/bundles
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2003-02-28 22:50:11 +0000
committerFelipe Heidrich <fheidric>2003-02-28 22:50:11 +0000
commit0b01cef709770cee06399410b45cb5a2079c746f (patch)
treebdea3c0b5f56f4d45545ed38745ac23ce8443187 /bundles
parent267c533e816cb2810b67cfcbeb132088034f52fd (diff)
downloadeclipse.platform.swt-0b01cef709770cee06399410b45cb5a2079c746f.tar.gz
eclipse.platform.swt-0b01cef709770cee06399410b45cb5a2079c746f.tar.xz
eclipse.platform.swt-0b01cef709770cee06399410b45cb5a2079c746f.zip
32855
Diffstat (limited to 'bundles')
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolBar.java18
1 files changed, 12 insertions, 6 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolBar.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolBar.java
index 5398a41101..c9b8985e70 100755
--- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolBar.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolBar.java
@@ -213,14 +213,14 @@ void createItem (CoolItem item, int index) {
/*
* Feature in Windows. When inserting an item at end of a row,
- * eventually, Windows will begin to place the item on the right
- * side of the cool bar. The fix is to resize the next to last
- * item to the ideal size and resize the new items to the maximum
- * size.
+ * sometimes, Windows will begin to place the item on the right
+ * side of the cool bar. The fix is to resize the new items to
+ * the maximum size and then resize the next to last item to the
+ * ideal size.
*/
int lastIndex = getLastIndexOfRow (index - 1);
- if (index == lastIndex + 1) {
- resizeToPreferredWidth (lastIndex);
+ boolean fixLast = index == lastIndex + 1;
+ if (fixLast) {
rbBand.fMask |= OS.RBBIM_SIZE;
rbBand.cx = MAX_WIDTH;
}
@@ -241,6 +241,12 @@ void createItem (CoolItem item, int index) {
if (OS.SendMessage (handle, OS.RB_INSERTBAND, index, rbBand) == 0) {
error (SWT.ERROR_ITEM_NOT_ADDED);
}
+
+ /* Resize the next to last item to the ideal size */
+ if (fixLast) {
+ resizeToPreferredWidth (lastIndex);
+ }
+
OS.HeapFree (hHeap, 0, lpText);
items [item.id = id] = item;
int length = originalItems.length;