diff dwt/custom/CTabItem.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 a5afe31f5cdd
children 36f5cb12e1a2
line wrap: on
line diff
--- a/dwt/custom/CTabItem.d	Sat Apr 26 10:01:48 2008 +0200
+++ b/dwt/custom/CTabItem.d	Mon May 05 00:12:38 2008 +0200
@@ -28,6 +28,7 @@
 import dwt.widgets.Item;
 import dwt.widgets.Widget;
 import dwt.custom.CTabFolder;
+import dwt.dwthelper.utils;
 
 /**
  * Instances of this class represent a selectable user interface object
@@ -48,8 +49,8 @@
     int x,y,width,height = 0;
     Control control; // the tab page
 
-    char[] toolTipText;
-    char[] shortenedText;
+    String toolTipText;
+    String shortenedText;
     int shortenedTextWidth;
 
     // Appearance
@@ -68,7 +69,7 @@
     static final int RIGHT_MARGIN = 4;
     static final int INTERNAL_SPACING = 4;
     static final int FLAGS = DWT.DRAW_TRANSPARENT | DWT.DRAW_MNEMONIC;
-    static final char[] ELLIPSIS = "..."; //$NON-NLS-1$ // could use the ellipsis glyph on some platforms "\u2026"
+    static final String ELLIPSIS = "..."; //$NON-NLS-1$ // could use the ellipsis glyph on some platforms "\u2026"
 
 /**
  * Constructs a new instance of this class given its parent
@@ -148,13 +149,13 @@
     return parent.simple;
 }
 
-char[] shortenText(GC gc, char[] text, int width) {
+String shortenText(GC gc, String text, int width) {
     return useEllipses()
         ? shortenText(gc, text, width, ELLIPSIS)
         : shortenText(gc, text, width, ""); //$NON-NLS-1$
 }
 
-char[] shortenText(GC gc, char[] text, int width, char[] ellipses) {
+String shortenText(GC gc, String text, int width, String ellipses) {
     if (gc.textExtent(text, FLAGS).x <= width) return text;
     int ellipseWidth = gc.textExtent(ellipses, FLAGS).x;
     int length = text.length;
@@ -776,10 +777,10 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public char[] getToolTipText () {
+public String getToolTipText () {
     checkWidget();
     if (toolTipText is null && shortenedText !is null) {
-        char[] text = getText();
+        String text = getText();
         if (shortenedText!=text) return text;
     }
     return toolTipText;
@@ -811,7 +812,7 @@
 int preferredHeight(GC gc) {
     Image image = getImage();
     int h = (image is null) ? 0 : image.getBounds().height;
-    char[] text = getText();
+    String text = getText();
     if (font is null) {
         h = Math.max(h, gc.textExtent(text, FLAGS).y);
     } else {
@@ -831,7 +832,7 @@
     if (image !is null && (isSelected || parent.showUnselectedImage)) {
         w += image.getBounds().width;
     }
-    char[] text = null;
+    String text = null;
     if (minimum) {
         int minChars = parent.minChars;
         text = minChars is 0 ? null : getText();
@@ -996,7 +997,7 @@
         parent.redrawTabs();
     }
 }
-public override void setText (char[] string) {
+public override void setText (String string) {
     checkWidget();
     if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT);
     if (string==getText()) return;
@@ -1019,7 +1020,7 @@
  *    <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li>
  * </ul>
  */
-public void setToolTipText (char[] string) {
+public void setToolTipText (String string) {
     checkWidget();
     toolTipText = string;
 }