Show
Ignore:
Timestamp:
05/04/08 18:42:55 (4 years ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

reverted char[] to String

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/widgets/Combo.d

    r200 r238  
    8080    GdkEventKey* gdkEventKey; 
    8181    int fixStart = -1, fixEnd = -1; 
    82     char[][] items; 
     82    String[] items; 
    8383    bool ignoreSelect, lockText; 
    8484 
     
    149149 * @see #add(String,int) 
    150150 */ 
    151 public void add (char[] string) { 
     151public void add (String string) { 
    152152    checkWidget(); 
    153153    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     
    178178 * @see #add(String) 
    179179 */ 
    180 public void add (char[] string, int index) { 
     180public void add (String string, int index) { 
    181181    checkWidget(); 
    182182    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     
    184184        error (DWT.ERROR_INVALID_RANGE); 
    185185    } 
    186     char[] [] newItems = new char[][]( items.length + 1 ); 
     186    String [] newItems = new String[]( items.length + 1 ); 
    187187    System.arraycopy (items, 0, newItems, 0, index); 
    188188    newItems [index] = string; 
     
    775775 * </ul> 
    776776 */ 
    777 public char[] getItem (int index) { 
     777public String getItem (int index) { 
    778778    checkWidget(); 
    779779    if (!(0 <= index && index < items.length)) { 
     
    830830 * </ul> 
    831831 */ 
    832 public char[] [] getItems () { 
    833     checkWidget(); 
    834     char[] [] result = new char[][](items.length); 
     832public String [] getItems () { 
     833    checkWidget(); 
     834    String [] result = new String[](items.length); 
    835835    System.arraycopy (items, 0, result, 0, items.length); 
    836836    return result; 
     
    938938 * </ul> 
    939939 */ 
    940 public char[] getText () { 
     940public String getText () { 
    941941    checkWidget(); 
    942942    if (entryHandle !is null) { 
     
    950950} 
    951951 
    952 char[] getText (int start, int stop) { 
     952String getText (int start, int stop) { 
    953953    /* 
    954954    * NOTE: The current implementation uses substring () 
     
    10491049        if (!ignoreSelect) { 
    10501050            auto ptr = OS.gtk_entry_get_text (entryHandle); 
    1051             char[] text = fromStringz(ptr).dup; 
     1051            String text = fromStringz(ptr).dup; 
    10521052            for (int i = 0; i < items.length; i++) { 
    10531053                if (items [i] ==/*eq*/ text) { 
     
    11261126    } 
    11271127    if (!hooks (DWT.Verify) && !filters (DWT.Verify)) return 0; 
    1128     char[] newText = verifyText ("", cast(int)/*64*/start_pos, cast(int)/*64*/end_pos); 
     1128    String newText = verifyText ("", cast(int)/*64*/start_pos, cast(int)/*64*/end_pos); 
    11291129    if (newText is null) { 
    11301130        OS.g_signal_stop_emission_by_name (entryHandle, OS.delete_text.ptr); 
     
    11571157    if (!hooks (DWT.Verify) && !filters (DWT.Verify)) return 0; 
    11581158    if (new_text is null || new_text_length is 0) return 0; 
    1159     char[] oldText = new_text[0..new_text_length]; 
     1159    String oldText = new_text[0..new_text_length]; 
    11601160    int pos; 
    11611161    pos = position; 
     
    11641164        pos = fromStringz(ptr).length; 
    11651165    } 
    1166     char[] newText = verifyText (oldText, pos, pos); 
     1166    String newText = verifyText (oldText, pos, pos); 
    11671167    if (newText !is oldText) { 
    11681168        int newStart, newEnd; 
     
    12171217 * </ul> 
    12181218 */ 
    1219 public int indexOf (char[] string) { 
     1219public int indexOf (String string) { 
    12201220    checkWidget(); 
    12211221    return indexOf (string, 0); 
     
    12411241 * </ul> 
    12421242 */ 
    1243 public int indexOf (char[] string, int start) { 
     1243public int indexOf (String string, int start) { 
    12441244    checkWidget(); 
    12451245    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     
    13261326        error (DWT.ERROR_INVALID_RANGE); 
    13271327    } 
    1328     char[] [] oldItems = items; 
    1329     char[] [] newItems = new char[][]( oldItems.length - 1 ); 
     1328    String [] oldItems = items; 
     1329    String [] newItems = new String[]( oldItems.length - 1 ); 
    13301330    System.arraycopy (oldItems, 0, newItems, 0, index); 
    13311331    System.arraycopy (oldItems, index + 1, newItems, index, oldItems.length - index - 1); 
     
    13721372        error (DWT.ERROR_INVALID_RANGE); 
    13731373    } 
    1374     char[] [] oldItems = items; 
    1375     char[] [] newItems = new char[][](oldItems.length - (end - start + 1)); 
     1374    String [] oldItems = items; 
     1375    String [] newItems = new String[](oldItems.length - (end - start + 1)); 
    13761376    System.arraycopy (oldItems, 0, newItems, 0, start); 
    13771377    System.arraycopy (oldItems, end + 1, newItems, start, oldItems.length - end - 1); 
     
    14191419 * </ul> 
    14201420 */ 
    1421 public void remove (char[] string) { 
     1421public void remove (String string) { 
    14221422    checkWidget(); 
    14231423    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     
    16421642 * </ul> 
    16431643 */ 
    1644 public void setItem (int index, char[] string) { 
     1644public void setItem (int index, String string) { 
    16451645    checkWidget(); 
    16461646    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     
    16781678 * </ul> 
    16791679 */ 
    1680 public void setItems (char[] [] items) { 
     1680public void setItems (String [] items) { 
    16811681    checkWidget(); 
    16821682    if (items is null) error (DWT.ERROR_NULL_ARGUMENT); 
     
    16851685    } 
    16861686    int count = this.items.length; 
    1687     this.items = new char[][](items.length); 
     1687    this.items = new String[](items.length); 
    16881688    System.arraycopy (items, 0, this.items, 0, items.length); 
    16891689    if (OS.GTK_VERSION >= OS.buildVERSION (2, 4, 0)) { 
     
    16931693        } 
    16941694        for (int i = 0; i < items.length; i++) { 
    1695             char[] string = items [i]; 
     1695            String string = items [i]; 
    16961696            char* buffer = toStringz(string); 
    16971697            OS.gtk_combo_box_insert_text (handle, i, buffer); 
     
    17051705        int i = 0; 
    17061706        while (i < items.length) { 
    1707             char[] string = items [i]; 
     1707            String string = items [i]; 
    17081708            char * buffer = toStringz(string); 
    17091709            auto item = OS.gtk_list_item_new_with_label (buffer); 
     
    18251825 * </ul> 
    18261826 */ 
    1827 public void setText (char[] string) { 
     1827public void setText (String string) { 
    18281828    checkWidget(); 
    18291829    if (string is null) error (DWT.ERROR_NULL_ARGUMENT); 
     
    18911891} 
    18921892 
    1893 override void setToolTipText (Shell shell, char[] newString) { 
     1893override void setToolTipText (Shell shell, String newString) { 
    18941894    if (entryHandle !is null) shell.setToolTipText (entryHandle, newString); 
    18951895    if (buttonHandle !is null) shell.setToolTipText (buttonHandle, newString); 
     
    19401940} 
    19411941 
    1942 char[] verifyText (char[] string, int start, int end) { 
     1942String verifyText (String string, int start, int end) { 
    19431943    if (string.length is 0 && start is end) return null; 
    19441944    Event event = new Event ();