Changeset 253:cf113c9ff968
- Timestamp:
- 06/07/08 21:19:38 (4 months ago)
- Files:
-
- dwt/custom/CTabFolder.d (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
dwt/custom/CTabFolder.d
r240 r253 12 12 *******************************************************************************/ 13 13 module dwt.custom.CTabFolder; 14 15 import tango.util.log.Trace;16 14 17 15 import dwt.DWT; … … 1828 1826 }); 1829 1827 1830 addListener(DWT.Selection, getInst(accessible) ); 1828 addListener(DWT.Selection, new class(accessible) Listener { 1829 Accessible acc; 1830 this( Accessible a ){ 1831 this.acc = a; 1832 } 1833 public void handleEvent(Event event) { 1834 if (isFocusControl()) { 1835 if (selectedIndex is -1) { 1836 acc.setFocus(ACC.CHILDID_SELF); 1837 } else { 1838 acc.setFocus(selectedIndex); 1839 } 1840 } 1841 } 1842 }); 1843 1831 1844 addListener(DWT.FocusIn, new class(accessible) Listener { 1832 Accessible acc 2;1833 this( Accessible a cc2 ){ this.acc2 = acc2; }1845 Accessible acc; 1846 this( Accessible a ){ this.acc = a; } 1834 1847 public void handleEvent(Event event) { 1835 if ( this.outer.selectedIndex is -1) {1836 acc 2.setFocus(ACC.CHILDID_SELF);1848 if (selectedIndex is -1) { 1849 acc.setFocus(ACC.CHILDID_SELF); 1837 1850 } else { 1838 acc 2.setFocus(this.outer.selectedIndex);1851 acc.setFocus(selectedIndex); 1839 1852 } 1840 1853 } 1841 1854 }); 1842 1855 } 1843 Listener getInst(Accessible accessible ){ 1844 return new class/+accessible+/ Listener { 1845 //Accessible acc; 1846 //this( Accessible acc ){ this.acc = acc; } 1847 public void handleEvent(Event event) { 1848 Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1849 Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)this ); 1850 Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)this.outer ); 1851 //auto p = &this.outer.isFocusControl; 1852 //Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)p.ptr ); 1853 //Trace.formatln( "{} {} {}", __FILE__, __LINE__, cast(void*)p.funcptr ); 1854 test(); 1855 Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1856 // if (this.outer.isFocusControl()) { 1857 // Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1858 if (selectedIndex is -1) { 1859 // Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1860 // acc.setFocus(ACC.CHILDID_SELF); 1861 // Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1862 // } else { 1863 // Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1864 // // acc.setFocus(this.outer.selectedIndex); 1865 // Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1866 // } 1867 Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1868 } 1869 Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1870 1871 } 1872 }; 1873 } 1874 void test(){ 1875 Trace.formatln( "{} {}", __FILE__, __LINE__ ); 1876 } 1856 1877 1857 void onKeyDown (Event event) { 1878 1858 switch (event.keyCode) { … … 2791 2771 } 2792 2772 if (oldX !is topRightRect.x || oldWidth !is topRightRect.width || 2793 oldY !is topRightRect.y || oldHeight !is topRightRect.height) { 2773 oldY !is topRightRect.y || oldHeight !is topRightRect.height) { 2794 2774 int left = Math.min(oldX, topRightRect.x); 2795 2775 int right = Math.max(oldX + oldWidth, topRightRect.x + topRightRect.width); … … 3314 3294 redraw(); 3315 3295 } 3316 void setSelection(int index, bool notify) { 3296 void setSelection(int index, bool notify) { 3317 3297 int oldSelectedIndex = selectedIndex; 3318 3298 setSelection(index); … … 4027 4007 bool updateTabHeight(bool force){ 4028 4008 int style = getStyle(); 4029 if (fixedTabHeight is 0 && (style & DWT.FLAT) !is 0 && (style & DWT.BORDER) is 0) highlight_header = 0; 4009 if (fixedTabHeight is 0 && (style & DWT.FLAT) !is 0 && (style & DWT.BORDER) is 0) highlight_header = 0; 4030 4010 int oldHeight = tabHeight; 4031 4011 if (fixedTabHeight !is DWT.DEFAULT) {
