Changeset 238:380bad9f6852 for dwt/custom/CTabFolder.d
- Timestamp:
- 05/04/08 18:42:55 (4 years ago)
- Files:
-
- dwt/custom/CTabFolder.d (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/custom/CTabFolder.d
r223 r238 13 13 module dwt.custom.CTabFolder; 14 14 15 import tango.util.log.Trace; 15 16 16 17 import dwt.DWT; … … 412 413 * that use double buffering which is true in both of these cases. 413 414 */ 414 char[]platform = DWT.getPlatform();415 String platform = DWT.getPlatform(); 415 416 if ("carbon"==platform || "gtk"==platform) return style; //$NON-NLS-1$ //$NON-NLS-2$ 416 417 … … 884 885 count = items.length - showCount; 885 886 } 886 char[] chevronString = count > 99 ? "99+" : to!(char[])(count); //$NON-NLS-1$887 String chevronString = count > 99 ? "99+" : to!(String)(count); //$NON-NLS-1$ 887 888 switch (chevronImageState) { 888 889 case NORMAL: { … … 1301 1302 * characters in the given string, return '\0'. 1302 1303 */ 1303 dchar _findMnemonic ( char[]string) {1304 dchar _findMnemonic (String string) { 1304 1305 if (string is null) return '\0'; 1305 1306 int index = 0; … … 1313 1314 return '\0'; 1314 1315 } 1315 char[] stripMnemonic (char[]string) {1316 String stripMnemonic (String string) { 1316 1317 int index = 0; 1317 1318 int length_ = string.length; … … 1643 1644 } 1644 1645 void initAccessible() { 1645 finalAccessible accessible = getAccessible();1646 Accessible accessible = getAccessible(); 1646 1647 accessible.addAccessibleListener(new class() AccessibleAdapter { 1647 1648 public void getName(AccessibleEvent e) { 1648 char[]name = null;1649 String name = null; 1649 1650 int childID = e.childID; 1650 1651 if (childID >= 0 && childID < items.length) { … … 1661 1662 1662 1663 public void getHelp(AccessibleEvent e) { 1663 char[]help = null;1664 String help = null; 1664 1665 int childID = e.childID; 1665 1666 if (childID is ACC.CHILDID_SELF) { … … 1672 1673 1673 1674 public void getKeyboardShortcut(AccessibleEvent e) { 1674 char[]shortcut = null;1675 String shortcut = null; 1675 1676 int childID = e.childID; 1676 1677 if (childID >= 0 && childID < items.length) { 1677 char[]text = items[childID].getText();1678 String text = items[childID].getText(); 1678 1679 if (text !is null) { 1679 1680 dchar mnemonic = _findMnemonic(text); … … 1743 1744 1744 1745 public void getDefaultAction(AccessibleControlEvent e) { 1745 char[]action = null;1746 String action = null; 1746 1747 int childID = e.childID; 1747 1748 if (childID >= 0 && childID < items.length) { … … 1819 1820 }); 1820 1821 1821 addListener(DWT.Selection, new class(accessible) Listener { 1822 Accessible acc; 1823 this( Accessible acc ){ this.acc = acc; } 1822 addListener(DWT.Selection, getInst(accessible) ); 1823 addListener(DWT.FocusIn, new class(accessible) Listener { 1824 Accessible acc2; 1825 this( Accessible acc2 ){ this.acc2 = acc2; } 1824 1826 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 } 1835 Listener 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__ ); 1826 1850 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 } 1866 void test(){ 1867 Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1846 1868 } 1847 1869 void onKeyDown (Event event) { … … 3873 3895 } 3874 3896 } 3875 static const char[]id = "CTabFolder_showList_Index"; //$NON-NLS-1$3897 static const String id = "CTabFolder_showList_Index"; //$NON-NLS-1$ 3876 3898 for (int i = 0; i < items.length; i++) { 3877 3899 CTabItem tab = items[i]; … … 3917 3939 3918 3940 void _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); 3921 3943 if (newTip is null || newTip!=oldTip) { 3922 3944 setToolTipText(newTip); … … 4050 4072 return true; 4051 4073 } 4052 char[]_getToolTip(int x, int y) {4074 String _getToolTip(int x, int y) { 4053 4075 if (showMin && minRect.contains(x, y)) return minimized ? DWT.getMessage("SWT_Restore") : DWT.getMessage("SWT_Minimize"); //$NON-NLS-1$ //$NON-NLS-2$ 4054 4076 if (showMax && maxRect.contains(x, y)) return maximized ? DWT.getMessage("SWT_Restore") : DWT.getMessage("SWT_Maximize"); //$NON-NLS-1$ //$NON-NLS-2$
