Changeset 1572 for trunk/src


Ignore:
Timestamp:
Nov 3, 1999, 7:00:29 PM (26 years ago)
Author:
cbratschi
Message:

modal dialog fixes

Location:
trunk/src/user32
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/pmframe.cpp

    r1542 r1572  
    1 /* $Id: pmframe.cpp,v 1.17 1999-11-02 17:07:25 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.18 1999-11-03 18:00:25 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    241241        dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    242242
     243        //CB: show dialog in front of owner
     244        if (win32wnd->IsModalDialogOwner())
     245        {
     246          pswp->fl |= SWP_ZORDER;
     247          pswp->hwndInsertBehind = win32wnd->getOS2HwndModalDialog();
     248          if (pswp->fl & SWP_ACTIVATE)
     249          {
     250            pswp->fl &= ~SWP_ACTIVATE;
     251            WinSetWindowPos(win32wnd->getOS2HwndModalDialog(),0,0,0,0,0,SWP_ACTIVATE);
     252          }
     253        }
     254
    243255        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
    244256            goto RunDefFrameProc;
     
    394406        return rc;
    395407    }
     408
    396409    case WM_ACTIVATE:
    397410    {
     
    406419        WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));
    407420
     421        //CB: show owner behind the dialog
     422        if (win32wnd->IsModalDialog())
     423        {
     424          Win32BaseWindow *topOwner = win32wnd->getOwner()->getTopParent();
     425
     426          if (topOwner) WinSetWindowPos(topOwner->getOS2FrameWindowHandle(),hwnd,0,0,0,0,SWP_ZORDER);
     427        }
    408428
    409429        RestoreOS2TIB();
     
    433453       dprintf(("PMFRAME: WM_BUTTON1DOWN"));
    434454      #endif
     455
    435456      if (InSizeBox(win32wnd,(POINTS*)&mp1))
    436457      {
  • trunk/src/user32/win32dlg.cpp

    r1542 r1572  
    1 /* $Id: win32dlg.cpp,v 1.27 1999-11-02 17:07:25 cbratschi Exp $ */
     1/* $Id: win32dlg.cpp,v 1.28 1999-11-03 18:00:26 cbratschi Exp $ */
    22/*
    33 * Win32 Dialog Code for OS/2
     
    270270    if (!dialogFlags & DF_END) /* was EndDialog called in WM_INITDIALOG ? */
    271271    {
    272         topOwner->EnableWindow( FALSE );
    273         //CB: todo: make modal, implement modeless, remove FCF_TASKLIST
    274         //    emulate WinProcessDlg
    275         ShowWindow( SW_SHOW );
     272        HWND hwndOldDialog;
     273        BOOL bOldOwner;
     274
     275        fIsModalDialog = TRUE;
     276        topOwner->EnableWindow(FALSE);
     277
     278        bOldOwner = topOwner->IsModalDialogOwner();
     279        topOwner->setModalDialogOwner(TRUE);
     280        hwndOldDialog = topOwner->getOS2HwndModalDialog();
     281        topOwner->setOS2HwndModalDialog(OS2HwndFrame);
     282        ShowWindow(SW_SHOW);
    276283
    277284        //CB: 100% CPU usage, need a better solution with OSLibWinGetMsg
     
    327334        }
    328335#endif
    329         topOwner->EnableWindow( TRUE );
     336        topOwner->setModalDialogOwner(bOldOwner);
     337        topOwner->setOS2HwndModalDialog(hwndOldDialog);
     338        if (!bOldOwner) topOwner->EnableWindow(TRUE);
    330339    }
    331340    retval = idResult;
  • trunk/src/user32/win32wbase.cpp

    r1542 r1572  
    1 /* $Id: win32wbase.cpp,v 1.72 1999-11-02 17:07:25 cbratschi Exp $ */
     1/* $Id: win32wbase.cpp,v 1.73 1999-11-03 18:00:27 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    135135  fFirstShow       = TRUE;
    136136  fIsDialog        = FALSE;
     137  fIsModalDialogOwner = FALSE;
     138  OS2HwndModalDialog  = 0;
    137139  fInternalMsg     = FALSE;
    138140  fNoSizeMsg       = FALSE;
     
    213215        }
    214216    }
    215     else 
     217    else
    216218    if(fDestroyAll) {
    217         dprintf(("Destroying window %x %s", getWindowHandle(), windowNameA));
     219        dprintf(("Destroying window %x %s", getWindowHandle(), windowNameA));
    218220        setParent(NULL);  //or else we'll crash in the dtor of the ChildWindow class
    219221    }
     
    433435  if(WIDGETS_IsControl(this, BUTTON_CONTROL) && ((dwStyle & 0x0f) == BS_GROUPBOX))
    434436  {
    435         hwndLinkAfter = HWND_BOTTOM;
    436         dwStyle |= WS_CLIPSIBLINGS;
    437   }
    438   else 
     437        hwndLinkAfter = HWND_BOTTOM;
     438        dwStyle |= WS_CLIPSIBLINGS;
     439  }
     440  else
    439441  if(WIDGETS_IsControl(this, STATIC_CONTROL) && !(dwStyle & WS_GROUP)) {
    440         dwStyle |= WS_CLIPSIBLINGS;
     442        dwStyle |= WS_CLIPSIBLINGS;
    441443  }
    442444
     
    19921994    /* We can't activate a child window (WINE) */
    19931995    if(getStyle() & WS_CHILD)
    1994         showstate &= ~SWPOS_ACTIVATE;
     1996        showstate &= ~SWPOS_ACTIVATE;
    19951997
    19961998    if(showstate & SWPOS_SHOW) {
  • trunk/src/user32/win32wbase.h

    r1540 r1572  
    1 /* $Id: win32wbase.h,v 1.38 1999-11-01 19:11:45 sandervl Exp $ */
     1/* $Id: win32wbase.h,v 1.39 1999-11-03 18:00:29 cbratschi Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    148148         BOOL   ShowWindow(ULONG nCmdShow);
    149149         BOOL   SetWindowPos(HWND hwndInsertAfter, int x, int y, int cx, int cy, UINT fuFlags);
    150         BOOL   SetWindowPlacement(WINDOWPLACEMENT *winpos);
     150        BOOL   SetWindowPlacement(WINDOWPLACEMENT *winpos);
    151151         BOOL   DestroyWindow();
    152152         HWND   SetActiveWindow();
     
    165165         BOOL   IsWindow()                    { return TRUE; };
    166166         BOOL   IsDialog()                    { return fIsDialog; };
     167         BOOL   IsModalDialog()               { return fIsModalDialog; };
     168         BOOL   IsModalDialogOwner()          { return fIsModalDialogOwner; };
     169         VOID   setModalDialogOwner(BOOL fMDO)    { fIsModalDialogOwner = fMDO; };
     170         VOID   setOS2HwndModalDialog(HWND aHwnd) { OS2HwndModalDialog = aHwnd; };
     171         HWND   getOS2HwndModalDialog()       { return OS2HwndModalDialog; };
    167172         BOOL   CanReceiveSizeMsgs()          { return !fNoSizeMsg; };
    168173         BOOL   IsWindowDestroyed()           { return fIsDestroyed; };
     
    223228       ULONG getBorderHeight() { return borderHeight; };
    224229
    225 static  void  NC_AdjustRectInner(LPRECT rect, DWORD style, DWORD exStyle);
    226 static  void  NC_AdjustRectOuter(LPRECT rect, DWORD style, BOOL menu, DWORD exStyle);
    227 static  BOOL  WindowNeedsWMBorder( DWORD style, DWORD exStyle );
     230static  void  NC_AdjustRectInner(LPRECT rect, DWORD style, DWORD exStyle);
     231static  void  NC_AdjustRectOuter(LPRECT rect, DWORD style, BOOL menu, DWORD exStyle);
     232static  BOOL  WindowNeedsWMBorder( DWORD style, DWORD exStyle );
    228233
    229234       PVOID getOldWndProc() { return pOldWndProc; }
     
    265270        BOOL    fFirstShow;
    266271        BOOL    fIsDialog;
     272        BOOL    fIsModalDialog;
     273        BOOL    fIsModalDialogOwner;
     274        HWND    OS2HwndModalDialog;
    267275        BOOL    fInternalMsg;           //Used to distinguish between messages
    268276                                        //sent by PM and those sent by apps
     
    308316#ifndef OS2_INCLUDED
    309317        void  GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack );
    310         LONG  HandleWindowPosChanging(WINDOWPOS *winpos);
     318        LONG  HandleWindowPosChanging(WINDOWPOS *winpos);
    311319        LONG  HandleSysCommand(WPARAM wParam, POINT *pt32);
    312320
Note: See TracChangeset for help on using the changeset viewer.