Ignore:
Timestamp:
Feb 20, 2001, 4:40:23 PM (25 years ago)
Author:
sandervl
Message:

ScrollWindow, maximized window + system menu fixes

File:
1 edited

Legend:

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

    r5191 r5215  
    1 /* $Id: dc.cpp,v 1.90 2001-02-19 13:13:00 sandervl Exp $ */
     1/* $Id: dc.cpp,v 1.91 2001-02-20 15:40:22 sandervl Exp $ */
    22
    33/*
     
    231231
    232232//testestest
    233    if(wnd && wnd->getWindowWidth() && wnd->getWindowHeight()) {
    234        RECTL recttmp, rectviewold;
    235 
    236        rc = GpiQueryPageViewport(pHps->hps, &rectviewold);
    237        if(rc == 0) {
    238            dprintf(("WARNING: GpiQueryPageViewport returned FALSE!!"));
    239        }
    240        recttmp.xLeft   = 0;
    241 //       recttmp.xRight  = ((double)wnd->getWindowWidth() / xScale);
    242        recttmp.xRight  = ((double)GetScreenWidth() / xScale);
    243        recttmp.yBottom = 0;
    244 //       recttmp.yTop    = ((double)wnd->getWindowHeight() / yScale);
    245        recttmp.yTop    = ((double)GetScreenHeight() / yScale);
    246 
    247        if(recttmp.yTop != rectviewold.yTop ||
    248           recttmp.xRight != rectviewold.xRight)
    249        {
    250            dprintf(("GpiSetPageViewport %x (%d,%d) %f %f", pHps->hps, recttmp.xRight, recttmp.yTop, xScale, yScale));
    251            rc = GpiSetPageViewport(pHps->hps, &recttmp);
    252            if(rc == 0) {
    253               dprintf(("WARNING: GpiSetPageViewport returned FALSE!!"));
    254            }
    255        }
     233   if(wnd && wnd->getWindowWidth() && wnd->getWindowHeight())
     234   {
     235        RECTL recttmp, rectviewold;
     236
     237        rc = GpiQueryPageViewport(pHps->hps, &rectviewold);
     238        if(rc == 0) {
     239            dprintf(("WARNING: GpiQueryPageViewport returned FALSE!!"));
     240        }
     241        recttmp.xLeft   = 0;
     242        recttmp.xRight  = ((double)GetScreenWidth() / xScale);
     243        recttmp.yBottom = 0;
     244        recttmp.yTop    = ((double)GetScreenHeight() / yScale);
     245
     246        if(recttmp.yTop != rectviewold.yTop ||
     247           recttmp.xRight != rectviewold.xRight)
     248        {
     249            if(pHps->viewportYExt > pHps->windowExt.cy) {//scaling up means we have to invert the y values
     250                recttmp.yBottom = GetScreenHeight() - recttmp.yTop;
     251                recttmp.yTop    = GetScreenHeight();
     252            }
     253            dprintf(("GpiSetPageViewport %x (%d,%d)(%d,%d) %f %f", pHps->hps, recttmp.xLeft, recttmp.yBottom, recttmp.xRight, recttmp.yTop, xScale, yScale));
     254            rc = GpiSetPageViewport(pHps->hps, &recttmp);
     255            if(rc == 0) {
     256                dprintf(("WARNING: GpiSetPageViewport returned FALSE!!"));
     257            }
     258        }
    256259   }
    257260//testestest
     
    16981701}
    16991702//******************************************************************************
     1703//SvL: Using WinScrollWindow to scroll child windows is better (smoother).
    17001704//******************************************************************************
    17011705INT WIN32API ScrollWindowEx(HWND hwnd, int dx, int dy, const RECT *pScroll, const RECT *pClip,
     
    17241728
    17251729    if (scrollFlag & SW_INVALIDATE_W)      scrollFlagsOS2 |= SW_INVALIDATERGN;
     1730    if (scrollFlag & SW_SCROLLCHILDREN_W)  scrollFlagsOS2 |= SW_SCROLLCHILDREN;
    17261731
    17271732    mapWin32ToOS2Rect(window->getWindowHeight(), window->getClientRectPtr(), (PRECTLOS2)&clientRect);
     
    17581763      //CB: todo, scroll in several steps
    17591764      //    is time in ms? time <-> iteration count?
    1760     }
    1761 
    1762     // Scroll children first
    1763     if (scrollFlag & SW_SCROLLCHILDREN_W)
    1764     {
    1765         HWND hwndChild;
    1766         RECT rectChild, rc;
    1767 
    1768             dprintf(("ScrollWindowEx: Scroll child windows"));
    1769             GetClientRect(hwnd, &rc);
    1770             if (pScroll) IntersectRect(&rc, &rc, pScroll);
    1771 
    1772             hwndChild = GetWindow(hwnd, GW_CHILD_W);
    1773 
    1774             while(hwndChild)
    1775             {
    1776                 Win32BaseWindow *child;
    1777 
    1778                 child = Win32BaseWindow::GetWindowFromHandle(hwndChild);
    1779                 if(!child) {
    1780                     dprintf(("ScrollWindowEx, child %x not found", hwnd));
    1781                     return 0;
    1782                 }
    1783                 rectChild = *child->getWindowRect();
    1784                 if(!pRectUpdate || IntersectRect(&rectChild, &rectChild, &rc))
    1785                 {
    1786                      dprintf(("ScrollWindowEx: Scroll child window %x", hwndChild));
    1787                      SetWindowPos(hwndChild, 0, rectChild.left + dx,
    1788                                   rectChild.top + orgdy, 0, 0, SWP_NOZORDER_W |
    1789                                   SWP_NOSIZE_W | SWP_NOACTIVATE_W | SWP_NOREDRAW);
    1790                 }
    1791                 hwndChild = GetWindow(hwndChild, GW_HWNDNEXT_W);
    1792             }
    1793             dprintf(("***ScrollWindowEx: Scroll child windows DONE"));
    17941765    }
    17951766
     
    18011772    {
    18021773        return ERROR_W;
     1774    }
     1775
     1776    //Notify children that they have moved (according to the SDK docs,
     1777    //they only receive a WM_MOVE message)
     1778    //(PM only does this for windows with CS_MOVENOTIFY class)
     1779    //TODO: Verify this (no WM_WINDOWPOSCHANGING/ED?)
     1780    if (scrollFlag & SW_SCROLLCHILDREN_W)
     1781    {
     1782        HWND hwndChild;
     1783        RECT rectChild, rc;
     1784
     1785            dprintf(("ScrollWindowEx: Scroll child windows"));
     1786            GetClientRect(hwnd, &rc);
     1787            if (pScroll) IntersectRect(&rc, &rc, pScroll);
     1788
     1789            hwndChild = GetWindow(hwnd, GW_CHILD_W);
     1790
     1791            while(hwndChild)
     1792            {
     1793                Win32BaseWindow *child;
     1794
     1795                child = Win32BaseWindow::GetWindowFromHandle(hwndChild);
     1796                if(!child) {
     1797                    dprintf(("ERROR: ScrollWindowEx, child %x not found", hwnd));
     1798                    return 0;
     1799                }
     1800                rectChild = *child->getWindowRect();
     1801                if(!pRectUpdate || IntersectRect(&rectChild, &rectChild, &rc))
     1802                {
     1803                     dprintf(("ScrollWindowEx: Scroll child window %x", hwndChild));
     1804                     child->ScrollWindow(dx, orgdy);
     1805                }
     1806                hwndChild = GetWindow(hwndChild, GW_HWNDNEXT_W);
     1807            }
     1808            dprintf(("***ScrollWindowEx: Scroll child windows DONE"));
    18031809    }
    18041810
Note: See TracChangeset for help on using the changeset viewer.