Ignore:
Timestamp:
Aug 27, 1999, 7:50:57 PM (26 years ago)
Author:
dengert
Message:

window creation, positioning, sizing

File:
1 edited

Legend:

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

    r693 r715  
    1 /* $Id: oslibwin.cpp,v 1.24 1999-08-25 15:08:50 dengert Exp $ */
     1/* $Id: oslibwin.cpp,v 1.25 1999-08-27 17:50:56 dengert Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    6464                dwFrameStyle |= FCF_TITLEBAR;
    6565
    66         dwFrameStyle |= FCF_TASKLIST;
     66        dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER | FCF_NOBYTEALIGN;
    6767        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
    6868                                       &dwFrameStyle, WIN32_STDCLASS,
     
    403403//******************************************************************************
    404404//******************************************************************************
    405 void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld, ULONG parentHeight)
     405void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld, HWND hParent, HWND hFrame)
    406406{
    407407   HWND hWindow            = pswp->hwnd;
     
    412412   long cy                 = pswp->cy;
    413413   UINT fuFlags            = (UINT)pswp->fl;
     414   ULONG parentHeight;
    414415
    415416   HWND  hWinAfter;
     
    457458   if ( fuFlags & (SWP_MOVE | SWP_SIZE) )
    458459   {
     460      if (hParent == NULLHANDLE)
     461      {
     462        ULONG Offset;
     463        POINTL pt = {0, 0};
     464
     465        Offset = OSLibGetWindowHeight(hFrame) - cy;
     466        parentHeight = ScreenHeight;
     467
     468        cx += 2 * x;
     469        cy += Offset;
     470        WinMapWindowPoints (hFrame, HWND_DESKTOP, &pt, 1);
     471        x = pt.x;
     472        y = pt.y;
     473
     474        pswpOld->cx += 2 * pswpOld->x;
     475        pswpOld->cy += Offset;
     476        pswpOld->x   = pt.x;
     477        pswpOld->y   = pt.y;
     478      }
     479      else
     480      {
     481        parentHeight = OSLibGetWindowHeight(hParent);
     482      }
     483
    459484      if (fuFlags & SWP_SIZE)
    460485      {
     
    485510      // relative to top left of parent.
    486511      //********************************************************
    487       y = parentHeight - y - cy;
    488 
    489       LONG oldY = parentHeight - pswpOld->y - pswpOld->cy;
     512      y          = parentHeight - y - cy;
     513      LONG oldY  = parentHeight - pswpOld->y - pswpOld->cy;
    490514
    491515      // Set the SWP_NOMOVE_W flag if the window has not moved in windows
     
    498522         flags |= SWP_NOSIZE_W;
    499523   }
     524
     525   if (hParent == NULLHANDLE)
     526   {
     527       pswpOld->x  = x + pswp->x;
     528       pswpOld->y  = y + cy - pswp->y - pswp->cy;
     529   }
     530   else {
     531       pswpOld->x  = pswp->x;
     532       pswpOld->y  = parentHeight - pswp->y - cy;
     533   }
     534   pswpOld->cx = pswp->cx;
     535   pswpOld->cy = pswp->cy;
     536
     537dprintf(("window (%d,%d)(%d,%d)  client (%d,%d)(%d,%d)",
     538         x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy));
    500539
    501540   // Fill in the WINDOWPOS structure with the now calculated PM values.
     
    510549//******************************************************************************
    511550//******************************************************************************
    512 void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, ULONG parentHeight)
     551void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame)
    513552{
    514553   HWND hWnd              = pwpos->hwnd;
     
    519558   long cy                = pwpos->cy;
    520559   UINT fuFlags           = pwpos->flags;
     560   ULONG parentHeight;
    521561
    522562   HWND  hWinAfter;
     
    571611   if ( flags & (SWP_MOVE | SWP_SIZE) )
    572612   {
     613      if (hParent == NULLHANDLE)
     614        parentHeight = ScreenHeight;
     615      else
     616        parentHeight = OSLibGetWindowHeight(hParent);
     617
    573618      //**********************************************************
    574619      // We'll need both a y and cy for the Y inversion code.
     
    617662   }
    618663
    619    // Fill in the WINDOWPOS structure with the now calculated PM values.
     664   // Fill in the SWP structure with the now calculated PM values.
    620665   pswp->fl               = flags;
    621666   pswp->cy               = cy;
Note: See TracChangeset for help on using the changeset viewer.