Ignore:
Timestamp:
Jan 12, 2000, 1:41:20 PM (26 years ago)
Author:
sandervl
Message:

menu, resize/move fixes + ported Wine messagebox code

File:
1 edited

Legend:

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

    r2400 r2415  
    1 /* $Id: pmframe.cpp,v 1.10 2000-01-10 23:29:13 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.11 2000-01-12 12:40:45 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    107107  {
    108108    case WM_FORMATFRAME:
    109     {
    110       PSWP pswp = (PSWP)mp1,swpClient;
    111       RECTL *client = (PRECTL)mp2,rect;
    112       RECT winRect;
    113       INT ccount;
    114 
    115       if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc;
    116       dprintf(("PMFRAME: WM_FORMATFRAME %x",hwnd));
    117       RestoreOS2TIB();
    118       ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2);
    119       SetWin32TIB();
    120       dprintf(("Frame size: %d %d",win32wnd->getWindowWidth(),win32wnd->getWindowHeight()));
    121       win32wnd->MsgFormatFrame();
    122       //CB: todo: use result for WM_CALCVALIDRECTS
    123       mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    124       swpClient = &pswp[ccount-1];
    125       swpClient->x = rect.xLeft;
    126       swpClient->y = rect.yBottom;
    127       swpClient->cx = rect.xRight-rect.xLeft;
    128       swpClient->cy = rect.yTop-rect.yBottom;
    129       dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy));
    130       RestoreOS2TIB();
    131       return (MRESULT)ccount;
    132     }
     109        break;
    133110
    134111    case WM_MINMAXFRAME:
     
    141118      {
    142119        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W);
    143       } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
     120      }
     121      else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    144122      {
    145123        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W);
    146       } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
     124      }
     125      else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
    147126      {
    148127        win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W));
     
    277256      WINDOWPOS wp;
    278257      HWND      hParent = NULLHANDLE;
     258      RECTL rect;
     259      SWP swpClient = {0};
    279260
    280261        dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    281262
    282263        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
    283             goto PosChangedEnd;
     264        {
     265                swpClient.hwnd = win32wnd->getOS2WindowHandle();
     266                swpClient.hwndInsertBehind = 0;
     267                swpClient.x  = 0;
     268                swpClient.y  = 0;
     269                swpClient.cx = 0;
     270                swpClient.cy = 0;
     271                swpClient.fl = pswp->fl & ~SWP_ZORDER;
     272                WinSetMultWindowPos(thdb->hab, &swpClient, 1);
     273                goto PosChangedEnd;
     274        }
    284275
    285276        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     
    293284        OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
    294285
    295         win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     286        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     287                win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
     288
     289                win32wnd->MsgFormatFrame();
     290                //CB: todo: use result for WM_CALCVALIDRECTS
     291                mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
     292
     293                swpClient.hwnd = win32wnd->getOS2WindowHandle();
     294                swpClient.hwndInsertBehind = 0;
     295                swpClient.x  = rect.xLeft;
     296                swpClient.y  = rect.yBottom;
     297                swpClient.cx = rect.xRight-rect.xLeft;
     298                swpClient.cy = rect.yTop-rect.yBottom;
     299                //TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now
     300                swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW;
     301                WinSetMultWindowPos(thdb->hab, &swpClient, 1);
     302        }
    296303
    297304        if(win32wnd->CanReceiveSizeMsgs())
    298305          win32wnd->MsgPosChanged((LPARAM)&wp);
    299306
     307        //update child positions: rectWindow is in window coordinates
     308        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     309                FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
     310        }
     311
    300312PosChangedEnd:
    301         //update the client rect
    302         RECTL rectl;
    303 
    304         WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl);
    305         mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect());
    306         WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);
    307         mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());
    308 
    309         //calls WM_FORMATFRAME if SWP_SIZE is set
    310313        RestoreOS2TIB();
    311         rc = OldFrameProc(hwnd,msg,mp1,mp2);
    312         SetWin32TIB();
    313         //update child positions: rectWindow is in window coordinates
    314         FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
    315         RestoreOS2TIB();
    316         return rc;
     314        return (MRESULT)FALSE;
    317315    }
    318316
     
    320318    {
    321319      PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;
    322       UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP;
     320      UINT res = 0; //= CVR_ALIGNLEFT | CVR_ALIGNTOP;
    323321
    324322//CB: todo: use WM_NCCALCSIZE result
     
    334332
    335333      //CB: PM sets client window position
    336       RestoreOS2TIB();
    337       OldFrameProc(hwnd,msg,mp1,mp2);
    338       SetWin32TIB();
     334//      RestoreOS2TIB();
     335//      OldFrameProc(hwnd,msg,mp1,mp2);
     336//      SetWin32TIB();
    339337
    340338      RestoreOS2TIB();
Note: See TracChangeset for help on using the changeset viewer.