diff dwt/widgets/Text.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/Text.d	Sat Apr 26 10:01:48 2008 +0200
+++ b/dwt/widgets/Text.d	Mon May 05 00:12:38 2008 +0200
@@ -59,7 +59,7 @@
 
     int tabs, oldStart, oldEnd;
     bool doubleClick, ignoreModify, ignoreVerify, ignoreCharacter;
-    char[] message;
+    String message;
 
     /**
     * The maximum number of characters that can be entered
@@ -80,7 +80,7 @@
     * is queried and from the widget, it will be delimited using
     * this delimiter.
     */
-    public static const char[] DELIMITER = "\r\n";
+    public static const String DELIMITER = "\r\n";
 
     /*
     * This code is intentionally commented.
@@ -282,7 +282,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void append (char[] string) {
+public void append (String string) {
     checkWidget ();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     string = Display.withCrLf (string);
@@ -811,7 +811,7 @@
  *
  * @see #DELIMITER
  */
-public char[] getLineDelimiter () {
+public String getLineDelimiter () {
     checkWidget ();
     return DELIMITER;
 }
@@ -876,7 +876,7 @@
  *
  * @since 3.3
  */
-public char[] getMessage () {
+public String getMessage () {
     checkWidget ();
     return message;
 }
@@ -963,7 +963,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public char[] getSelectionText () {
+public String getSelectionText () {
     checkWidget ();
     int length = OS.GetWindowTextLength (handle);
     if (length is 0) return "";
@@ -1023,7 +1023,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public char[] getText () {
+public String getText () {
     checkWidget ();
     int length_ = OS.GetWindowTextLength (handle);
     if (length_ is 0) return "";
@@ -1050,7 +1050,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public char[] getText (int start, int end) {
+public String getText (int start, int end) {
     checkWidget ();
     if (!(start <= end && 0 <= end)) return "";
     int length = OS.GetWindowTextLength (handle);
@@ -1155,7 +1155,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void insert (char[] string) {
+public void insert (String string) {
     checkWidget ();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     string = Display.withCrLf (string);
@@ -1188,7 +1188,7 @@
     int cp = getCodePage ();
     int wcsTotal = 0, mbcsTotal = 0;
     char [] buffer = new char [128];
-    char[] delimiter = getLineDelimiter();
+    String delimiter = getLineDelimiter();
     int delimiterSize = delimiter.length;
     int count = OS.SendMessageA (handle, OS.EM_GETLINECOUNT, 0, 0);
     for (int line=0; line<count; line++) {
@@ -1372,7 +1372,7 @@
     }
 
     /* Verify the character */
-    char[] oldText = "";
+    String oldText = "";
     int start, end;
     OS.SendMessage (handle, OS.EM_GETSEL, &start, &end);
     switch (key) {
@@ -1423,7 +1423,7 @@
             oldText = [key];
             break;
     }
-    char[] newText = verifyText (oldText, start, end, event);
+    String newText = verifyText (oldText, start, end, event);
     if (newText is null) return false;
     if (newText is oldText) return true;
     newText = Display.withCrLf (newText);
@@ -1605,7 +1605,7 @@
  *
  * @since 3.3
  */
-public void setMessage (char[] message) {
+public void setMessage (String message) {
     checkWidget ();
     if (message is null) error (DWT.ERROR_NULL_ARGUMENT);
     this.message = message;
@@ -1823,7 +1823,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void setText (char[] string) {
+public void setText (String string) {
     checkWidget ();
     if (string is null) error (DWT.ERROR_NULL_ARGUMENT);
     string = Display.withCrLf (string);
@@ -1919,7 +1919,7 @@
     OS.SendMessage (handle, OS.EM_SCROLLCARET, 0, 0);
 }
 
-char[] verifyText (char[] string, int start, int end, Event keyEvent) {
+String verifyText (String string, int start, int end, Event keyEvent) {
     if (ignoreVerify) return string;
     Event event = new Event ();
     event.text = string;
@@ -1951,7 +1951,7 @@
     int cp = getCodePage ();
     int wcsTotal = 0, mbcsTotal = 0;
     char [] buffer = new char [128];
-    char[] delimiter = getLineDelimiter ();
+    String delimiter = getLineDelimiter ();
     int delimiterSize = delimiter.length;
     int count = OS.SendMessageA (handle, OS.EM_GETLINECOUNT, 0, 0);
     for (int line=0; line<count; line++) {
@@ -2022,7 +2022,7 @@
     return bits;
 }
 
-override char[] windowClass () {
+override String windowClass () {
     return TCHARsToStr(EditClass);
 }
 
@@ -2292,7 +2292,7 @@
     if (!hooks (DWT.Verify) && !filters (DWT.Verify)) return null;
     bool call = false;
     int start, end;
-    char[] newText = null;
+    String newText = null;
     switch (msg) {
         case OS.WM_CLEAR:
         case OS.WM_CUT:
@@ -2329,7 +2329,7 @@
         default:
     }
     if (newText !is null) {
-        char[] oldText = newText;
+        String oldText = newText;
         newText = verifyText (newText, start, end, null);
         if (newText is null) return LRESULT.ZERO;
         if (newText !=/*eq*/oldText) {