Show
Ignore:
Timestamp:
05/04/08 18:42:55 (4 years ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

reverted char[] to String

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • dwt/custom/CTabFolder.d

    r223 r238  
    1313module dwt.custom.CTabFolder; 
    1414 
     15import tango.util.log.Trace; 
    1516 
    1617import dwt.DWT; 
     
    412413     * that use double buffering which is true in both of these cases. 
    413414     */ 
    414     char[] platform = DWT.getPlatform(); 
     415    String platform = DWT.getPlatform(); 
    415416    if ("carbon"==platform || "gtk"==platform) return style; //$NON-NLS-1$ //$NON-NLS-2$ 
    416417 
     
    884885        count = items.length - showCount; 
    885886    } 
    886     char[] chevronString = count > 99 ? "99+" : to!(char[])(count); //$NON-NLS-1$ 
     887    String chevronString = count > 99 ? "99+" : to!(String)(count); //$NON-NLS-1$ 
    887888    switch (chevronImageState) { 
    888889        case NORMAL: { 
     
    13011302 * characters in the given string, return '\0'. 
    13021303 */ 
    1303 dchar _findMnemonic (char[] string) { 
     1304dchar _findMnemonic (String string) { 
    13041305    if (string is null) return '\0'; 
    13051306    int index = 0; 
     
    13131314    return '\0'; 
    13141315} 
    1315 char[] stripMnemonic (char[] string) { 
     1316String stripMnemonic (String string) { 
    13161317    int index = 0; 
    13171318    int length_ = string.length; 
     
    16431644} 
    16441645void initAccessible() { 
    1645     final Accessible accessible = getAccessible(); 
     1646    Accessible accessible = getAccessible(); 
    16461647    accessible.addAccessibleListener(new class() AccessibleAdapter { 
    16471648        public void getName(AccessibleEvent e) { 
    1648             char[] name = null; 
     1649            String name = null; 
    16491650            int childID = e.childID; 
    16501651            if (childID >= 0 && childID < items.length) { 
     
    16611662 
    16621663        public void getHelp(AccessibleEvent e) { 
    1663             char[] help = null; 
     1664            String help = null; 
    16641665            int childID = e.childID; 
    16651666            if (childID is ACC.CHILDID_SELF) { 
     
    16721673 
    16731674        public void getKeyboardShortcut(AccessibleEvent e) { 
    1674             char[] shortcut = null; 
     1675            String shortcut = null; 
    16751676            int childID = e.childID; 
    16761677            if (childID >= 0 && childID < items.length) { 
    1677                 char[] text = items[childID].getText(); 
     1678                String text = items[childID].getText(); 
    16781679                if (text !is null) { 
    16791680                    dchar mnemonic = _findMnemonic(text); 
     
    17431744 
    17441745        public void getDefaultAction(AccessibleControlEvent e) { 
    1745             char[] action = null; 
     1746            String action = null; 
    17461747            int childID = e.childID; 
    17471748            if (childID >= 0 && childID < items.length) { 
     
    18191820    }); 
    18201821 
    1821     addListener(DWT.Selection, new class(accessible) Listener { 
    1822         Accessible acc; 
    1823         this( Accessible acc ){ this.acc = acc; } 
     1822addListener(DWT.Selection, getInst(accessible) ); 
     1823    addListener(DWT.FocusIn, new class(accessible) Listener { 
     1824        Accessible acc2; 
     1825        this( Accessible acc2 ){ this.acc2 = acc2; } 
    18241826        public void handleEvent(Event event) { 
    1825             if (isFocusControl()) { 
     1827            if (this.outer.selectedIndex is -1) { 
     1828                acc2.setFocus(ACC.CHILDID_SELF); 
     1829            } else { 
     1830                acc2.setFocus(this.outer.selectedIndex); 
     1831            } 
     1832        } 
     1833    }); 
     1834
     1835Listener getInst(Accessible accessible ){ 
     1836    return new class/+accessible+/ Listener { 
     1837        //Accessible acc; 
     1838        //this( Accessible acc ){ this.acc = acc; } 
     1839        public void handleEvent(Event event) { 
     1840        Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1841        Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)this ); 
     1842        Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)this.outer ); 
     1843        //auto p = &this.outer.isFocusControl; 
     1844        //Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)p.ptr ); 
     1845        //Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)p.funcptr ); 
     1846        test(); 
     1847        Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1848//             if (this.outer.isFocusControl()) { 
     1849//         Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
    18261850                if (selectedIndex is -1) { 
    1827                     acc.setFocus(ACC.CHILDID_SELF); 
    1828                 } else { 
    1829                     acc.setFocus(selectedIndex); 
    1830                 } 
    1831             } 
    1832         } 
    1833     }); 
    1834  
    1835     addListener(DWT.FocusIn, new class(accessible) Listener { 
    1836         Accessible acc; 
    1837         this( Accessible acc ){ this.acc = acc; } 
    1838         public void handleEvent(Event event) { 
    1839             if (selectedIndex is -1) { 
    1840                 acc.setFocus(ACC.CHILDID_SELF); 
    1841             } else { 
    1842                 acc.setFocus(selectedIndex); 
    1843             } 
    1844         } 
    1845     }); 
     1851//         Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1852        //            acc.setFocus(ACC.CHILDID_SELF); 
     1853//         Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1854//                 } else { 
     1855//         Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1856//         //            acc.setFocus(this.outer.selectedIndex); 
     1857//         Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1858//                 } 
     1859        Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1860            } 
     1861        Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
     1862 
     1863        } 
     1864    }; 
     1865
     1866void test(){ 
     1867        Trace.formatln( "{} {}", __FILE__, __LINE__ ); 
    18461868} 
    18471869void onKeyDown (Event event) { 
     
    38733895        } 
    38743896    } 
    3875     static const char[] id = "CTabFolder_showList_Index"; //$NON-NLS-1$ 
     3897    static const String id = "CTabFolder_showList_Index"; //$NON-NLS-1$ 
    38763898    for (int i = 0; i < items.length; i++) { 
    38773899        CTabItem tab = items[i]; 
     
    39173939 
    39183940void _setToolTipText (int x, int y) { 
    3919     char[] oldTip = getToolTipText(); 
    3920     char[] newTip = _getToolTip(x, y); 
     3941    String oldTip = getToolTipText(); 
     3942    String newTip = _getToolTip(x, y); 
    39213943    if (newTip is null || newTip!=oldTip) { 
    39223944        setToolTipText(newTip); 
     
    40504072    return true; 
    40514073} 
    4052 char[] _getToolTip(int x, int y) { 
     4074String _getToolTip(int x, int y) { 
    40534075    if (showMin && minRect.contains(x, y)) return minimized ? DWT.getMessage("SWT_Restore") : DWT.getMessage("SWT_Minimize"); //$NON-NLS-1$ //$NON-NLS-2$ 
    40544076    if (showMax && maxRect.contains(x, y)) return maximized ? DWT.getMessage("SWT_Restore") : DWT.getMessage("SWT_Maximize"); //$NON-NLS-1$ //$NON-NLS-2$