Changeset 35

Show
Ignore:
Timestamp:
02/23/08 04:03:19 (7 months ago)
Author:
Chris Miller
Message:

Changed MDI activation.

Files:

Legend:

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

    r34 r35  
    21582158        load(this, ea); 
    21592159         
    2160         /+ // Moved to Control.onVisibleChanged 
    21612160        if(!(Application._compat & DflCompat.FORM_LOAD_096)) 
    21622161        { 
    2163             _selonecontrol(); 
    2164         } 
    2165         +/ 
     2162            // Needed anyway because MDI client form needs it. 
     2163            HWND hwfocus = GetFocus(); 
     2164            if(!hwfocus || !IsChild(hwnd, hwfocus)) 
     2165                _selectNextControl(this, null, true, true, true, false); 
     2166        } 
    21662167    } 
    21672168     
     
    25512552                acceptButton.notifyDefault(false); 
    25522553        } 
     2554        _lastSel = GetFocus(); 
    25532555    } 
    25542556     
     
    27212723                    case WA_INACTIVE: 
    27222724                        _seldeactivate(); 
    2723                         _lastSel = GetFocus(); 
    27242725                        break; 
    27252726                     
     
    27282729                return; 
    27292730             
    2730             default: 
     2731            // Note: WM_MDIACTIVATE here is to the MDI child forms. 
     2732            case WM_MDIACTIVATE: 
     2733                if(cast(HWND)msg.lParam == hwnd) 
     2734                { 
     2735                    _selactivate(); 
     2736                } 
     2737                else if(cast(HWND)msg.wParam == hwnd) 
     2738                { 
     2739                    _seldeactivate(); 
     2740                } 
     2741                goto def_def; 
     2742             
     2743            default: def_def: 
    27312744                version(NO_MDI) 
    27322745                { 
     
    28722885                const bool mdistuff = false; 
    28732886            else 
    2874                 bool mdistuff = form.mdiClient && form.mdiClient.isHandleCreated && IsChild(form.mdiClient.handle, m.hWnd); 
     2887                bool mdistuff = form.mdiClient && form.mdiClient.isHandleCreated 
     2888                    && (form.mdiClient.handle == m.hWnd || IsChild(form.mdiClient.handle, m.hWnd)); 
    28752889             
    28762890            if(mdistuff)