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