Changeset 212:ab60f3309436 for dwt/custom/CTabItem.d
- Timestamp:
- 05/04/08 18:12:38 (7 months ago)
- Files:
-
- dwt/custom/CTabItem.d (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/custom/CTabItem.d
r155 r212 29 29 import dwt.widgets.Widget; 30 30 import dwt.custom.CTabFolder; 31 import dwt.dwthelper.utils; 31 32 32 33 /** … … 49 50 Control control; // the tab page 50 51 51 char[]toolTipText;52 char[]shortenedText;52 String toolTipText; 53 String shortenedText; 53 54 int shortenedTextWidth; 54 55 … … 69 70 static final int INTERNAL_SPACING = 4; 70 71 static final int FLAGS = DWT.DRAW_TRANSPARENT | DWT.DRAW_MNEMONIC; 71 static final char[]ELLIPSIS = "..."; //$NON-NLS-1$ // could use the ellipsis glyph on some platforms "\u2026"72 static final String ELLIPSIS = "..."; //$NON-NLS-1$ // could use the ellipsis glyph on some platforms "\u2026" 72 73 73 74 /** … … 149 150 } 150 151 151 char[] shortenText(GC gc, char[]text, int width) {152 String shortenText(GC gc, String text, int width) { 152 153 return useEllipses() 153 154 ? shortenText(gc, text, width, ELLIPSIS) … … 155 156 } 156 157 157 char[] shortenText(GC gc, char[] text, int width, char[]ellipses) {158 String shortenText(GC gc, String text, int width, String ellipses) { 158 159 if (gc.textExtent(text, FLAGS).x <= width) return text; 159 160 int ellipseWidth = gc.textExtent(ellipses, FLAGS).x; … … 777 778 * </ul> 778 779 */ 779 public char[]getToolTipText () {780 public String getToolTipText () { 780 781 checkWidget(); 781 782 if (toolTipText is null && shortenedText !is null) { 782 char[]text = getText();783 String text = getText(); 783 784 if (shortenedText!=text) return text; 784 785 } … … 812 813 Image image = getImage(); 813 814 int h = (image is null) ? 0 : image.getBounds().height; 814 char[]text = getText();815 String text = getText(); 815 816 if (font is null) { 816 817 h = Math.max(h, gc.textExtent(text, FLAGS).y); … … 832 833 w += image.getBounds().width; 833 834 } 834 char[]text = null;835 String text = null; 835 836 if (minimum) { 836 837 int minChars = parent.minChars; … … 997 998 } 998 999 } 999 public override void setText ( char[]string) {1000 public override void setText (String string) { 1000 1001 checkWidget(); 1001 1002 if (string is null) DWT.error (DWT.ERROR_NULL_ARGUMENT); … … 1020 1021 * </ul> 1021 1022 */ 1022 public void setToolTipText ( char[]string) {1023 public void setToolTipText (String string) { 1023 1024 checkWidget(); 1024 1025 toolTipText = string;
