Ignore:
Timestamp:
Oct 22, 1999, 8:11:51 PM (26 years ago)
Author:
sandervl
Message:

Lots of changes/fixes

File:
1 edited

Legend:

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

    r1391 r1405  
    1 /* $Id: oslibwin.cpp,v 1.33 1999-10-21 12:19:26 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.34 1999-10-22 18:11:45 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    554554    pswpOld->cx = pswp->cx;
    555555    pswpOld->cy = pswp->cy;
     556
     557    dprintf(("window (%d,%d)(%d,%d)  client (%d,%d)(%d,%d)",
     558             x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
     559
     560    pwpos->flags            = (UINT)flags;
     561    pwpos->cy               = cy;
     562    pwpos->cx               = cx;
     563    pwpos->x                = x;
     564    pwpos->y                = y;
     565    pwpos->hwndInsertAfter  = hWinAfter;
     566    pwpos->hwnd             = hWindow;
     567}
     568//******************************************************************************
     569//******************************************************************************
     570void OSLibMapSWPtoWINDOWPOSFrame(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
     571{
     572   HWND hWindow            = pswp->hwnd;
     573   HWND hWndInsertAfter    = pswp->hwndInsertBehind;
     574   long x                  = pswp->x;
     575   long y                  = pswp->y;
     576   long cx                 = pswp->cx;
     577   long cy                 = pswp->cy;
     578   UINT fuFlags            = (UINT)pswp->fl;
     579   ULONG parentHeight;
     580
     581   HWND   hWinAfter;
     582   ULONG  flags = 0;
     583   SWP    swpClient;
     584   POINTL point;
     585
     586   HWND  hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow;
     587
     588    if (hWndInsertAfter == HWND_TOP)
     589        hWinAfter = HWND_TOP_W;
     590    else if (hWndInsertAfter == HWND_BOTTOM)
     591        hWinAfter = HWND_BOTTOM_W;
     592    else
     593        hWinAfter = (HWND) hWndInsertAfter;
     594
     595    //***********************************
     596    // convert PM flags to Windows flags
     597    //***********************************
     598    if (!(fuFlags & SWP_SIZE))       flags |= SWP_NOSIZE_W;
     599    if (!(fuFlags & SWP_MOVE))       flags |= SWP_NOMOVE_W;
     600    if (!(fuFlags & SWP_ZORDER))     flags |= SWP_NOZORDER_W;
     601    if (  fuFlags & SWP_NOREDRAW)    flags |= SWP_NOREDRAW_W;
     602    if (!(fuFlags & SWP_ACTIVATE))   flags |= SWP_NOACTIVATE_W;
     603    if (  fuFlags & SWP_SHOW)        flags |= SWP_SHOWWINDOW_W;
     604    if (  fuFlags & SWP_HIDE)        flags |= SWP_HIDEWINDOW_W;
     605    if (  fuFlags & SWP_NOADJUST)    flags |= SWP_NOSENDCHANGING_W;
     606
     607    WinQueryWindowPos(WinWindowFromID(hFrame, FID_CLIENT), &swpClient);
     608
     609    if(fuFlags & (SWP_MOVE | SWP_SIZE))
     610    {
     611        point.x = x;
     612        point.y = y;
     613        if(hParent)
     614        {
     615                WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1);
     616        }
     617        point.y = OSLibQueryScreenHeight() - point.y - cy;
     618
     619        x  = point.x;
     620        y  = point.y;
     621
     622        if ((pswp->x == pswpOld->x) && (pswp->y == pswpOld->y))
     623            flags |= SWP_NOMOVE_W;
     624
     625        if ((pswp->cx == pswpOld->cx) && (pswp->cy == pswpOld->cy))
     626            flags |= SWP_NOSIZE_W;
     627
     628        if (fuFlags & SWP_SIZE)
     629        {
     630            if (pswp->cy != pswpOld->cy)
     631            {
     632                flags &= ~SWP_NOMOVE_W;
     633            }
     634        }
     635    }
     636
     637    pswpOld->x  = swpClient.x;
     638    pswpOld->y  = pswp->cy - swpClient.y - swpClient.cy;
     639    pswpOld->cx = swpClient.cx;
     640    pswpOld->cy = swpClient.cy;
    556641
    557642    dprintf(("window (%d,%d)(%d,%d)  client (%d,%d)(%d,%d)",
Note: See TracChangeset for help on using the changeset viewer.