diff dwt/graphics/GC.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 184ab53b7785
children 36f5cb12e1a2
line wrap: on
line diff
--- a/dwt/graphics/GC.d	Sat Apr 26 10:01:48 2008 +0200
+++ b/dwt/graphics/GC.d	Mon May 05 00:12:38 2008 +0200
@@ -581,7 +581,7 @@
             chars = logFont.lfFaceName;
         } else {
             chars = new wchar[OS.LF_FACESIZE];
-            char[] bytes = logFont.lfFaceName;
+            String bytes = logFont.lfFaceName;
             OS.MultiByteToWideChar (OS.CP_ACP, OS.MB_PRECOMPOSED, bytes.ptr, bytes.length, chars, chars.length);
         }
         int index = 0;
@@ -589,7 +589,7 @@
             if (chars [index] is 0) break;
             index++;
         }
-        char[] name = WCHARsToStr( chars[ 0 .. index ] );
+        String name = WCHARsToStr( chars[ 0 .. index ] );
         if (Compatibility.equalsIgnoreCase(name, "Courier")) { //$NON-NLS-1$
             name = "Courier New"; //$NON-NLS-1$
         }
@@ -2080,7 +2080,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public void drawString (char[] string, int x, int y) {
+public void drawString (String string, int x, int y) {
     drawString(string, x, y, false);
 }
 
@@ -2104,7 +2104,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public void drawString (char[] string, int x, int y, bool isTransparent) {
+public void drawString (String string, int x, int y, bool isTransparent) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
     if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
 //  TCHAR buffer = new TCHAR (getCodePage(), string, false);
@@ -2236,7 +2236,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public void drawText (char[] string, int x, int y) {
+public void drawText (String string, int x, int y) {
     drawText(string, x, y, DWT.DRAW_DELIMITER | DWT.DRAW_TAB);
 }
 
@@ -2260,7 +2260,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public void drawText (char[] string, int x, int y, bool isTransparent) {
+public void drawText (String string, int x, int y, bool isTransparent) {
     int flags = DWT.DRAW_DELIMITER | DWT.DRAW_TAB;
     if (isTransparent) flags |= DWT.DRAW_TRANSPARENT;
     drawText(string, x, y, flags);
@@ -2300,7 +2300,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public void drawText (char[] string, int x, int y, int flags) {
+public void drawText (String string, int x, int y, int flags) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
     if (string is null) DWT.error(DWT.ERROR_NULL_ARGUMENT);
     if (string.length is 0) return;
@@ -4686,7 +4686,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public Point stringExtent(char[] string) {
+public Point stringExtent(String string) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     checkGC(FONT);
@@ -4744,7 +4744,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public Point textExtent(char[] string) {
+public Point textExtent(String string) {
     return textExtent(string, DWT.DRAW_DELIMITER | DWT.DRAW_TAB);
 }
 
@@ -4779,7 +4779,7 @@
  *    <li>ERROR_GRAPHIC_DISPOSED - if the receiver has been disposed</li>
  * </ul>
  */
-public Point textExtent(char[] string, int flags) {
+public Point textExtent(String string, int flags) {
     if (handle is null) DWT.error(DWT.ERROR_GRAPHIC_DISPOSED);
     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     checkGC(FONT);
@@ -4830,7 +4830,7 @@
  *
  * @return a string representation of the receiver
  */
-override public char[] toString () {
+override public String toString () {
     if (isDisposed()) return "GC {*DISPOSED*}";
     return Format( "GC {{{}}", handle );
 }