Changeset 10

Show
Ignore:
Timestamp:
10/29/07 23:02:03 (5 years ago)
Author:
Chris Miller
Message:

DFL 0.9.6 revision 01

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/win32/0.9.6-release/dfl/collections.d

    r5 r10  
    265265                else 
    266266                { 
    267                     if(getObjectString(onval) == value) // ? 
    268                         return true
     267                    if(getObjectString(onval) == value) 
     268                        return idx
    269269                } 
    270270            } 
  • branches/win32/0.9.6-release/dfl/control.d

    r5 r10  
    10701070        +/ 
    10711071         
    1072         sdock = cast(DockStyle)sdock.init; // Can't be set at the same time. 
     1072        sdock = DockStyle.NONE; // Can't be set at the same time. 
    10731073    } 
    10741074     
     
    16931693        sdock = ds; 
    16941694        /+ 
    1695         anch = cast(AnchorStyles)anch.init; // Can't be set at the same time. 
     1695        anch = AnchorStyles.NONE; // Can't be set at the same time. 
    16961696        +/ 
    16971697         
     
    70597059        result.height = result.height - dpad.bottom - dpad.top; 
    70607060         
     7061        // Add scroll width. 
    70617062        if(scrollSize.width > clientSize.width) 
    70627063            result.width = result.width + (scrollSize.width - clientSize.width); 
     
    70647065            result.height = result.height + (scrollSize.height - clientSize.height); 
    70657066         
     7067        // Adjust scroll position. 
     7068        result.location = Point(result.location.x - scrollPosition.x, result.location.y - scrollPosition.y); 
     7069         
    70667070        return result; 
    70677071    } 
     
    71967200     
    71977201    const Size DEFAULT_SCALE = { 5, 13 }; 
    7198      
    7199      
    7200     protected: 
    72017202     
    72027203    /// 
     
    72417242        return (_style() & WS_VSCROLL) != 0; 
    72427243    } 
     7244     
     7245     
     7246    protected: 
    72437247     
    72447248     
     
    73097313                            case SB_THUMBTRACK: 
    73107314                            case SB_THUMBPOSITION: 
    7311                                 delta = cast(int)HIWORD(m.wParam) - yspos; 
     7315                                //delta = cast(int)HIWORD(m.wParam) - yspos; // Limited to 16-bits. 
     7316                                delta = si.nTrackPos - yspos; 
    73127317                                break; 
    73137318                            case SB_BOTTOM: 
     
    73717376                            case SB_THUMBTRACK: 
    73727377                            case SB_THUMBPOSITION: 
    7373                                 delta = cast(int)HIWORD(m.wParam) - xspos; 
     7378                                //delta = cast(int)HIWORD(m.wParam) - xspos; // Limited to 16-bits. 
     7379                                delta = si.nTrackPos - xspos; 
    73747380                                break; 
    73757381                            case SB_RIGHT: 
     
    75757581    /// 
    75767582    Control activeControl(); // getter 
    7577     /// ditto 
     7583     
    75787584    deprecated void activeControl(Control); // setter 
    75797585     
    7580     /// 
    75817586    deprecated bool activateControl(Control); 
    75827587} 
  • branches/win32/0.9.6-release/dfl/form.d

    r5 r10  
    733733                    | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); // Recalculate the frame. 
    734734            } 
     735             
     736            invalidate(true); 
    735737             
    736738            _resetSystemMenu(); 
  • branches/win32/0.9.6-release/dfl/groupbox.d

    r5 r10  
    5050        _initButton(); 
    5151         
    52         if(_defTextHeight.init == _defTextHeight) 
     52        if(DEFTEXTHEIGHT_INIT == _defTextHeight) 
    5353        { 
    5454            _recalcTextHeight(defaultFont); 
     
    122122    private: 
    123123     
    124     static int _defTextHeight = -1; 
     124    const int DEFTEXTHEIGHT_INIT = -1; 
     125    static int _defTextHeight = DEFTEXTHEIGHT_INIT; 
    125126    int _textHeight = -1; 
    126127     
  • branches/win32/0.9.6-release/dfl/internal/winapi.d

    r5 r10  
    11691169        LVN_FIRST = cast(UINT)-100, 
    11701170         
     1171        LVN_ITEMCHANGING = (LVN_FIRST - 0), 
     1172        LVN_ITEMCHANGED = (LVN_FIRST - 1), 
     1173         
     1174        LVN_BEGINLABELEDITA = LVN_FIRST - 5, 
     1175        LVN_BEGINLABELEDITW = LVN_FIRST - 75, 
     1176         
     1177        LVN_ENDLABELEDITA = LVN_FIRST - 6, 
     1178        LVN_ENDLABELEDITW = LVN_FIRST - 76, 
     1179         
    11711180        LVN_COLUMNCLICK = LVN_FIRST - 8, 
    11721181         
     
    14261435        SM_CYSMICON = 50, 
    14271436         
     1437        SM_CYSMCAPTION = 51, 
     1438         
    14281439        SM_CXSIZEFRAME = SM_CXFRAME, 
    14291440        SM_CYSIZEFRAME = SM_CYFRAME, 
     
    19161927     
    19171928     
     1929    struct TVITEMW 
     1930    { 
     1931        UINT mask; 
     1932        HTREEITEM hItem; 
     1933        UINT state; 
     1934        UINT stateMask; 
     1935        LPWSTR pszText; 
     1936        int cchTextMax; 
     1937        int iImage; 
     1938        int iSelectedImage; 
     1939        int cChildren; 
     1940        LPARAM lParam; 
     1941    } 
     1942    alias TVITEMW* LPTVITEMW; 
     1943    alias TVITEMW* PTVITEMW; 
     1944    alias TVITEMW TV_ITEMW; 
     1945    alias TVITEMW* LPTV_ITEMW; 
     1946    alias TVITEMW* PTV_ITEMW; 
     1947     
     1948     
    19181949    struct TVHITTESTINFO 
    19191950    { 
     
    19571988    alias NMTVDISPINFOA TV_DISPINFOA; 
    19581989    alias NMTVDISPINFOA* LPTV_DISPINFOA; 
     1990     
     1991     
     1992    struct NMTVDISPINFOW 
     1993    { 
     1994        NMHDR hdr; 
     1995        TVITEMW item; 
     1996    } 
     1997    alias NMTVDISPINFOW* LPNMTVDISPINFOW; 
     1998    alias NMTVDISPINFOW TV_DISPINFOW; 
     1999    alias NMTVDISPINFOW* LPTV_DISPINFOW; 
    19592000     
    19602001     
  • branches/win32/0.9.6-release/dfl/label.d

    r5 r10  
    350350        { 
    351351            case WM_GETDLGCODE: 
    352                 //m.result = 0
     352                super.wndProc(m)
    353353                //if(useMnemonic) 
    354                     m.result = DLGC_STATIC; 
     354                    m.result |= DLGC_STATIC; 
    355355                break; 
    356356             
  • branches/win32/0.9.6-release/dfl/listview.d

    r5 r10  
    19861986                    { 
    19871987                        case LVN_GETDISPINFOA: 
     1988                            if(dfl.internal.utf.useUnicode) 
     1989                                break; 
    19881990                            { 
    19891991                                LV_DISPINFOA* lvdi; 
  • branches/win32/0.9.6-release/dfl/menu.d

    r5 r10  
    9999                    fType = ~MFT_SEPARATOR; 
    100100                mii.cbSize = mii.sizeof; 
    101                 mii.fMask = MIIM_TYPE; 
     101                mii.fMask = MIIM_TYPE | MIIM_STATE; // Not setting the state can cause implicit disabled/gray if the text was empty. 
    102102                mii.fType = fType; 
     103                mii.fState = fState; 
    103104                //mii.dwTypeData = stringToStringz(txt); 
    104105                 
  • branches/win32/0.9.6-release/dfl/progressbar.d

    r5 r10  
    168168        super.onHandleCreated(ea); 
    169169         
    170         if(_min != _min.init || _max != _max.init
     170        if(_min != MIN_INIT || _max != MAX_INIT
    171171        { 
    172172            prevwproc(PBM_SETRANGE, 0, MAKELPARAM(_min, _max)); 
    173173        } 
    174174         
    175         if(_step != _step.init
     175        if(_step != STEP_INIT
    176176        { 
    177177            prevwproc(PBM_SETSTEP, _step, 0); 
    178178        } 
    179179         
    180         if(_val != _val.init
     180        if(_val != VAL_INIT
    181181        { 
    182182            prevwproc(PBM_SETPOS, _val, 0); 
     
    214214    private: 
    215215     
    216     int _min = 0, _max = 100, _step = 10, _val = 0; 
     216    const int MIN_INIT = 0; 
     217    const int MAX_INIT = 100; 
     218    const int STEP_INIT = 10; 
     219    const int VAL_INIT = 0; 
     220     
     221    int _min = MIN_INIT, _max = MAX_INIT, _step = STEP_INIT, _val = VAL_INIT; 
    217222     
    218223     
  • branches/win32/0.9.6-release/dfl/socket.d

    r5 r10  
    189189     
    190190     
    191     override void close() 
    192     { 
    193         unregisterEvent(this); 
    194         super.close(); 
     191    static if(is(typeof(&this.detach))) 
     192    { 
     193        override void detach() 
     194        { 
     195            unregisterEvent(this); 
     196            super.detach(); 
     197        } 
     198    } 
     199    else 
     200    { 
     201        override void close() 
     202        { 
     203            unregisterEvent(this); 
     204            super.close(); 
     205        } 
    195206    } 
    196207     
  • branches/win32/0.9.6-release/dfl/statusbar.d

    r5 r10  
    517517        super.onHandleCreated(ea); 
    518518         
    519         panels._setcurparts(); 
    520          
    521         if(_issimple && _simpletext.length) 
    522             _sendidxtext(255, 0, _simpletext); 
    523         prevwproc(SB_SIMPLE, cast(WPARAM)_issimple, 0); 
    524          
    525         panels._setcurparts(); 
     519        if(_issimple) 
     520        { 
     521            prevwproc(SB_SIMPLE, cast(WPARAM)true, 0); 
     522            panels._setcurparts(); 
     523            if(_simpletext.length) 
     524                _sendidxtext(255, 0, _simpletext); 
     525        } 
     526        else 
     527        { 
     528            panels._setcurparts(); 
     529            prevwproc(SB_SIMPLE, cast(WPARAM)false, 0); 
     530        } 
    526531    } 
    527532     
  • branches/win32/0.9.6-release/dfl/treeview.d

    r5 r10  
    17971797                            { 
    17981798                                case TVE_COLLAPSE: 
    1799                                     onAfterCollapse(new TreeViewEventArgs(cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 
    1800                                         TreeViewAction.COLLAPSE)); 
     1799                                    { 
     1800                                        scope TreeViewEventArgs tvea = new TreeViewEventArgs( 
     1801                                            cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 
     1802                                            TreeViewAction.COLLAPSE); 
     1803                                        onAfterCollapse(tvea); 
     1804                                    } 
    18011805                                    break; 
    18021806                                 
    18031807                                case TVE_EXPAND: 
    1804                                     onAfterExpand(new TreeViewEventArgs(cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 
    1805                                         TreeViewAction.EXPAND)); 
     1808                                    { 
     1809                                        scope TreeViewEventArgs tvea = new TreeViewEventArgs( 
     1810                                            cast(TreeNode)cast(void*)nmtv.itemNew.lParam, 
     1811                                            TreeViewAction.EXPAND); 
     1812                                        onAfterExpand(tvea); 
     1813                                    } 
    18061814                                    break; 
    18071815                                 
     
    18211829                                TV_DISPINFOA* nmdi; 
    18221830                                nmdi = cast(TV_DISPINFOA*)nmh; 
    1823                                 NodeLabelEditEventArgs nleea; 
    18241831                                TreeNode node; 
    18251832                                node = cast(TreeNode)cast(void*)nmdi.item.lParam; 
    1826                                 // The nleea.label should contain the NEW text, which 
    1827                                 // there is no new text before it's edited... ? 
    1828                                 // TODO: check if correct implementation. 
    1829                                 nleea = new NodeLabelEditEventArgs(node /+ , node.text +/); 
     1833                                scope NodeLabelEditEventArgs nleea = new NodeLabelEditEventArgs(node); 
    18301834                                onBeforeLabelEdit(nleea); 
    18311835                                m.result = nleea.cancelEdit; 
     
    18341838                         
    18351839                        case TVN_ENDLABELEDITW: 
    1836                             goto end_label_edit; 
     1840                            { 
     1841                                char[] label; 
     1842                                TV_DISPINFOW* nmdi; 
     1843                                nmdi = cast(TV_DISPINFOW*)nmh; 
     1844                                if(nmdi.item.pszText) 
     1845                                { 
     1846                                    TreeNode node; 
     1847                                    node = cast(TreeNode)cast(void*)nmdi.item.lParam; 
     1848                                    label = fromUnicodez(nmdi.item.pszText); 
     1849                                    scope NodeLabelEditEventArgs nleea = new NodeLabelEditEventArgs(node, label); 
     1850                                    onAfterLabelEdit(nleea); 
     1851                                    if(nleea.cancelEdit) 
     1852                                    { 
     1853                                        m.result = FALSE; 
     1854                                    } 
     1855                                    else 
     1856                                    { 
     1857                                        // TODO: check if correct implementation. 
     1858                                        // Update the node's cached text.. 
     1859                                        node.ttext = label; 
     1860                                         
     1861                                        m.result = TRUE; 
     1862                                    } 
     1863                                } 
     1864                            } 
     1865                            break; 
    18371866                         
    18381867                        case TVN_ENDLABELEDITA: 
    18391868                            if(dfl.internal.utf.useUnicode) 
    18401869                                break; 
    1841                             end_label_edit: 
    1842                              
    18431870                            { 
    18441871                                char[] label; 
    18451872                                TV_DISPINFOA* nmdi; 
    18461873                                nmdi = cast(TV_DISPINFOA*)nmh; 
    1847                                 NodeLabelEditEventArgs nleea; 
    1848                                 TreeNode node; 
    1849                                 // TODO: check if correct implementation. 
    1850                                 node = cast(TreeNode)cast(void*)nmdi.item.lParam; 
    18511874                                if(nmdi.item.pszText) 
    1852                                     label = stringFromStringz(nmdi.item.pszText).dup; 
    1853                                 nleea = new NodeLabelEditEventArgs(node, label); 
    1854                                 if(!nmdi.item.pszText) 
    1855                                     nleea.cancelEdit = true; 
    1856                                 onAfterLabelEdit(nleea); 
    1857                                 if(nleea.cancelEdit) 
    18581875                                { 
    1859                                     m.result = FALSE; 
    1860                                 } 
    1861                                 else 
    1862                                 { 
    1863                                     // TODO: check if correct implementation. 
    1864                                     // Update the node's cached text.. 
    1865                                     node.ttext = label; 
    1866                                      
    1867                                     m.result = TRUE; 
     1876                                    TreeNode node; 
     1877                                    node = cast(TreeNode)cast(void*)nmdi.item.lParam; 
     1878                                    label = fromAnsiz(nmdi.item.pszText); 
     1879                                    scope NodeLabelEditEventArgs nleea = new NodeLabelEditEventArgs(node, label); 
     1880                                    onAfterLabelEdit(nleea); 
     1881                                    if(nleea.cancelEdit) 
     1882                                    { 
     1883                                        m.result = FALSE; 
     1884                                    } 
     1885                                    else 
     1886                                    { 
     1887                                        // TODO: check if correct implementation. 
     1888                                        // Update the node's cached text.. 
     1889                                        node.ttext = label; 
     1890                                         
     1891                                        m.result = TRUE; 
     1892                                    } 
    18681893                                } 
    18691894                            }