Ignore:
Timestamp:
Jan 8, 2000, 5:47:50 PM (26 years ago)
Author:
cbratschi
Message:

* empty log message *

File:
1 edited

Legend:

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

    r2353 r2377  
    1 /* $Id: pmframe.cpp,v 1.7 2000-01-07 17:38:47 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.8 2000-01-08 16:47:47 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    210210}
    211211//******************************************************************************
     212//******************************************************************************
     213VOID FrameUpdateChildPositions(HWND hwnd)
     214{
     215  HENUM henum;
     216  HWND hchild;
     217  RECTL rectl;
     218
     219  henum = WinBeginEnumWindows(hwnd);
     220  while ((hchild = WinGetNextWindow(henum)) != NULLHANDLE)
     221  {
     222    Win32BaseWindow *child = Win32BaseWindow::GetWindowFromOS2FrameHandle(hchild);
     223
     224    if (child)
     225    {
     226      WinQueryWindowRect(child->getOS2FrameWindowHandle(),&rectl);
     227      mapOS2ToWin32Rect(child->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,child->getWindowRect());
     228      FrameUpdateChildPositions(child->getOS2WindowHandle());
     229    }
     230  }
     231  WinEndEnumWindows(henum);
     232}
     233//******************************************************************************
    212234//Win32 frame message handler
    213235//******************************************************************************
     
    273295      win32wnd->MsgFormatFrame();
    274296      //CB: todo: use result for WM_CALCVALIDRECTS
    275       mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    276       WinMapWindowPoints(WinQueryWindow(hwnd,QW_PARENT),hwnd,(PPOINTL)&rect,2);
    277       dprintf(("New client position: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop));
     297      mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    278298      swpClient = &pswp[ccount-1];
    279299      swpClient->x = rect.xLeft;
     
    281301      swpClient->cx = rect.xRight-rect.xLeft;
    282302      swpClient->cy = rect.yTop-rect.yBottom;
     303      dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy));
    283304      RestoreOS2TIB();
    284305      return (MRESULT)ccount;
     
    286307
    287308    case WM_MINMAXFRAME:
     309    {
     310      PSWP swp = (PSWP)mp1;
     311
     312      if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc;
    288313      dprintf(("PMFRAME: WM_MINMAXFRAME %x",hwnd));
    289       //CB: todo
     314      if ((swp->fl & SWP_MAXIMIZE) == SWP_MAXIMIZE)
     315      {
     316        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W);
     317      } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
     318      {
     319        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W);
     320      } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
     321      {
     322        win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W));
     323      }
    290324      goto RunDefFrameProc;
     325    }
    291326
    292327    case WM_QUERYBORDERSIZE:
     
    303338    case WM_BUTTON3DBLCLK:
    304339    {
    305         SWP swp;
    306 
    307         WinQueryWindowPos(hwnd,&swp);
    308         if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    309           goto RunDefFrameProc;
    310340        if (win32wnd->IsWindowCreated())
    311341        {
     
    330360    case WM_MOUSEMOVE:
    331361    {
    332         SWP swp;
    333 
    334         WinQueryWindowPos(hwnd,&swp);
    335         if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    336           goto RunDefFrameProc;
    337362        //OS/2 Window coordinates -> Win32 Window coordinates
    338363        if (win32wnd->IsWindowCreated())
     
    345370    {
    346371      DWORD res;
    347       SWP swp;
    348 
    349       WinQueryWindowPos(hwnd,&swp);
    350       if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    351         goto RunDefFrameProc;
    352372
    353373      // Only send this message if the window is enabled
     
    373393    case WM_PAINT:
    374394    {
    375         SWP swp;
    376 
    377         WinQueryWindowPos(hwnd,&swp);
    378         if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    379           goto RunDefFrameProc;
    380395        dprintf(("PMFRAME: WM_PAINT"));
     396        if (win32wnd->getStyle() & WS_MINIMIZE_W)
     397         goto RunDefFrameProc;
    381398        if (win32wnd->IsWindowCreated())
    382399          win32wnd->MsgNCPaint();
     
    416433
    417434        WinQueryWindowPos(hwnd, &swpOld);
    418 
    419435        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    420436            if (win32wnd->isChild()) {
     
    484500        RECTL rectl;
    485501
     502        WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl);
     503        mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect());
    486504        WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);
    487505        mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());
     
    490508        RestoreOS2TIB();
    491509        rc = OldFrameProc(hwnd,msg,mp1,mp2);
     510        SetWin32TIB();
     511        //update child positions: rectWindow is in window coordinates
     512        FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
     513        RestoreOS2TIB();
    492514        return rc;
    493515    }
Note: See TracChangeset for help on using the changeset viewer.