summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorDuong Nguyen <dnguyen>2008-10-15 23:08:52 +0000
committerDuong Nguyen <dnguyen>2008-10-15 23:08:52 +0000
commiteac35a8050ebf170bb23fa5036371e3f84a17696 (patch)
treec449227c1d5d65e3fabc94d5f51c80dba1be274f /examples
parent32b7b3f95df79ca3c6ef5b7959f40169c0eba520 (diff)
downloadeclipse.platform.swt-eac35a8050ebf170bb23fa5036371e3f84a17696.tar.gz
eclipse.platform.swt-eac35a8050ebf170bb23fa5036371e3f84a17696.tar.xz
eclipse.platform.swt-eac35a8050ebf170bb23fa5036371e3f84a17696.zip
Rolling back fix for Bug 206173 - Permit SWT.DEFAULT as an argument to ScrolledComposite.setMinSize
Diffstat (limited to 'examples')
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet166.java4
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet188.java2
-rw-r--r--examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java3
3 files changed, 5 insertions, 4 deletions
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet166.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet166.java
index 70f7837170..14727f0357 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet166.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet166.java
@@ -36,7 +36,7 @@ public static void main(String[] args) {
Shell shell = new Shell(display);
shell.setLayout(new FillLayout());
- final ScrolledComposite scrollComposite = new ScrolledComposite(shell, SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
+ final ScrolledComposite scrollComposite = new ScrolledComposite(shell, SWT.V_SCROLL | SWT.BORDER);
final Composite parent = new Composite(scrollComposite, SWT.NONE);
for(int i = 0; i <= 50; i++) {
@@ -55,7 +55,7 @@ public static void main(String[] args) {
scrollComposite.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
Rectangle r = scrollComposite.getClientArea();
- scrollComposite.setMinSize(Math.max(300, r.width), SWT.DEFAULT);
+ scrollComposite.setMinSize(parent.computeSize(r.width, SWT.DEFAULT));
}
});
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet188.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet188.java
index a8842ecdae..e36ae508d4 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet188.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet188.java
@@ -41,7 +41,7 @@ public static void main (String [] args) {
sc.setContent(c);
sc.setExpandHorizontal(true);
sc.setExpandVertical(true);
- sc.setMinSize(SWT.DEFAULT, SWT.DEFAULT);
+ sc.setMinSize(c.computeSize(SWT.DEFAULT, SWT.DEFAULT));
sc.setShowFocusedControl(true);
shell.setSize(300, 500);
diff --git a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java
index 2350a45996..e3ea978bff 100644
--- a/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java
+++ b/examples/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet5.java
@@ -46,7 +46,8 @@ public static void main (String [] args)
c2.setContent(b2);
c2.setExpandHorizontal(true);
c2.setExpandVertical(true);
- c2.setMinSize(400, 400);
+ c2.setMinWidth(400);
+ c2.setMinHeight(400);
shell.setSize(600, 300);
shell.open ();