diff dwt/widgets/List.d @ 238:380bad9f6852

reverted char[] to String
author Frank Benoit <benoit@tionex.de>
date Mon, 05 May 2008 00:42:55 +0200
parents 0fca38f4a7c0
children 5a30aa9820f3
line wrap: on
line diff
--- a/dwt/widgets/List.d	Sat Apr 26 10:01:30 2008 +0200
+++ b/dwt/widgets/List.d	Mon May 05 00:42:55 2008 +0200
@@ -106,7 +106,7 @@
  *
  * @see #add(String,int)
  */
-public void add (char[] string) {
+public void add (String string) {
     checkWidget();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     char* buffer = toStringz(string);
@@ -138,7 +138,7 @@
  *
  * @see #add(String)
  */
-public void add (char[] string, int index) {
+public void add (String string, int index) {
     checkWidget();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
@@ -444,7 +444,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public char[] getItem (int index) {
+public String getItem (int index) {
     checkWidget();
     if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null)))  {
         error (DWT.ERROR_INVALID_RANGE);
@@ -454,7 +454,7 @@
     OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
     OS.gtk_tree_model_get1 (cast(GtkTreeStore*)modelHandle, &iter, 0, cast(void**)&ptr );
     if (ptr is null) return null;
-    char[] res = fromStringz( ptr ).dup;
+    String res = fromStringz( ptr ).dup;
     OS.g_free (ptr);
     return res;
 }
@@ -519,17 +519,17 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public char[] [] getItems () {
+public String [] getItems () {
     checkWidget();
     int count = OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null);
     char* ptr;
-    char[] [] result = new char[][]( count );
+    String [] result = new String[]( count );
     GtkTreeIter iter;
     for (int index=0; index<count; index++) {
         OS.gtk_tree_model_iter_nth_child (cast(GtkTreeStore*)modelHandle, &iter, null, index);
         OS.gtk_tree_model_get1 (cast(GtkTreeStore*)modelHandle, &iter, 0, cast(void**)&ptr);
         if (ptr !is null) {
-            char[] res = fromStringz( ptr ).dup;
+            String res = fromStringz( ptr ).dup;
             OS.g_free (ptr);
             result [index] = res;
         }
@@ -553,10 +553,10 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public char[] [] getSelection () {
+public String [] getSelection () {
     checkWidget();
     int [] indices = getSelectionIndices ();
-    char[] [] result = new char[][](indices.length);
+    String [] result = new String[](indices.length);
     for (int i=0; i<indices.length; i++) {
         result [i] = getItem (indices [i]);
     }
@@ -838,7 +838,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public int indexOf (char[] string) {
+public int indexOf (String string) {
     checkWidget();
     return indexOf (string, 0);
 }
@@ -862,10 +862,10 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public int indexOf (char[] string, int start) {
+public int indexOf (String string, int start) {
     checkWidget();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
-    char[] [] items = getItems ();
+    String [] items = getItems ();
     for (int i=start; i<items.length; i++) {
         if (items [i] ==/*eq*/ (string)) return i;
     }
@@ -987,7 +987,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void remove (char[] string) {
+public void remove (String string) {
     checkWidget();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     int index = indexOf (string, 0);
@@ -1285,7 +1285,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void setItem (int index, char[] string) {
+public void setItem (int index, String string) {
     checkWidget();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     if (!(0 <= index && index < OS.gtk_tree_model_iter_n_children (cast(GtkTreeStore*)modelHandle, null)))  {
@@ -1311,7 +1311,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void setItems (char[] [] items) {
+public void setItems (String [] items) {
     checkWidget();
     // DWT extension, allow null a null length list.
     //if (items is null) error (DWT.ERROR_NULL_ARGUMENT);
@@ -1324,7 +1324,7 @@
     OS.g_signal_handlers_unblock_matched (selection, OS.G_SIGNAL_MATCH_DATA, 0, 0, null, null, udCHANGED);
     GtkTreeIter iter;
     for (int i=0; i<items.length; i++) {
-        char[] string = items [i];
+        String string = items [i];
         char* buffer = toStringz(string);
         OS.gtk_list_store_append (cast(GtkListStore*)modelHandle, &iter);
         OS.gtk_list_store_set1 (cast(GtkListStore*)modelHandle, &iter, TEXT_COLUMN, buffer);
@@ -1445,7 +1445,7 @@
  * @see List#select(int[])
  * @see List#setSelection(int[])
  */
-public void setSelection (char[] [] items) {
+public void setSelection (String [] items) {
     checkWidget ();
     if (items is null) error (DWT.ERROR_NULL_ARGUMENT);
     deselectAll ();
@@ -1454,7 +1454,7 @@
     bool first = true;
     for (int i = 0; i < length; i++) {
         int index = 0;
-        char[] string = items [i];
+        String string = items [i];
         if (string !is null) {
             while ((index = indexOf (string, index)) !is -1) {
                 if ((style & DWT.MULTI) !is 0) {