Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xbundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/CoolBar.java8
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java6
2 files changed, 10 insertions, 4 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 f4b25a4217..1863948288 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
@@ -28,7 +28,7 @@ import org.eclipse.swt.graphics.*;
* </p><p>
* <dl>
* <dt><b>Styles:</b></dt>
- * <dd>(none)</dd>
+ * <dd>FLAT</dd>
* <dt><b>Events:</b></dt>
* <dd>(none)</dd>
* </dl>
@@ -153,7 +153,8 @@ public Point computeSize (int wHint, int hHint, boolean changed) {
width = Math.max(width, rowWidth);
rowWidth = 0;
}
- rowWidth += rbBand.cxIdeal + rect.left + rect.right + INSET;
+ rowWidth += rbBand.cxIdeal + rect.left + INSET;
+ if ((style & SWT.FLAT) == 0) rowWidth += rect.right;
}
width = Math.max(width, rowWidth);
if (redraw) {
@@ -877,7 +878,8 @@ public void setWrapIndices (int [] indices) {
int widgetStyle () {
int bits = super.widgetStyle () | OS.CCS_NODIVIDER | OS.CCS_NORESIZE;
- bits |= OS.RBS_VARHEIGHT | OS.RBS_BANDBORDERS | OS.RBS_DBLCLKTOGGLE;
+ bits |= OS.RBS_VARHEIGHT | OS.RBS_DBLCLKTOGGLE;
+ if ((style & SWT.FLAT) == 0) bits |= OS.RBS_BANDBORDERS;
return bits;
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
index 849787c6ad..c4f5f74a08 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
@@ -18,7 +18,7 @@ import org.eclipse.swt.layout.*;
import org.eclipse.swt.events.*;
class CoolBarTab extends Tab {
- Button dropDownButton, lockedButton;
+ Button dropDownButton, lockedButton, flatButton;
/* Example widgets and group that contains them */
CoolBar coolBar;
@@ -74,6 +74,7 @@ class CoolBarTab extends Tab {
/* Compute the widget style */
int toolBarStyle = SWT.FLAT;
if (borderButton.getSelection()) style |= SWT.BORDER;
+ if (flatButton.getSelection()) style |= SWT.FLAT;
if (dropDownButton.getSelection()) itemStyle |= SWT.DROP_DOWN;
/*
@@ -201,6 +202,8 @@ class CoolBarTab extends Tab {
/* Create the extra widget */
borderButton = new Button (styleGroup, SWT.CHECK);
borderButton.setText ("SWT.BORDER");
+ flatButton = new Button (styleGroup, SWT.CHECK);
+ flatButton.setText ("SWT.FLAT");
Group itemGroup = new Group(styleGroup, SWT.NONE);
itemGroup.setLayout (new GridLayout ());
itemGroup.setLayoutData (new GridData (GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
@@ -256,6 +259,7 @@ class CoolBarTab extends Tab {
void setExampleWidgetState () {
super.setExampleWidgetState ();
borderButton.setSelection ((coolBar.getStyle () & SWT.BORDER) != 0);
+ flatButton.setSelection ((coolBar.getStyle () & SWT.FLAT) != 0);
dropDownButton.setSelection ((coolBar.getItem(0).getStyle () & SWT.DROP_DOWN) != 0);
setWidgetLocked ();
}

Back to the top