Changeset 95

Show
Ignore:
Timestamp:
02/05/06 04:51:39 (3 years ago)
Author:
Shawn Liu
Message:

minor bug of shortenText() fixed.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/current/win32/import/dwt/custom/clabel.d

    r82 r95  
    257257public char[] getText() { 
    258258    //checkWidget(); 
    259     return text
     259    return text.dup
    260260} 
    261261public char[] getToolTipText () { 
     
    710710 
    711711    // <Shawn> 
    712     // must make a copy of the the original text, or the orginal text will be changed !!! 
     712    // must make a copy of the the original text, otherwise the orginal text will be changed !!! 
    713713    char[] t = ts.dup; 
    714714    int w = gc.textExtent(ELLIPSIS).x; 
  • trunk/current/win32/import/dwt/custom/ctabitem.d

    r76 r95  
    145145 
    146146    // <Shawn> 
    147     // must make a copy of the the original text, or the orginal text will be changed !!! 
     147    // must make a copy of the the original text, otherwise the orginal text will be cut short !!! 
    148148    char[] t = string.dup; 
    149149    int ellipseWidth = gc.textExtent(ELLIPSIS, FLAGS).x; 
  • trunk/current/win32/import/dwt/custom/tabletreeitem.d

    r76 r95  
    479479public char[] getText(int index) { 
    480480    //checkWidget(); 
    481     if (0 <= index && index < texts.length) return texts[index]; 
     481 
     482    // <Shawn>  
     483    // some widget shorten the text when the draw space is too small,  
     484    // e.g. CLable,CTabItem, change the text with ... 
     485    // must make a copy in case the caller change the original text 
     486    if (0 <= index && index < texts.length) return texts[index].dup; 
    482487    return null; 
    483488} 
  • trunk/current/win32/import/dwt/graphics/gc.d

    r82 r95  
    26342634public Point textExtent(char[] string, int flags) { 
    26352635    if (handle is null) DWT.error(__FILE__, __LINE__, DWT.ERROR_GRAPHIC_DISPOSED); 
    2636     if (string is null) DWT.error(__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
     2636// <shawn> no need to do null check 
     2637//  if (string is null) DWT.error(__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    26372638    if (string.length == 0) { 
    26382639        SIZE size; 
  • trunk/current/win32/import/dwt/widgets/item.d

    r82 r95  
    142142    // e.g. CLable,CTabItem, change the text with ... 
    143143    // must make a copy in case the caller change the original text 
    144     return (text)
     144    return text.dup
    145145} 
    146146 
     
    187187    if (string is null) string = ""; 
    188188    // error(__FILE__, __LINE__, DWT.ERROR_NULL_ARGUMENT); 
    189     text = string
     189    text = string.dup
    190190} 
    191191