Ignore:
Timestamp:
Jan 12, 2000, 6:37:29 PM (26 years ago)
Author:
cbratschi
Message:

fixed WM_CALCVALIDRECTS, added region for WM_NCPAINT

File:
1 edited

Legend:

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

    r2418 r2421  
    1 /* $Id: pmframe.cpp,v 1.12 2000-01-12 15:14:16 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.13 2000-01-12 17:37:29 cbratschi Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    107107  {
    108108    case WM_FORMATFRAME:
    109         break;
     109        break;
    110110
    111111    case WM_MINMAXFRAME:
     
    118118      {
    119119        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W);
    120       } 
     120      }
    121121      else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE)
    122122      {
    123123        win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W);
    124       } 
     124      }
    125125      else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE)
    126126      {
     
    262262
    263263        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
    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         }
     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        }
    275275
    276276        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     
    285285
    286286        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         }
     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        }
    303303
    304304        if(win32wnd->CanReceiveSizeMsgs())
     
    307307        //update child positions: rectWindow is in window coordinates
    308308        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    309                 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
    310         }
     309                FrameUpdateChildPositions(win32wnd->getOS2WindowHandle());
     310        }
    311311
    312312PosChangedEnd:
     
    317317    case WM_CALCVALIDRECTS:
    318318    {
    319       PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;
    320       UINT res = 0; //= CVR_ALIGNLEFT | CVR_ALIGNTOP;
    321 
    322 //CB: todo: use WM_NCCALCSIZE result
    323       if (win32wnd->getWindowClass())
    324       {
    325         DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W);
    326 
    327         if ((dwStyle & CS_HREDRAW_W) && (newRect->xRight-newRect->xLeft != oldRect->xRight-oldRect->xLeft))
    328           res |= CVR_REDRAW;
    329         else if ((dwStyle & CS_VREDRAW_W) && (newRect->yTop-newRect->yBottom != oldRect->yTop-oldRect->yBottom))
    330           res |= CVR_REDRAW;
    331       } else res |= CVR_REDRAW;
    332 
    333       //CB: PM sets client window position
    334 //      RestoreOS2TIB();
    335 //      OldFrameProc(hwnd,msg,mp1,mp2);
    336 //      SetWin32TIB();
    337 
    338319      RestoreOS2TIB();
    339       return (MRESULT)res;
     320      return (MRESULT)CVR_REDRAW; //always redraw frame
    340321    }
    341322
     
    357338            if (topOwner) WinSetWindowPos(topOwner->getOS2FrameWindowHandle(),hwnd,0,0,0,0,SWP_ZORDER);
    358339          }
    359         } 
     340        }
    360341        else
    361342        {
     
    404385  SWP swpClient = {0};
    405386
    406         win32wnd->MsgFormatFrame();
    407         //CB: todo: use result for WM_CALCVALIDRECTS
    408         mapWin32ToOS2Rect(WinQueryWindow(win32wnd->getOS2FrameWindowHandle(),QW_PARENT),win32wnd->getOS2FrameWindowHandle(),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
    409 
    410         swpClient.hwnd = win32wnd->getOS2WindowHandle();
    411         swpClient.hwndInsertBehind = 0;
    412         swpClient.x  = rect.xLeft;
    413         swpClient.y  = rect.yBottom;
    414         swpClient.cx = rect.xRight-rect.xLeft;
    415         swpClient.cy = rect.yTop-rect.yBottom;
    416         swpClient.fl = SWP_MOVE | SWP_SIZE;
    417         WinSetMultWindowPos(GetThreadHAB(), &swpClient, 1);
     387        win32wnd->MsgFormatFrame();
     388        //CB: todo: use result for WM_CALCVALIDRECTS
     389        mapWin32ToOS2Rect(WinQueryWindow(win32wnd->getOS2FrameWindowHandle(),QW_PARENT),win32wnd->getOS2FrameWindowHandle(),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
     390
     391        swpClient.hwnd = win32wnd->getOS2WindowHandle();
     392        swpClient.hwndInsertBehind = 0;
     393        swpClient.x  = rect.xLeft;
     394        swpClient.y  = rect.yBottom;
     395        swpClient.cx = rect.xRight-rect.xLeft;
     396        swpClient.cy = rect.yTop-rect.yBottom;
     397        swpClient.fl = SWP_MOVE | SWP_SIZE;
     398        WinSetMultWindowPos(GetThreadHAB(), &swpClient, 1);
    418399}
    419400//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.