Ignore:
Timestamp:
Jan 13, 2000, 9:11:39 PM (26 years ago)
Author:
sandervl
Message:

Client rectangle changes, GetDCEx bugfix (CS_OWNDC), scroll rectangle calculation fixes

File:
1 edited

Legend:

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

    r2426 r2433  
    1 /* $Id: win32wbase.cpp,v 1.38 2000-01-13 13:54:53 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.39 2000-01-13 20:11:37 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    1313 *
    1414 * TODO: Not thread/process safe
     15 *
     16 * NOTE: Client rectangle always relative to frame window; window rectangle in screen coordinates
    1517 *
    1618 * Project Odin Software License can be found in LICENSE.TXT
     
    639641  // Subclass frame
    640642  pOldFrameProc = FrameSubclassFrameWindow(this);
    641   //if (isChild()) FrameSetBorderSize(this,TRUE);
    642643
    643644  //preset rects
     
    647648  rectWindow.bottom = cs->y+cs->cy;
    648649  rectClient = rectWindow; //dummy client rect
     650  OffsetRect(&rectClient, -rectClient.left, -rectClient.top);
     651
    649652  if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow);
    650653  /* Send the WM_CREATE message
     
    660663  if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs))
    661664  {
     665        RECT tmpRect;
     666
    662667        //update rect
    663668        rectWindow.left = cs->x;
     
    665670        rectWindow.top = cs->y;
    666671        rectWindow.bottom = cs->y+cs->cy;
     672        tmpRect = rectWindow;
    667673        if (getParent()) mapWin32Rect(getParent()->getOS2WindowHandle(),OSLIB_HWND_DESKTOP,&rectWindow);
    668674        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
     675
    669676        rectClient = rectWindow;
    670         if (getParent()) mapWin32Rect(OSLIB_HWND_DESKTOP,getParent()->getOS2WindowHandle(),&rectClient);
     677        OffsetRect(&rectClient, -rectClient.left, -rectClient.top);
     678
    671679        //set the window size and update the client
    672         SetWindowPos(hwndLinkAfter,rectClient.left,rectClient.top,rectClient.right-rectClient.left,rectClient.bottom-rectClient.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED);
     680        SetWindowPos(hwndLinkAfter, tmpRect.left, tmpRect.top, tmpRect.right-tmpRect.left, tmpRect.bottom-tmpRect.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED);
    673681        fNoSizeMsg = FALSE;
    674682        if (cs->style & WS_VISIBLE) dwStyle |= WS_VISIBLE; //program could change position in WM_CREATE
     
    679687                                MAKELONG(rectClient.right-rectClient.left,
    680688                                         rectClient.bottom-rectClient.top));
    681                 SendInternalMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
     689                DWORD lParam;
     690
     691                if(getParent()) {//in parent coordinates
     692                    POINT point;
     693
     694                    point.x = rectClient.left;
     695                    point.y = rectClient.top;
     696                    MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);
     697
     698                    lParam = MAKELONG(point.x, point.y);
     699                }
     700                else {//in screen coordinates
     701                    lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top);
     702                }
     703                SendInternalMessageA(WM_MOVE, 0, lParam);
    682704            }
    683705
     
    10361058    RECT client = rectClient;
    10371059
    1038     mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client);
     1060////    mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client);
    10391061    if ((rect.left >= client.left) && (rect.left < client.right) &&
    10401062        (rect.right >= client.left) && (rect.right < client.right) &&
     
    14051427    case WM_WINDOWPOSCHANGED:
    14061428    {
    1407 
    1408 /* undocumented SWP flags - from SDK 3.1 */
    1409 #define SWP_NOCLIENTSIZE        0x0800
    1410 #define SWP_NOCLIENTMOVE        0x1000
    1411 
    14121429        PWINDOWPOS wpos = (PWINDOWPOS)lParam;
    14131430        WPARAM     wp   = SIZE_RESTORED;
    14141431
    14151432        if (!(wpos->flags & SWP_NOMOVE) && !(wpos->flags & SWP_NOCLIENTMOVE))
    1416             SendInternalMessageA(WM_MOVE, 0, MAKELONG(rectClient.left, rectClient.top));
    1417 
     1433        {
     1434            DWORD lParam;
     1435
     1436            if(getParent()) {//in parent coordinates
     1437                POINT point;
     1438
     1439                point.x = rectClient.left;
     1440                point.y = rectClient.top;
     1441                MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);
     1442
     1443                lParam = MAKELONG(point.x, point.y);
     1444            }
     1445            else {//in screen coordinates
     1446                lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top);
     1447            }
     1448            SendInternalMessageA(WM_MOVE, 0, lParam);
     1449        }
    14181450        if (!(wpos->flags & SWP_NOSIZE) && !(wpos->flags & SWP_NOCLIENTSIZE))
    14191451        {
     
    14221454
    14231455            SendInternalMessageA(WM_SIZE, wp, MAKELONG(rectClient.right  - rectClient.left,
    1424                                                rectClient.bottom - rectClient.top));
     1456                                                       rectClient.bottom - rectClient.top));
    14251457        }
    14261458        return 0;
     
    19391971
    19401972    dprintf(("ShowWindow %x %x", getWindowHandle(), nCmdShow));
    1941 #if 1
     1973
    19421974    if (flags & WIN_NEED_SIZE)
    19431975    {
     
    19551987                     MAKELONG(rectClient.right-rectClient.left,
    19561988                              rectClient.bottom-rectClient.top));
    1957         SendInternalMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
    1958     }
    1959 #else
    1960     if(fFirstShow) {
    1961         if(isFrameWindow() && IS_OVERLAPPED(getStyle()) && !isChild()) {
    1962                 SendInternalMessageA(WM_SIZE, SIZE_RESTORED,
    1963                                 MAKELONG(rectClient.right-rectClient.left,
    1964                                          rectClient.bottom-rectClient.top));
    1965                 SendInternalMessageA(WM_MOVE, 0, MAKELONG( rectClient.left, rectClient.top ) );
    1966 
    1967         }
    1968         fFirstShow = FALSE;
    1969     }
    1970 #endif
     1989        DWORD lParam;
     1990
     1991        if(getParent()) {//in parent coordinates
     1992            POINT point;
     1993
     1994            point.x = rectClient.left;
     1995            point.y = rectClient.top;
     1996            MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);
     1997
     1998            lParam = MAKELONG(point.x, point.y);
     1999        }
     2000        else {//in screen coordinates
     2001            lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top);
     2002        }
     2003        SendInternalMessageA(WM_MOVE, 0, lParam);
     2004    }
    19712005    switch(nCmdShow)
    19722006    {
Note: See TracChangeset for help on using the changeset viewer.