Ignore:
Timestamp:
Oct 14, 1999, 8:27:59 PM (26 years ago)
Author:
sandervl
Message:

Lots of window fixes & changes

File:
1 edited

Legend:

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

    r1281 r1297  
    1 /* $Id: win32wbase.cpp,v 1.41 1999-10-14 09:22:42 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.42 1999-10-14 18:27:59 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    454454  dwExStyle = cs->dwExStyle;
    455455
    456   //SvL: Add bordersize
    457   cs->cy += 2*borderHeight;
    458   cs->cx += 2*borderWidth;
    459 
    460456  rectWindow.left   = cs->x;
    461457  rectWindow.top    = cs->y;
     
    489485                                 (owner) ? owner->getOS2WindowHandle() : OSLIB_HWND_DESKTOP,
    490486                                 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE,
    491                                  &OS2HwndFrame);
     487                                 &OS2HwndFrame, 0);
    492488
    493489  if(OS2Hwnd == 0) {
     
    548544#endif
    549545
     546  OSLibWinSetOwner(OS2Hwnd, OS2HwndFrame);
     547
    550548  if (dwStyle & WS_HSCROLL)
    551549  {
     
    585583
    586584  //Subclass frame
    587   if(isFrameWindow() && (HAS_3DFRAME(dwExStyle) ||
    588      (!HAS_DLGFRAME(dwStyle, dwExStyle) && (dwStyle & (WS_DLGFRAME|WS_BORDER|WS_THICKFRAME)) == WS_BORDER)))
    589   {
     585//  if(isFrameWindow() && (HAS_3DFRAME(dwExStyle) ||
     586//     (!HAS_DLGFRAME(dwStyle, dwExStyle) && (dwStyle & (WS_DLGFRAME|WS_BORDER|WS_THICKFRAME)) == WS_BORDER)))
     587//  {
    590588        pOldFrameProc = FrameSubclassFrameWindow(this);
    591589        if (isChild()) FrameSetBorderSize(this,TRUE);
    592   }
     590//  }
    593591
    594592  /* Send the WM_CREATE message
     
    617615        SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient );
    618616
    619         OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
     617//        OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top);
    620618        dprintf(("Sending WM_CREATE"));
    621619        if( (SendMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 )
     
    686684ULONG Win32BaseWindow::MsgShow(BOOL fShow)
    687685{
     686    if(fNoSizeMsg) {
     687        return 1;
     688    }
     689
     690    if(fShow) {
     691            setStyle(getStyle() | WS_VISIBLE);
     692    }
     693    else    setStyle(getStyle() & ~WS_VISIBLE);
     694
    688695    return SendInternalMessageA(WM_SHOWWINDOW, fShow, 0);
    689696}
     
    692699ULONG Win32BaseWindow::MsgPosChanging(LPARAM lp)
    693700{
    694     dprintf(("MsgPosChanging"));
    695701    if(fNoSizeMsg)
    696702        return 1;
     
    702708ULONG Win32BaseWindow::MsgPosChanged(LPARAM lp)
    703709{
    704     dprintf(("MsgPosChanged"));
    705710    if(fNoSizeMsg)
    706711        return 1;
     
    19691974   HWND hParent = 0;
    19701975
    1971    dprintf (("SetWindowPos %x %x (%d,%d)(%d,%d) %x", Win32Hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags));
    1972 
    1973    if (fuFlags &
     1976    dprintf (("SetWindowPos %x %x (%d,%d)(%d,%d) %x", Win32Hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags));
     1977
     1978    if (fuFlags &
    19741979       ~(SWP_NOSIZE     | SWP_NOMOVE     | SWP_NOZORDER     |
    19751980         SWP_NOREDRAW   | SWP_NOACTIVATE | SWP_FRAMECHANGED |
    19761981         SWP_SHOWWINDOW | SWP_HIDEWINDOW | SWP_NOCOPYBITS   |
    19771982         SWP_NOOWNERZORDER))
    1978    {
    1979       return FALSE;
    1980    }
    1981 
    1982    WINDOWPOS wpos;
    1983    SWP swp, swpOld;
    1984 
    1985    wpos.flags            = fuFlags;
    1986    wpos.cy               = cy;
    1987    wpos.cx               = cx;
    1988    wpos.x                = x;
    1989    wpos.y                = y;
    1990    wpos.hwndInsertAfter  = hwndInsertAfter;
    1991    wpos.hwnd             = getWindowHandle();
    1992 
    1993    //SvL: Add bordersize
    1994    wpos.cy              += 2*borderHeight;
    1995    wpos.cx              += 2*borderWidth;
    1996 
    1997    if(~fuFlags & (SWP_NOMOVE | SWP_NOSIZE))
    1998    {
     1983    {
     1984        return FALSE;
     1985    }
     1986
     1987    WINDOWPOS wpos;
     1988    SWP swp, swpOld;
     1989
     1990    wpos.flags            = fuFlags;
     1991    wpos.cy               = cy;
     1992    wpos.cx               = cx;
     1993    wpos.x                = x;
     1994    wpos.y                = y;
     1995    wpos.hwndInsertAfter  = hwndInsertAfter;
     1996    wpos.hwnd             = getWindowHandle();
     1997
     1998    if(~fuFlags & (SWP_NOMOVE | SWP_NOSIZE))
     1999    {
    19992000       if (isChild())
    20002001       {
     
    20022003       }
    20032004       OSLibWinQueryWindowPos(OS2HwndFrame, &swpOld);
    2004    }
    2005 
    2006    OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, hParent, OS2HwndFrame);
    2007    if (swp.fl == 0)
     2005    }
     2006
     2007    OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, hParent, OS2HwndFrame);
     2008    if (swp.fl == 0)
    20082009      return TRUE;
    20092010
    20102011//   if ((swp.fl & SWPOS_ZORDER) && (swp.hwndInsertBehind > HWNDOS_BOTTOM))
    2011    if ((swp.hwndInsertBehind > HWNDOS_BOTTOM))
    2012    {
     2012    if ((swp.hwndInsertBehind > HWNDOS_BOTTOM))
     2013    {
    20132014        Win32BaseWindow *wndBehind = Win32BaseWindow::GetWindowFromHandle(swp.hwndInsertBehind);
    20142015        if(wndBehind) {
     
    20192020            swp.hwndInsertBehind = 0;
    20202021        }
    2021    }
     2022    }
    20222023#if 0
    2023    if (isFrameWindow())
    2024    {
     2024    if (isFrameWindow())
     2025    {
    20252026      if (!isChild())
    20262027      {
     
    20352036      }
    20362037      swp.hwnd = OS2HwndFrame;
    2037    }
    2038    else
     2038    }
     2039    else
    20392040#endif
    20402041      swp.hwnd = OS2HwndFrame;
    20412042
    2042    dprintf (("WinSetWindowPos %x %x (%d,%d)(%d,%d) %x", swp.hwnd, swp.hwndInsertBehind, swp.x, swp.y, swp.cx, swp.cy, swp.fl));
    2043 
    2044    rc = OSLibWinSetMultWindowPos(&swp, 1);
    2045 
    2046    if (rc == FALSE)
    2047    {
     2043    dprintf (("WinSetWindowPos %x %x (%d,%d)(%d,%d) %x", swp.hwnd, swp.hwndInsertBehind, swp.x, swp.y, swp.cx, swp.cy, swp.fl));
     2044
     2045    rc = OSLibWinSetMultWindowPos(&swp, 1);
     2046
     2047    if (rc == FALSE)
     2048    {
    20482049        dprintf(("OSLibWinSetMultWindowPos failed!"));
    2049    }
    2050    else
    2051    {
    2052       if (fuFlags & SWP_FRAMECHANGED_W)
    2053          OSLibSendMessage (OS2HwndFrame, 0x42 /*WM_UPDATEFRAME*/, -1, 0);
    2054    }
    2055 
    2056    return (rc);
     2050    }
     2051    else
     2052    {
     2053        if (fuFlags & SWP_FRAMECHANGED_W)
     2054            OSLibSendMessage (OS2HwndFrame, 0x42 /*WM_UPDATEFRAME*/, -1, 0);
     2055    }
     2056
     2057    return (rc);
    20572058}
    20582059//******************************************************************************
     
    20612062BOOL Win32BaseWindow::DestroyWindow()
    20622063{
    2063   return OSLibWinDestroyWindow(OS2HwndFrame);
     2064    return OSLibWinDestroyWindow(OS2HwndFrame);
    20642065}
    20652066//******************************************************************************
     
    23492350BOOL Win32BaseWindow::GetWindowRect(PRECT pRect)
    23502351{
    2351     return OSLibWinQueryWindowRect(OS2Hwnd, pRect, RELATIVE_TO_SCREEN);
     2352    return OSLibWinQueryWindowRect(OS2HwndFrame, pRect, RELATIVE_TO_SCREEN);
    23522353}
    23532354//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.