diff dwt/browser/PromptDialog.d @ 302:bfe1c57259e3

More browser code ported
author John Reimer<terminal.node@gmail.com>
date Tue, 12 Aug 2008 21:11:17 -0700
parents eec6ddb07873
children 8198e6052012
line wrap: on
line diff
--- a/dwt/browser/PromptDialog.d	Tue Aug 12 02:43:31 2008 +0200
+++ b/dwt/browser/PromptDialog.d	Tue Aug 12 21:11:17 2008 -0700
@@ -233,7 +233,7 @@
         }   
     }
 
-    void promptUsernameAndPassword(String title, String text, String check, /* final */ String[] user, /* final */ String[] pass, /* final */ int[] checkValue, /* final */ int[] result) {
+    void promptUsernameAndPassword(String title, String text, String check, ref String user, ref String pass, ref int checkValue, ref int result) {
         Shell parent = getParent();
         /* final */ Shell shell = new Shell(parent, DWT.DIALOG_TRIM | DWT.APPLICATION_MODAL);
         shell.setText(title);
@@ -254,7 +254,7 @@
         //userLabel.setText(DWT.getMessage("SWT_Username")); //$NON-NLS-1$
         userLabel.setText("Username:");
         final Text userText = new Text(shell, DWT.BORDER);
-        if (user[0] !is null) userText.setText(user[0]);
+        if (user !is null) userText.setText(user);
         data = new GridData();
         data.horizontalAlignment = GridData.FILL;
         data.grabExcessHorizontalSpace = true;
@@ -264,7 +264,7 @@
         //passwordLabel.setText(DWT.getMessage("SWT_Password")); //$NON-NLS-1$
         passwordLabel.setText("Password:");
         final Text passwordText = new Text(shell, DWT.PASSWORD | DWT.BORDER);
-        if (pass[0] !is null) passwordText.setText(pass[0]);
+        if (pass !is null) passwordText.setText(pass);
         data = new GridData();
         data.horizontalAlignment = GridData.FILL;
         data.grabExcessHorizontalSpace = true;
@@ -273,17 +273,17 @@
         final Button[] buttons = new Button[3];
         Listener listener = new Listener() {
             public void handleEvent(Event event) {
-                if (buttons[0] !is null) checkValue[0] = buttons[0].getSelection() ? 1 : 0;
-                user[0] = userText.getText();
-                pass[0] = passwordText.getText();
-                result[0] = event.widget is buttons[1] ? 1 : 0;
+                if (buttons[0] !is null) checkValue = buttons[0].getSelection() ? 1 : 0;
+                user = userText.getText();
+                pass = passwordText.getText();
+                result = event.widget is buttons[1] ? 1 : 0;
                 shell.close();
             }   
         };
         if (check !is null) {
             buttons[0] = new Button(shell, DWT.CHECK);
             buttons[0].setText(check);
-            buttons[0].setSelection(checkValue[0] !is 0);
+            buttons[0].setSelection(checkValue !is 0);
             data = new GridData ();
             data.horizontalAlignment = GridData.BEGINNING;
             buttons[0].setLayoutData (data);