Changeset 62

Show
Ignore:
Timestamp:
04/07/08 19:04:18 (6 months ago)
Author:
Chris Miller
Message:

Minor changes.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/win32/dfl/control.d

    r61 r62  
    17761776     
    17771777     
    1778     /// 
    1779     final void enabled(bool byes) // setter 
     1778    package final void _venabled(bool byes) 
    17801779    { 
    17811780        if(isHandleCreated) 
    17821781        { 
    1783             if(byes == enabled) 
    1784                 return; 
    1785              
    17861782            EnableWindow(hwnd, byes); 
    17871783            // Window events will update -wstyle-. 
     
    17961792    } 
    17971793     
     1794     
     1795    /// 
     1796    final void enabled(bool byes) // setter 
     1797    { 
     1798        if(byes) 
     1799            cbits |= CBits.ENABLED; 
     1800        else 
     1801            cbits &= ~CBits.ENABLED; 
     1802         
     1803        /+ 
     1804        if(!byes) 
     1805        { 
     1806            _venabled(false); 
     1807        } 
     1808        else 
     1809        { 
     1810            if(!parent || parent.enabled) 
     1811                _venabled(true); 
     1812        } 
     1813         
     1814        _propagateEnabledAmbience(); 
     1815        +/ 
     1816         
     1817        _venabled(byes); 
     1818    } 
     1819     
    17981820    /// 
    17991821    final bool enabled() // getter 
     
    18041826         
    18051827        return (wstyle & WS_DISABLED) == 0; 
     1828    } 
     1829     
     1830     
     1831    private void _propagateEnabledAmbience() 
     1832    { 
     1833        /+ // Isn't working... 
     1834        if(cbits & CBits.FORM) 
     1835            return; 
     1836         
     1837        bool en = enabled; 
     1838         
     1839        void pa(Control pc) 
     1840        { 
     1841            foreach(Control ctrl; pc.ccollection) 
     1842            { 
     1843                if(ctrl.cbits & CBits.ENABLED) 
     1844                { 
     1845                    _venabled(en); 
     1846                     
     1847                    pa(ctrl); 
     1848                } 
     1849            } 
     1850        } 
     1851         
     1852        pa(this); 
     1853        +/ 
    18061854    } 
    18071855     
     
    23752423        Color foreColor; 
    23762424        RightToLeft rightToLeft; 
     2425        //CBits cbits; 
     2426        bool enabled; 
    23772427         
    23782428         
     
    23862436                foreColor = ctrl.foreColor; 
    23872437                rightToLeft = ctrl.rightToLeft; 
     2438                //cbits = ctrl.cbits; 
     2439                enabled = ctrl.enabled; 
    23882440            } 
    23892441            /+else 
     
    23942446                foreColor = Color.empty; 
    23952447                rightToLeft = RightToLeft.INHERIT; 
     2448                //cbits = CBits.init; 
     2449                enabled = true; 
    23962450            }+/ 
    23972451        } 
     
    24542508            } 
    24552509        } 
     2510         
     2511        /+ 
     2512        if(newinfo.enabled != oldinfo.enabled) 
     2513        { 
     2514            if(cbits & CBits.ENABLED) 
     2515            { 
     2516                _venabled(newinfo.enabled); 
     2517                _propagateEnabledAmbience(); 
     2518            } 
     2519        } 
     2520        +/ 
    24562521    } 
    24572522     
     
    68566921        VSTYLE = 0x400000, // If not forced off. 
    68576922        FORMLOADED = 0x800000, // If not forced off. 
     6923        ENABLED = 0x1000000, // Enabled state, not considering the parent. 
    68586924    } 
    68596925     
    68606926    //CBits cbits = CBits.ALLOW_LAYOUT; 
    68616927    //CBits cbits = CBits.NONE; 
    6862     CBits cbits = CBits.VISIBLE | CBits.VSTYLE
     6928    CBits cbits = CBits.VISIBLE | CBits.VSTYLE | CBits.ENABLED
    68636929     
    68646930     
  • trunk/win32/dfl/groupbox.d

    r61 r62  
    154154                                COLORREF cr; 
    155155                                auto getThemeColor = cast(typeof(&GetThemeColor))GetProcAddress(hmuxt, "GetThemeColor"); 
     156                                auto gtcState = enabled ? (1 /*PBS_NORMAL*/) : (2 /*GBS_DISABLED*/); 
    156157                                if(getThemeColor 
    157                                     && 0 == getThemeColor(htd, 4 /*BP_GROUPBOX*/, 1 /*PBS_NORMAL*/, 3803 /*TMT_TEXTCOLOR*/, &cr)) 
     158                                    && 0 == getThemeColor(htd, 4 /*BP_GROUPBOX*/, gtcState, 3803 /*TMT_TEXTCOLOR*/, &cr)) 
    158159                                    c = Color.fromRgb(cr); 
    159160                                else 
    160                                     c = foreColor; 
     161                                    c = enabled ? foreColor : SystemColors.grayText; // ? 
    161162                                 
    162163                                Size tsz = g.measureText(txt, f, tfmt);