Changeset 30

Show
Ignore:
Timestamp:
02/20/08 19:36:12 (8 months ago)
Author:
Chris Miller
Message:

Form.onLoad/load now called at different time

Files:

Legend:

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

    r27 r30  
    140140    // When a Form is in showDialog, changing the dialogResult from NONE doesn't close the form. 
    141141    FORM_DIALOGRESULT_096 = 0x8, 
     142     
     143    // Call onLoad/load and focus a control at old time. 
     144    FORM_LOAD_096 = 0x10, 
    142145} 
    143146 
  • trunk/win32/dfl/control.d

    r29 r30  
    56335633            case WM_DESTROY: 
    56345634                cbits &= ~CBits.CREATED; 
     5635                if(!recreatingHandle) 
     5636                    cbits &= ~CBits.FORMLOADED; 
    56355637                _destroying(); 
    56365638                //if(!killing) 
     
    68296831        HAS_LAYOUT = 0x200000, 
    68306832        VSTYLE = 0x400000, // If not forced off. 
     6833        FORMLOADED = 0x800000, // If not forced off. 
    68316834    } 
    68326835     
  • trunk/win32/dfl/form.d

    r29 r30  
    488488            } 
    489489             
    490             // Load before shown. 
    491             // Not calling if recreating handle! 
    492             onLoad(EventArgs.empty); 
     490            if(Application._compat & DflCompat.FORM_LOAD_096) 
     491            { 
     492                // Load before shown. 
     493                // Not calling if recreating handle! 
     494                onLoad(EventArgs.empty); 
     495            } 
    493496        } 
    494497         
     
    18011804        } 
    18021805         
     1806        if(!(Application._compat & DflCompat.FORM_LOAD_096)) 
     1807        { 
     1808            if(visible) 
     1809            { 
     1810                if(!(cbits & CBits.FORMLOADED)) 
     1811                { 
     1812                    cbits |= CBits.FORMLOADED; 
     1813                    onLoad(EventArgs.empty); 
     1814                } 
     1815            } 
     1816        } 
     1817         
    18031818        super.onVisibleChanged(ea); 
    18041819    } 
     
    21382153    { 
    21392154        load(this, ea); 
     2155         
     2156        if(!(Application._compat & DflCompat.FORM_LOAD_096)) 
     2157        { 
     2158            _selonecontrol(); 
     2159        } 
    21402160    } 
    21412161     
     
    24912511     
    24922512     
     2513    private void _selonecontrol() 
     2514    { 
     2515        HWND hwfocus = GetFocus(); 
     2516        if(!hwfocus || hwfocus == hwnd) 
     2517        { 
     2518            _selectNextControl(this, null, true, true, true, false); 
     2519            if(!GetFocus()) 
     2520                select(); 
     2521        } 
     2522    } 
     2523     
     2524     
    24932525    package alias dfl.internal.utf.defDlgProc _defFormProc; 
    24942526     
     
    25312563                } 
    25322564                +/ 
    2533                 _selectNextControl(this, null, true, true, true, false); 
    2534                 if(!GetFocus()) 
    2535                     focus(); 
     2565                _selonecontrol(); 
    25362566                // Prevent DefDlgProc from getting this message because it'll focus controls it shouldn't. 
    25372567                return; 
     
    25422572                    if(GetActiveWindow() == msg.hWnd) 
    25432573                    { 
    2544                         if(!GetFocus()) 
    2545                             SetFocus(msg.hWnd); 
     2574                        _selonecontrol(); 
    25462575                    } 
    25472576                }