diff dwt/widgets/FileDialog.d @ 212:ab60f3309436

reverted the char[] to String and use the an alias.
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:12:38 +0200
parents ee3ee677f5fc
children 36f5cb12e1a2
line wrap: on
line diff
--- a/dwt/widgets/FileDialog.d	Sat Apr 26 10:01:48 2008 +0200
+++ b/dwt/widgets/FileDialog.d	Mon May 05 00:12:38 2008 +0200
@@ -39,11 +39,11 @@
  * </p>
  */
 public class FileDialog : Dialog {
-    char[] [] filterNames;
-    char[] [] filterExtensions;
-    char[] [] fileNames;
-    char[] filterPath = "", fileName = "";
-    static final char[] FILTER = "*.*";
+    String [] filterNames;
+    String [] filterExtensions;
+    String [] fileNames;
+    String filterPath = "", fileName = "";
+    static final String FILTER = "*.*";
     static int BUFFER_SIZE = 1024 * 32;
     static bool USE_HOOK;
 
@@ -100,7 +100,7 @@
  *
  * @return the relative path of the file
  */
-public char[] getFileName () {
+public String getFileName () {
     return fileName;
 }
 
@@ -110,7 +110,7 @@
  *
  * @return the relative paths of the files
  */
-public char[] [] getFileNames () {
+public String [] getFileNames () {
     return fileNames;
 }
 
@@ -120,7 +120,7 @@
  *
  * @return the file extensions filter
  */
-public char[] [] getFilterExtensions () {
+public String [] getFilterExtensions () {
     return filterExtensions;
 }
 
@@ -130,7 +130,7 @@
  *
  * @return the list of filter names
  */
-public char[] [] getFilterNames () {
+public String [] getFilterNames () {
     return filterNames;
 }
 
@@ -143,7 +143,7 @@
  *
  * @see #setFilterExtensions
  */
-public char[] getFilterPath () {
+public String getFilterPath () {
     return filterPath;
 }
 
@@ -188,7 +188,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the dialog</li>
  * </ul>
  */
-public char[] open () {
+public String open () {
     auto hHeap = OS.GetProcessHeap ();
 
     /* Get the owner HWND for the dialog */
@@ -204,11 +204,11 @@
     OS.MoveMemory (lpstrTitle, buffer3.ptr, byteCount3);
 
     /* Compute filters and copy into lpstrFilter */
-    char[] strFilter = "";
+    String strFilter = "";
     if (filterNames is null) filterNames = null;
     if (filterExtensions is null) filterExtensions = null;
     for (int i=0; i<filterExtensions.length; i++) {
-        char[] filterName = filterExtensions [i];
+        String filterName = filterExtensions [i];
         if (i < filterNames.length) filterName = filterNames [i];
         strFilter = strFilter ~ filterName ~ '\0' ~ filterExtensions [i] ~ '\0';
     }
@@ -335,8 +335,8 @@
     lpstrFile = struct_.lpstrFile;
 
     /* Set the new path, file name and filter */
-    fileNames = new char[] [0];
-    char[] fullPath = null;
+    fileNames = new String [0];
+    String fullPath = null;
     if (success) {
 
         /* Use the character encoding for the default locale */
@@ -378,15 +378,15 @@
             * by a NULL character with 2 NULL characters at the end.
             */
             int count = 0;
-            fileNames = new char[][]( (style & DWT.MULTI) !is 0 ? 4 : 1 );
+            fileNames = new String[]( (style & DWT.MULTI) !is 0 ? 4 : 1 );
             int start = nFileOffset;
             do {
                 int end = start;
                 while (end < buffer.length && buffer[end] !is 0) end++;
-                char[] string = TCHARsToStr( buffer[ start .. end ] );
+                String string = TCHARsToStr( buffer[ start .. end ] );
                 start = end;
                 if (count is fileNames.length) {
-                    char[] [] newFileNames = new char[][]( fileNames.length + 4 );
+                    String [] newFileNames = new String[]( fileNames.length + 4 );
                     System.arraycopy (fileNames, 0, newFileNames, 0, fileNames.length);
                     fileNames = newFileNames;
                 }
@@ -396,14 +396,14 @@
             } while (start < buffer.length && buffer[start] !is 0);
 
             if (fileNames.length > 0) fileName = fileNames  [0];
-            char[] separator = "";
+            String separator = "";
             int length_ = filterPath.length;
             if (length_ > 0 && filterPath[length_ - 1] !is '\\') {
                 separator = "\\";
             }
             fullPath = filterPath ~ separator ~ fileName;
             if (count < fileNames.length) {
-                char[] [] newFileNames = new char[][]( count );
+                String [] newFileNames = new String[]( count );
                 System.arraycopy (fileNames, 0, newFileNames, 0, count);
                 fileNames = newFileNames;
             }
@@ -437,7 +437,7 @@
  *
  * @param string the file name
  */
-public void setFileName (char[] string) {
+public void setFileName (String string) {
     fileName = string;
 }
 
@@ -456,7 +456,7 @@
  * @see #setFilterNames to specify the user-friendly
  * names corresponding to the extensions
  */
-public void setFilterExtensions (char[] [] extensions) {
+public void setFilterExtensions (String [] extensions) {
     filterExtensions = extensions;
 }
 
@@ -474,7 +474,7 @@
  *
  * @see #setFilterExtensions
  */
-public void setFilterNames (char[] [] names) {
+public void setFilterNames (String [] names) {
     filterNames = names;
 }
 
@@ -495,7 +495,7 @@
  *
  * @see #setFilterExtensions
  */
-public void setFilterPath (char[] string) {
+public void setFilterPath (String string) {
     filterPath = string;
 }