Changeset 2445 for trunk/src


Ignore:
Timestamp:
Jan 15, 2000, 4:05:37 PM (26 years ago)
Author:
sandervl
Message:

ScrollWindow & non-client scroll tracking bugfixes/changes

Location:
trunk/src/user32/new
Files:
4 edited

Legend:

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

    r2437 r2445  
    1 /* $Id: dc.cpp,v 1.13 2000-01-14 14:45:15 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.14 2000-01-15 15:05:36 sandervl Exp $ */
    22
    33/*
     
    6969LONG clientHeight(Win32BaseWindow *wnd, HWND hwnd, pDCData pHps);
    7070
     71//******************************************************************************
     72//******************************************************************************
    7173void TestWideLine (pDCData pHps)
    7274{
     
    9193   }
    9294}
    93 
     95//******************************************************************************
     96//******************************************************************************
    9497void Calculate1PixelDelta(pDCData pHps)
    9598{
     
    100103   pHps->worldXDeltaFor1Pixel = (int)(aptl[1].x - aptl[0].x);                   // 171182
    101104}
    102 
    103 //******************************************************************************
    104 
     105//******************************************************************************
     106//******************************************************************************
    105107int setMapMode(Win32BaseWindow *wnd, pDCData pHps, int mode)
    106108{
     
    181183   return prevMode;
    182184}
    183 
     185//******************************************************************************
     186//******************************************************************************
    184187BOOL setPageXForm(Win32BaseWindow *wnd, pDCData pHps)
    185188{
     
    233236   return rc;
    234237}
    235 
     238//******************************************************************************
     239//******************************************************************************
    236240BOOL changePageXForm(Win32BaseWindow *wnd, pDCData pHps, PPOINTL pValue, int x, int y, PPOINTL pPrev)
    237241{
     
    293297   return (result);
    294298}
    295 
     299//******************************************************************************
     300//******************************************************************************
    296301LONG clientHeight(Win32BaseWindow *wnd, HWND hwnd, pDCData pHps)
    297302{
     
    323328   }
    324329}
    325 
     330//******************************************************************************
     331//******************************************************************************
    326332BOOL isYup (pDCData pHps)
    327333{
     
    340346   return FALSE;
    341347}
    342 
     348//******************************************************************************
     349//******************************************************************************
    343350INT revertDy (Win32BaseWindow *wnd, INT dy)
    344351{
     
    359366   return (dy);
    360367}
    361 
     368//******************************************************************************
     369//******************************************************************************
    362370HDC sendEraseBkgnd (Win32BaseWindow *wnd)
    363371{
     
    400408   return erased;
    401409}
    402 
     410//******************************************************************************
     411//******************************************************************************
    403412void releaseOwnDC (HDC hps)
    404413{
     
    420429   }
    421430}
    422 
     431//******************************************************************************
     432//******************************************************************************
    423433HDC WIN32API BeginPaint (HWND hWnd, PPAINTSTRUCT_W lpps)
    424434{
     
    496506   return (HDC)pHps->hps;
    497507}
    498 
     508//******************************************************************************
     509//******************************************************************************
    499510BOOL WIN32API EndPaint (HWND hwnd, const PAINTSTRUCT_W *pPaint)
    500511{
     
    528539   return TRUE;
    529540}
    530 
     541//******************************************************************************
     542//******************************************************************************
    531543BOOL WIN32API GetUpdateRect (HWND hwnd, LPRECT pRect, BOOL erase)
    532544{
     
    589601   return updateRegionExists;
    590602}
    591 
     603//******************************************************************************
    592604//functions for WM_NCPAINT
    593 
     605//******************************************************************************
    594606INT SYSTEM GetOS2UpdateRgn(HWND hwnd,HRGN hrgn)
    595607{
    596608  return O32_GetUpdateRgn(hwnd,hrgn,FALSE);
    597609}
    598 
     610//******************************************************************************
     611//******************************************************************************
    599612BOOL SYSTEM GetOS2UpdateRect(HWND hwnd,LPRECT pRect)
    600613{
     
    615628   return updateRegionExists;
    616629}
    617 
     630//******************************************************************************
     631//******************************************************************************
    618632int WIN32API GetUpdateRgn (HWND hwnd, HRGN hrgn, BOOL erase)
    619633{
     
    633647   return Complexity;
    634648}
    635 
     649//******************************************************************************
    636650// This implementation of GetDCEx supports
    637651// DCX_WINDOW
     
    639653// DCX_EXCLUDERGN (complex regions allowed)
    640654// DCX_INTERSECTRGN (complex regions allowed)
    641 
     655//******************************************************************************
    642656HDC WIN32API GetDCEx (HWND hwnd, HRGN hrgn, ULONG flags)
    643657{
     
    793807   return NULL;
    794808}
    795 
     809//******************************************************************************
     810//******************************************************************************
    796811HDC WIN32API GetDC (HWND hwnd)
    797812{
    798813  return GetDCEx (hwnd, NULL, 0);
    799814}
    800 
     815//******************************************************************************
     816//******************************************************************************
    801817HDC WIN32API GetWindowDC (HWND hwnd)
    802818{
    803819  return GetDCEx (hwnd, NULL, DCX_WINDOW_W);
    804820}
    805 
     821//******************************************************************************
     822//******************************************************************************
    806823int WIN32API ReleaseDC (HWND hwnd, HDC hdc)
    807824{
     
    824841   return (rc);
    825842}
    826 
     843//******************************************************************************
     844//******************************************************************************
    827845BOOL WIN32API UpdateWindow (HWND hwnd)
    828846{
     
    843861   return (TRUE);
    844862}
    845 
     863//******************************************************************************
    846864// This implementation of RedrawWindow supports
    847865// RDW_ERASE
     
    853871// RDW_ERASENOW
    854872// RDW_UPDATENOW
    855 
     873//******************************************************************************
    856874BOOL WIN32API RedrawWindow(HWND hwnd, const RECT* pRect, HRGN hrgn, DWORD redraw)
    857875{
     
    913931//   else if (redraw & RDW_ERASENOW_W)
    914932//      wnd->setSuppressErase (FALSE);
    915 #if 0
    916    else
    917    {
    918       QMSG qmsg;
    919       BOOL erase;
    920 
    921       erase = (WinPeekMsg (HABX, &qmsg, hwnd, WM_PAINT, WM_PAINT, PM_REMOVE)
    922                 && (redraw & RDW_NOERASE_W) == 0);
    923 
    924       wnd->setSuppressErase (!erase);
    925    }
    926 
    927    if (redraw & (RDW_NOINTERNALPAINT_W | RDW_INTERNALPAINT_W))
    928    {
    929       QMSG qmsg;
    930 
    931       WinPeekMsg( (HAB)0, &qmsg, hwnd, WM_VIRTUAL_INTERNALPAINT,
    932                   WM_VIRTUAL_INTERNALPAINT, PM_REMOVE );
    933    }
    934 #endif
    935933
    936934   if (hrgn)
     
    10331031   return (success);
    10341032}
    1035 
     1033//******************************************************************************
     1034//******************************************************************************
    10361035BOOL WIN32API InvalidateRect (HWND hwnd, const RECT *pRect, BOOL erase)
    10371036{
    1038 //   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    10391037   BOOL result;
    1040 
    1041 // todo !!
    1042 //   if ( isFrame without client )
    1043 //      erase = TRUE;
    1044 
     1038   
    10451039   result = RedrawWindow (hwnd, pRect, NULLHANDLE,
    10461040                          RDW_ALLCHILDREN_W | RDW_INVALIDATE_W |
     
    10491043   return (result);
    10501044}
    1051 
     1045//******************************************************************************
     1046//******************************************************************************
    10521047BOOL WIN32API InvalidateRgn (HWND hwnd, HRGN hrgn, BOOL erase)
    10531048{
    1054 //   Win32BaseWindow *wnd = Win32BaseWindow::GetWindowFromHandle (hwnd);
    10551049   BOOL result;
    1056 
    1057 // todo !!
    1058 //   if ( isFrame without client )
    1059 //      erase = TRUE;
    10601050
    10611051   result = RedrawWindow (hwnd, NULL, hrgn,
     
    10651055   return (result);
    10661056}
    1067 
     1057//******************************************************************************
     1058//******************************************************************************
    10681059BOOL setPMRgnIntoWinRgn (HRGN hrgnPM, HRGN hrgnWin, LONG height)
    10691060{
     
    11231114   return (rc);
    11241115}
    1125 
     1116//******************************************************************************
     1117//******************************************************************************
    11261118BOOL WIN32API ScrollDC (HDC hDC, int dx, int dy, const RECT *pScroll,
    11271119                        const RECT *pClip, HRGN hrgnUpdate, LPRECT pRectUpdate)
     
    12461238   return (rc);
    12471239}
    1248 
    1249 //******************************************************************************
    1250 //******************************************************************************
     1240//******************************************************************************
     1241//******************************************************************************
     1242#if 1
     1243BOOL WIN32API ScrollWindow(HWND hwnd, int dx, int dy, const RECT *pScroll, const RECT *pClip)
     1244{
     1245 Win32BaseWindow *window;
     1246 APIRET  rc;
     1247 RECTL   clientRect;
     1248 RECTL   scrollRect;
     1249 RECTL   clipRect;
     1250 PRECT   pClientRect;
     1251 PRECTL  pScrollRect = NULL;
     1252 PRECTL  pClipRect   = NULL;
     1253 ULONG   scrollFlags = SW_INVALIDATERGN;
     1254
     1255    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     1256    if(!window) {
     1257        dprintf(("ScrollWindow, window %x not found", hwnd));
     1258        return 0;
     1259    }
     1260    dprintf(("ScrollWindow %x %d %d %x %x", hwnd, dx, dy, pScroll, pClip));
     1261    pClientRect = window->getClientRectPtr();
     1262    clientRect.xLeft   = 0;
     1263    clientRect.yBottom = 0;
     1264    clientRect.xRight  = pClientRect->right - pClientRect->left;
     1265    clientRect.yTop    = pClientRect->bottom - pClientRect->top;
     1266    if(pScroll) {
     1267         mapWin32ToOS2Rect(window,(RECT *)pScroll, (PRECTLOS2)&scrollRect);
     1268         pScrollRect = &scrollRect;
     1269
     1270         //Scroll rectangle relative to client area
     1271         WinIntersectRect ((HAB) 0, pScrollRect, pScrollRect, &clientRect);
     1272    }
     1273    else scrollFlags |= SW_SCROLLCHILDREN;
     1274
     1275    if(pClip) {
     1276         mapWin32ToOS2Rect(window,(RECT *)pClip, (PRECTLOS2)&clipRect);
     1277         pClipRect = &clipRect;
     1278
     1279         //Clip rectangle relative to client area
     1280         WinIntersectRect ((HAB) 0, pClipRect, pClipRect, &clientRect);
     1281    }
     1282
     1283    dy = revertDy (window, dy);
     1284
     1285    rc = WinScrollWindow(window->getOS2WindowHandle(), dx, dy,
     1286                         pScrollRect, pClipRect, NULLHANDLE,
     1287                         NULL, scrollFlags);
     1288
     1289    return (rc != RGN_ERROR);
     1290}
     1291#else
    12511292BOOL WIN32API ScrollWindow(HWND hwnd, int dx, int dy, const RECT *pScroll, const RECT *pClip)
    12521293{
     
    13111352    return (rc != RGN_ERROR);
    13121353}
     1354#endif
    13131355//******************************************************************************
    13141356//******************************************************************************
     
    13561398    if (lComplexity == RGN_ERROR)
    13571399    {
    1358         return (0);
     1400        return ERROR_W;
    13591401    }
    13601402
     
    13761418        ((lComplexity == RGN_RECT) || (lComplexity == RGN_COMPLEX)))
    13771419    {
    1378        rc = InvalidateRect (hwnd, &winRectUpdate, scrollFlag & SW_ERASE_W);
     1420       rc = InvalidateRect (hwnd, &winRectUpdate, (scrollFlag & SW_ERASE_W) ? 1 : 0);
    13791421       if (rc == FALSE)
    13801422       {
  • trunk/src/user32/new/oslibmsg.cpp

    r2406 r2445  
    1 /* $Id: oslibmsg.cpp,v 1.13 2000-01-11 13:06:25 sandervl Exp $ */
     1/* $Id: oslibmsg.cpp,v 1.14 2000-01-15 15:05:37 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    248248}
    249249//******************************************************************************
     250//PeekMessage retrieves only messages associated with the window identified by the
     251//hwnd parameter or any of its children as specified by the IsChild function, and within
     252//the range of message values given by the uMsgFilterMin and uMsgFilterMax
     253//parameters. If hwnd is NULL, PeekMessage retrieves messages for any window that
     254//belongs to the current thread making the call. (PeekMessage does not retrieve
     255//messages for windows that belong to other threads.) If hwnd is -1, PeekMessage only
     256//returns messages with a hwnd value of NULL, as posted by the PostAppMessage
     257//function. If uMsgFilterMin and uMsgFilterMax are both zero, PeekMessage returns all
     258//available messages (no range filtering is performed).
     259//TODO: Not working as specified right now!
    250260//******************************************************************************
    251261BOOL OSLibWinPeekMsg(LPMSG pMsg, HWND hwnd, UINT uMsgFilterMin, UINT uMsgFilterMax,
  • trunk/src/user32/new/pmwindow.cpp

    r2437 r2445  
    1 /* $Id: pmwindow.cpp,v 1.42 2000-01-14 14:45:16 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.43 2000-01-15 15:05:37 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    397397
    398398    case WM_PAINT:
     399        dprintf(("OS2: WM_PAINT"));
    399400        win32wnd->DispatchMsgA(pWinMsg);
    400401        goto RunDefWndProc;
  • trunk/src/user32/new/win32wbasenonclient.cpp

    r2444 r2445  
    1 /* $Id: win32wbasenonclient.cpp,v 1.8 2000-01-15 14:18:18 cbratschi Exp $ */
     1/* $Id: win32wbasenonclient.cpp,v 1.9 2000-01-15 15:05:37 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2 (non-client methods)
     
    194194    if ((wParam & 0x0f) != HTHSCROLL) return;
    195195    scrollbar = SB_HORZ;
    196   } else  /* SC_VSCROLL */
     196  }
     197  else  /* SC_VSCROLL */
    197198  {
    198199    if ((wParam & 0x0f) != HTVSCROLL) return;
     
    203204  pt.y -= rectWindow.top;
    204205  SCROLL_HandleScrollEvent(Win32Hwnd,0,MAKELONG(pt.x,pt.y),scrollbar,WM_LBUTTONDOWN);
    205   if (GetCapture() != Win32Hwnd) return;
     206  if (GetCapture() != getWindowHandle()) return;
    206207  do
    207208  {
    208     GetMessageA(&msg,Win32Hwnd,0,0);
    209     switch(msg.message)
    210     {
    211       case WM_LBUTTONUP:
    212       case WM_MOUSEMOVE:
    213         pt.x = msg.pt.x-rectWindow.left;
    214         pt.y = msg.pt.y-rectWindow.top;
    215         msg.lParam = MAKELONG(pt.x,pt.y);
    216       case WM_SYSTIMER:
    217         SCROLL_HandleScrollEvent(Win32Hwnd,msg.wParam,msg.lParam,scrollbar,msg.message);
    218         break;
    219 
    220       default:
     209    GetMessageA(&msg, 0, 0, 0);
     210    if(msg.hwnd == getWindowHandle())
     211    {
     212        switch(msg.message)
     213        {
     214        case WM_LBUTTONUP:
     215        case WM_MOUSEMOVE:
     216            pt.x = msg.pt.x-rectWindow.left;
     217            pt.y = msg.pt.y-rectWindow.top;
     218            msg.lParam = MAKELONG(pt.x,pt.y);
     219
     220        case WM_SYSTIMER:
     221            SCROLL_HandleScrollEvent(Win32Hwnd,msg.wParam,msg.lParam,scrollbar,msg.message);
     222            break;
     223
     224        default:
     225            TranslateMessage(&msg);
     226            DispatchMessageA(&msg);
     227            break;
     228        }
     229    }
     230    else {
    221231        TranslateMessage(&msg);
    222232        DispatchMessageA(&msg);
    223         break;
    224233    }
    225234    if (!IsWindow())
     
    228237      break;
    229238    }
    230   } while (msg.message != WM_LBUTTONUP);
     239  }
     240  while (msg.message != WM_LBUTTONUP);
    231241}
    232242//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.