comparison dwt/browser/PromptDialog.d @ 288:4ee8c4237614

old branches... commit by mistake
author John Reimer<terminal.node@gmail.com>
date Tue, 05 Aug 2008 18:00:50 -0700
parents 93409d9838c5
children eec6ddb07873
comparison
equal deleted inserted replaced
287:9cbe6285f746 288:4ee8c4237614
5 * which accompanies this distribution, and is available at 5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html 6 * http://www.eclipse.org/legal/epl-v10.html
7 * 7 *
8 * Contributors: 8 * Contributors:
9 * IBM Corporation - initial API and implementation 9 * IBM Corporation - initial API and implementation
10 * Port to the D programming language:
11 * John Reimer <terminal.node@gmail.com>
10 *******************************************************************************/ 12 *******************************************************************************/
11 module dwt.browser.PromptDialog; 13 module dwt.browser.PromptDialog;
12 14
13 import dwt.dwthelper.utils; 15 import dwt.dwthelper.utils;
14 16
25 import dwt.widgets.Monitor; 27 import dwt.widgets.Monitor;
26 import dwt.widgets.Shell; 28 import dwt.widgets.Shell;
27 import dwt.widgets.Text; 29 import dwt.widgets.Text;
28 import dwt.widgets.Widget; 30 import dwt.widgets.Widget;
29 31
30 class PromptDialog extends Dialog { 32 class PromptDialog : Dialog {
31 33
32 PromptDialog(Shell parent, int style) { 34 this(Shell parent, int style) {
33 super(parent, style); 35 super(parent, style);
34 } 36 }
35 37
36 PromptDialog(Shell parent) { 38 this(Shell parent) {
37 this(parent, 0); 39 this(parent, 0);
38 } 40 }
39 41
40 void alertCheck(String title, String text, String check, final int[] checkValue) { 42 void alertCheck(String title, String text, String check, /* final */ int[] checkValue) {
41 Shell parent = getParent(); 43 Shell parent = getParent();
42 final Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL); 44 /* final */ Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL);
43 if (title !is null) shell.setText(title); 45 if (title !is null) shell.setText(title);
44 GridLayout gridLayout = new GridLayout(); 46 GridLayout gridLayout = new GridLayout();
45 shell.setLayout(gridLayout); 47 shell.setLayout(gridLayout);
46 Label label = new Label(shell, DWT.WRAP); 48 Label label = new Label(shell, DWT.WRAP);
47 label.setText(text); 49 label.setText(text);
80 while (!shell.isDisposed()) { 82 while (!shell.isDisposed()) {
81 if (!display.readAndDispatch()) display.sleep(); 83 if (!display.readAndDispatch()) display.sleep();
82 } 84 }
83 } 85 }
84 86
85 void confirmEx(String title, String text, String check, String button0, String button1, String button2, int defaultIndex, final int[] checkValue, final int[] result) { 87 void confirmEx(String title, String text, String check, String button0, String button1, String button2, int defaultIndex, /* final */ int[] checkValue, /* final */ int[] result) {
86 Shell parent = getParent(); 88 Shell parent = getParent();
87 final Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL); 89 /* final */ Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL);
88 shell.setText(title); 90 shell.setText(title);
89 GridLayout gridLayout = new GridLayout(); 91 GridLayout gridLayout = new GridLayout();
90 shell.setLayout(gridLayout); 92 shell.setLayout(gridLayout);
91 Label label = new Label(shell, DWT.WRAP); 93 Label label = new Label(shell, DWT.WRAP);
92 label.setText(text); 94 label.setText(text);
160 while (!shell.isDisposed()) { 162 while (!shell.isDisposed()) {
161 if (!display.readAndDispatch()) display.sleep(); 163 if (!display.readAndDispatch()) display.sleep();
162 } 164 }
163 } 165 }
164 166
165 void prompt(String title, String text, String check, final String[] value, final int[] checkValue, final int[] result) { 167 void prompt(String title, String text, String check, /* final */ String[] value, /* final */ int[] checkValue, /* final */ int[] result) {
166 Shell parent = getParent(); 168 Shell parent = getParent();
167 final Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL); 169 /* final */ Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL);
168 if (title !is null) shell.setText(title); 170 if (title !is null) shell.setText(title);
169 GridLayout gridLayout = new GridLayout(); 171 GridLayout gridLayout = new GridLayout();
170 shell.setLayout(gridLayout); 172 shell.setLayout(gridLayout);
171 Label label = new Label(shell, DWT.WRAP); 173 Label label = new Label(shell, DWT.WRAP);
172 label.setText(text); 174 label.setText(text);
225 while (!shell.isDisposed()) { 227 while (!shell.isDisposed()) {
226 if (!display.readAndDispatch()) display.sleep(); 228 if (!display.readAndDispatch()) display.sleep();
227 } 229 }
228 } 230 }
229 231
230 void promptUsernameAndPassword(String title, String text, String check, final String[] user, final String[] pass, final int[] checkValue, final int[] result) { 232 void promptUsernameAndPassword(String title, String text, String check, /* final */ String[] user, /* final */ String[] pass, /* final */ int[] checkValue, /* final */ int[] result) {
231 Shell parent = getParent(); 233 Shell parent = getParent();
232 final Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL); 234 /* final */ Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL);
233 shell.setText(title); 235 shell.setText(title);
234 GridLayout gridLayout = new GridLayout(); 236 GridLayout gridLayout = new GridLayout();
235 shell.setLayout(gridLayout); 237 shell.setLayout(gridLayout);
236 Label label = new Label(shell, DWT.WRAP); 238 Label label = new Label(shell, DWT.WRAP);
237 label.setText(text); 239 label.setText(text);