summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorCarolyn MacLeod <carolyn>2001-11-12 22:05:13 +0000
committerCarolyn MacLeod <carolyn>2001-11-12 22:05:13 +0000
commita8724a8380ab44bd070b00466410623a41ef846f (patch)
tree6846c89449e08c955db53dbbce4a0618560a1a0a /examples
parentb35573235708a590a9c8b2f34400ddcb7ddcd038 (diff)
downloadeclipse.platform.swt-a8724a8380ab44bd070b00466410623a41ef846f.tar.gz
eclipse.platform.swt-a8724a8380ab44bd070b00466410623a41ef846f.tar.xz
eclipse.platform.swt-a8724a8380ab44bd070b00466410623a41ef846f.zip
Added CoolBarTab
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ControlExample.java1
-rw-r--r--examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/CoolBarTab.java18
-rwxr-xr-xexamples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java1
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java18
4 files changed, 36 insertions, 2 deletions
diff --git a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ControlExample.java b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ControlExample.java
index 23b61bd065..191efd6c32 100755
--- a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ControlExample.java
+++ b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/ControlExample.java
@@ -41,6 +41,7 @@ public class ControlExample {
Tab [] tabs = new Tab [] {
new ButtonTab (this),
new ComboTab (this),
+ new CoolBarTab (this),
new DialogTab (this),
new LabelTab (this),
new ListTab (this),
diff --git a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/CoolBarTab.java b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/CoolBarTab.java
index 5b069cfc8c..45bfc6183c 100644
--- a/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/CoolBarTab.java
+++ b/examples/org.eclipse.swt.examples/org/eclipse/swt/examples/controlexample/CoolBarTab.java
@@ -68,6 +68,10 @@ class CoolBarTab extends Tab {
item.setToolTipText (ControlExample.getResourceString("SWT_PUSH"));
pushItem = new CoolItem (coolBar, SWT.NULL);
pushItem.setControl (toolBar);
+ Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = pushItem.computeSize(size.x, size.y);
+ pushItem.setSize(size);
+ pushItem.setPreferredSize(size);
/* create the dropdown toolbar */
toolBar = new ToolBar (coolBar, toolBarStyle);
@@ -81,6 +85,10 @@ class CoolBarTab extends Tab {
item.addSelectionListener (new DropDownSelectionListener());
dropDownItem = new CoolItem (coolBar, SWT.NULL);
dropDownItem.setControl (toolBar);
+ size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = dropDownItem.computeSize(size.x, size.y);
+ dropDownItem.setSize(size);
+ dropDownItem.setPreferredSize(size);
/* create the radio button toolbar */
toolBar = new ToolBar (coolBar, toolBarStyle);
@@ -95,6 +103,10 @@ class CoolBarTab extends Tab {
item.setToolTipText (ControlExample.getResourceString("SWT_RADIO"));
radioItem = new CoolItem (coolBar, SWT.NULL);
radioItem.setControl (toolBar);
+ size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = radioItem.computeSize(size.x, size.y);
+ radioItem.setSize(size);
+ radioItem.setPreferredSize(size);
/* create the check button toolbar */
toolBar = new ToolBar (coolBar, toolBarStyle);
@@ -112,7 +124,11 @@ class CoolBarTab extends Tab {
item.setToolTipText (ControlExample.getResourceString("SWT_CHECK"));
checkItem = new CoolItem (coolBar, SWT.NULL);
checkItem.setControl (toolBar);
-
+ size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = checkItem.computeSize(size.x, size.y);
+ checkItem.setSize(size);
+ checkItem.setPreferredSize(size);
+
/* if we have saved state, restore it */
if (order != null) {
coolBar.setItemLayout(order, wrapIndices, sizes);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
index 23b61bd065..191efd6c32 100755
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ControlExample.java
@@ -41,6 +41,7 @@ public class ControlExample {
Tab [] tabs = new Tab [] {
new ButtonTab (this),
new ComboTab (this),
+ new CoolBarTab (this),
new DialogTab (this),
new LabelTab (this),
new ListTab (this),
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 5b069cfc8c..45bfc6183c 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
@@ -68,6 +68,10 @@ class CoolBarTab extends Tab {
item.setToolTipText (ControlExample.getResourceString("SWT_PUSH"));
pushItem = new CoolItem (coolBar, SWT.NULL);
pushItem.setControl (toolBar);
+ Point size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = pushItem.computeSize(size.x, size.y);
+ pushItem.setSize(size);
+ pushItem.setPreferredSize(size);
/* create the dropdown toolbar */
toolBar = new ToolBar (coolBar, toolBarStyle);
@@ -81,6 +85,10 @@ class CoolBarTab extends Tab {
item.addSelectionListener (new DropDownSelectionListener());
dropDownItem = new CoolItem (coolBar, SWT.NULL);
dropDownItem.setControl (toolBar);
+ size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = dropDownItem.computeSize(size.x, size.y);
+ dropDownItem.setSize(size);
+ dropDownItem.setPreferredSize(size);
/* create the radio button toolbar */
toolBar = new ToolBar (coolBar, toolBarStyle);
@@ -95,6 +103,10 @@ class CoolBarTab extends Tab {
item.setToolTipText (ControlExample.getResourceString("SWT_RADIO"));
radioItem = new CoolItem (coolBar, SWT.NULL);
radioItem.setControl (toolBar);
+ size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = radioItem.computeSize(size.x, size.y);
+ radioItem.setSize(size);
+ radioItem.setPreferredSize(size);
/* create the check button toolbar */
toolBar = new ToolBar (coolBar, toolBarStyle);
@@ -112,7 +124,11 @@ class CoolBarTab extends Tab {
item.setToolTipText (ControlExample.getResourceString("SWT_CHECK"));
checkItem = new CoolItem (coolBar, SWT.NULL);
checkItem.setControl (toolBar);
-
+ size = toolBar.computeSize(SWT.DEFAULT, SWT.DEFAULT);
+ size = checkItem.computeSize(size.x, size.y);
+ checkItem.setSize(size);
+ checkItem.setPreferredSize(size);
+
/* if we have saved state, restore it */
if (order != null) {
coolBar.setItemLayout(order, wrapIndices, sizes);