1 | /*
|
---|
2 | * SWT009_07.java
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (c) 2002, 2005 EclipseOS2 Team.
|
---|
7 | * This file is made available under the terms of the Common Public License v1.0
|
---|
8 | * which accompanies this distribution, and is available at
|
---|
9 | * http://www.eclipse.org/legal/cpl-v10.html
|
---|
10 | */
|
---|
11 |
|
---|
12 | import org.eclipse.swt.widgets.Display;
|
---|
13 | import org.eclipse.swt.widgets.Shell;
|
---|
14 | import org.eclipse.swt.SWT;
|
---|
15 | import org.eclipse.swt.widgets.*;
|
---|
16 | import org.eclipse.swt.layout.FillLayout;
|
---|
17 | import org.eclipse.swt.layout.GridLayout;
|
---|
18 | import org.eclipse.swt.layout.GridData;
|
---|
19 | import org.eclipse.swt.graphics.*;
|
---|
20 |
|
---|
21 | public class SWT009_07 extends SWTTestCase {
|
---|
22 |
|
---|
23 | static {
|
---|
24 | STEP = "009";
|
---|
25 | TEST = "07";
|
---|
26 | DESC = "Group";
|
---|
27 | }
|
---|
28 |
|
---|
29 | final static String imageDir = System.getProperty ("user.dir") + "/tests/SWT/images/";
|
---|
30 |
|
---|
31 | Shell createTopShell(Display display) {
|
---|
32 | return new Shell(display, SWT.SHELL_TRIM | SWT.NO_REDRAW_RESIZE);
|
---|
33 | }
|
---|
34 |
|
---|
35 |
|
---|
36 | void initComponents() {
|
---|
37 | final Class clazz = SWT009_07.class;
|
---|
38 | shell.setText("Hello World Group");
|
---|
39 | shell.setSize(290, 200);
|
---|
40 | shell.setText("A Group Example");
|
---|
41 | final Group g = new Group(shell, SWT.SHADOW_ETCHED_IN);
|
---|
42 | g.setBounds(5,5,260,90);
|
---|
43 | g.setText("Options Group A");
|
---|
44 | final Button b1;
|
---|
45 | final Button b2;
|
---|
46 | final Button b3;
|
---|
47 | b1 = new Button(g, SWT.RADIO);
|
---|
48 | b1.setBounds(10, 25, 240, 15);
|
---|
49 | b1.setText("Option One, Opcion Uno");
|
---|
50 | b2 = new Button(g, SWT.RADIO);
|
---|
51 | b2.setBounds(10,45, 240, 15);
|
---|
52 | b2.setText("Option Two, Opcion Dos");
|
---|
53 | b3 = new Button(g, SWT.RADIO);
|
---|
54 | b3.setBounds(10, 65, 240, 15);
|
---|
55 | b3.setText("Option Three, Opcion Tres");
|
---|
56 | //g.pack();
|
---|
57 | //g.setLocation(20, 20);
|
---|
58 |
|
---|
59 | //
|
---|
60 | final Group g2 = new Group(shell, SWT.SHADOW_ETCHED_IN);
|
---|
61 | g2.setBounds(5,105,260,90);
|
---|
62 | g2.setText("Options Group B");
|
---|
63 | final Button optionGrupoB_1;
|
---|
64 | final Button optionGrupoB_2;
|
---|
65 | final Button optionGrupoB_3;
|
---|
66 | optionGrupoB_1 = new Button(g2, SWT.RADIO);
|
---|
67 | optionGrupoB_1.setBounds(10, 25, 240, 15);
|
---|
68 | optionGrupoB_1.setText("Option B One, Opcion Uno");
|
---|
69 | optionGrupoB_2= new Button(g2, SWT.RADIO);
|
---|
70 | optionGrupoB_2.setBounds(10,45, 240, 15);
|
---|
71 | optionGrupoB_2.setText("Option B Two, Opcion Dos");
|
---|
72 | optionGrupoB_3 = new Button(g2, SWT.RADIO);
|
---|
73 | optionGrupoB_3.setBounds(10, 65, 240, 15);
|
---|
74 | optionGrupoB_3.setText("Option B Three, Opcion Tres");
|
---|
75 | //
|
---|
76 |
|
---|
77 | shell.open();
|
---|
78 | }
|
---|
79 |
|
---|
80 |
|
---|
81 | void setTitle(String title) {
|
---|
82 | super.setTitle(title);
|
---|
83 | }
|
---|
84 |
|
---|
85 | public static void main(String[] args) {
|
---|
86 | go(new SWT009_07());
|
---|
87 | }
|
---|
88 |
|
---|
89 | }
|
---|