Changeset 253:cf113c9ff968

Show
Ignore:
Timestamp:
06/07/08 21:19:38 (4 months ago)
Author:
Frank Benoit <benoit@tionex.de>
branch:
default
Message:

Fix: removed debugging prints and reactivated the code.

Files:

Legend:

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

    r240 r253  
    1212 *******************************************************************************/ 
    1313module dwt.custom.CTabFolder; 
    14  
    15 import tango.util.log.Trace; 
    1614 
    1715import dwt.DWT; 
     
    18281826    }); 
    18291827 
    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 
    18311844    addListener(DWT.FocusIn, new class(accessible) Listener { 
    1832         Accessible acc2
    1833         this( Accessible acc2 ){ this.acc2 = acc2; } 
     1845        Accessible acc
     1846        this( Accessible a ){ this.acc = a; } 
    18341847        public void handleEvent(Event event) { 
    1835             if (this.outer.selectedIndex is -1) { 
    1836                 acc2.setFocus(ACC.CHILDID_SELF); 
     1848            if (selectedIndex is -1) { 
     1849                acc.setFocus(ACC.CHILDID_SELF); 
    18371850            } else { 
    1838                 acc2.setFocus(this.outer.selectedIndex); 
     1851                acc.setFocus(selectedIndex); 
    18391852            } 
    18401853        } 
    18411854    }); 
    18421855} 
    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 
    18771857void onKeyDown (Event event) { 
    18781858    switch (event.keyCode) { 
     
    27912771    } 
    27922772    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) { 
    27942774        int left = Math.min(oldX, topRightRect.x); 
    27952775        int right = Math.max(oldX + oldWidth, topRightRect.x + topRightRect.width); 
     
    33143294    redraw(); 
    33153295} 
    3316 void setSelection(int index, bool notify) {  
     3296void setSelection(int index, bool notify) { 
    33173297    int oldSelectedIndex = selectedIndex; 
    33183298    setSelection(index); 
     
    40274007bool updateTabHeight(bool force){ 
    40284008    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; 
    40304010    int oldHeight = tabHeight; 
    40314011    if (fixedTabHeight !is DWT.DEFAULT) {