Changeset 1297 for trunk/src


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

Lots of window fixes & changes

Location:
trunk/src/user32
Files:
8 edited

Legend:

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

    r1281 r1297  
    1 /* $Id: listbox.cpp,v 1.5 1999-10-14 09:22:39 sandervl Exp $ */
     1/* $Id: listbox.cpp,v 1.6 1999-10-14 18:27:55 sandervl Exp $ */
    22/*
    33 * Listbox controls
     
    322322static void LISTBOX_UpdateSize( HWND hwnd, LB_DESCR *descr )
    323323{
    324     RECT rect;
    325 
     324    RECT rect, rectWindow;
     325
     326    GetWindowRect( hwnd, &rectWindow );
     327    OffsetRect(&rectWindow, -rectWindow.left, -rectWindow.top);
    326328    GetClientRect( hwnd, &rect );
     329
    327330    descr->width  = rect.right - rect.left;
    328331    descr->height = rect.bottom - rect.top;
     
    336339                    descr->height - descr->height%descr->item_height));
    337340            SetWindowPos( hwnd, 0, 0, 0,
    338                             descr->width,
    339                             descr->height -
     341                            rectWindow.right - rectWindow.left,
     342                            rectWindow.bottom - rectWindow.top -
    340343                                (descr->height % descr->item_height),
    341344                            SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE );
  • trunk/src/user32/oslibgdi.cpp

    r1057 r1297  
    1 /* $Id: oslibgdi.cpp,v 1.2 1999-09-26 10:09:59 sandervl Exp $ */
     1/* $Id: oslibgdi.cpp,v 1.3 1999-10-14 18:27:57 sandervl Exp $ */
    22/*
    33 * Window GDI wrapper functions for OS/2
     
    7474{
    7575 RECTLOS2 rectParent = {0};
     76 Win32BaseWindow *window;
     77 LONG height;
    7678
    7779    if(hwndParent == OSLIB_HWND_DESKTOP) {
     
    8385    }
    8486
    85     ULONG length = rectOS2->yTop - rectOS2->yBottom;
    86 
    87     rectWin32->bottom = length - rectOS2->yBottom;
    88     rectWin32->top    = length - rectOS2->yTop;
     87    if(hwndParent != HWND_DESKTOP)
     88    {
     89         window = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwndParent);
     90         if(window == NULL)
     91                return FALSE;
     92         height = window->getWindowHeight();
     93    }
     94    else height = OSLibQueryScreenHeight();
     95
     96    rectWin32->bottom = height - rectOS2->yBottom;
     97    rectWin32->top    = height - rectOS2->yTop;
    8998    rectWin32->left   = rectOS2->xLeft;
    9099    rectWin32->right  = rectOS2->xRight;
  • trunk/src/user32/oslibwin.cpp

    r1281 r1297  
    1 /* $Id: oslibwin.cpp,v 1.27 1999-10-14 09:22:40 sandervl Exp $ */
     1/* $Id: oslibwin.cpp,v 1.28 1999-10-14 18:27:57 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    4343//******************************************************************************
    4444//******************************************************************************
     45BOOL OSLibWinSetOwner(HWND hwnd, HWND hwndOwner)
     46{
     47  return WinSetOwner(hwnd, hwndOwner);
     48}
     49//******************************************************************************
     50//******************************************************************************
    4551HWND OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
    46                           char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame)
     52                          char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame,
     53                          ULONG id)
    4754{
    4855 HWND  hwndClient;
     
    7380        *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle,
    7481                                       &dwFrameStyle, WIN32_STDCLASS,
    75                                        "", dwClientStyle, 0, 0, &hwndClient);
     82                                       "", dwClientStyle, 0, id, &hwndClient);
    7683        if(*hwndFrame) {
    7784                if(pszName) {
     
    320327BOOL OSLibWinShowWindow(HWND hwnd, ULONG fl)
    321328{
    322  BOOL rc;
     329 BOOL rc = 1;
    323330
    324331  if(fl & SWP_SHOW) {
  • trunk/src/user32/oslibwin.h

    r1265 r1297  
    1 /* $Id: oslibwin.h,v 1.15 1999-10-13 14:24:25 sandervl Exp $ */
     1/* $Id: oslibwin.h,v 1.16 1999-10-14 18:27:57 sandervl Exp $ */
    22/*
    33 * Window API wrappers for OS/2
     
    3434
    3535BOOL  OSLibWinSetParent(HWND hwnd, HWND hwndParent, ULONG fRedraw = TRUE);
     36BOOL  OSLibWinSetOwner(HWND hwnd, HWND hwndOwner);
    3637
    3738
    3839HWND  OSLibWinCreateWindow(HWND hwndParent, ULONG dwWinStyle, ULONG dwFrameStyle,
    39                            char *pszName, HWND Owner, ULONG fHWND_BOTTOM, HWND *hwndFrame);
     40                           char *pszName, HWND Owner, ULONG fHWND_BOTTOM,
     41                           HWND *hwndFrame, ULONG id);
    4042
    4143BOOL  OSLibWinConvertStyle(ULONG dwStyle, ULONG *dwExStyle, ULONG *OSWinStyle, ULONG *OSFrameStyle, ULONG *borderWidth, ULONG *borderHeight);
  • trunk/src/user32/pmframe.cpp

    r1248 r1297  
    1 /* $Id: pmframe.cpp,v 1.4 1999-10-11 16:04:51 cbratschi Exp $ */
     1/* $Id: pmframe.cpp,v 1.5 1999-10-14 18:27:58 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    177177  switch(msg)
    178178  {
     179    case WM_ADJUSTWINDOWPOS:
     180    {
     181      PSWP     pswp = (PSWP)mp1;
     182      Win32BaseWindow *wndchild;
     183
     184      wndchild = Win32BaseWindow::GetWindowFromOS2FrameHandle(pswp->hwnd);
     185      if(wndchild && wndchild->isChild()) {
     186        dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     187        RestoreOS2TIB();
     188        return (MRESULT)0;
     189      }
     190      goto RunDefFrameProc;
     191    }
     192#if 0
     193    case WM_WINDOWPOSCHANGED:
     194    {
     195      PSWP      pswp  = (PSWP)mp1;
     196      dprintf(("PMFRAME: WM_WINDOWPOSCHANGED %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     197      goto RunDefFrameProc;
     198    }
     199
     200    case WM_FORMATFRAME:
     201    {
     202      PSWP      pswp  = (PSWP)mp1;
     203      dprintf(("PMFRAME: WM_FORMATFRAME %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     204      goto RunDefFrameProc;
     205    }
     206#endif
     207
    179208    case WM_DESTROY:
    180209      #ifdef PMFRAMELOG
  • trunk/src/user32/pmwindow.cpp

    r1281 r1297  
    1 /* $Id: pmwindow.cpp,v 1.26 1999-10-14 09:22:40 sandervl Exp $ */
     1/* $Id: pmwindow.cpp,v 1.27 1999-10-14 18:27:58 sandervl Exp $ */
    22/*
    33 * Win32 Window Managment Code for OS/2
     
    241241
    242242    case WM_SHOW:
    243         dprintf(("OS2: WM_SHOW %x", hwnd));
     243        dprintf(("OS2: WM_SHOW %x %d", hwnd, mp1));
    244244        if(win32wnd->MsgShow((ULONG)mp1)) {
    245245                goto RunDefWndProc;
     
    306306        dprintf(("WINDOWPOSCHANGE %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), win32wnd->getOS2FrameWindowHandle(),
    307307                         swpFrame.fl,swpFrame.x, swpFrame.y, swpFrame.cx, swpFrame.cy));
    308 
    309         RECTL rect;
    310         WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(), &rect);
    311         dprintf(("WINDOWPOSCHANGE %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), win32wnd->getOS2FrameWindowHandle(),
    312                          rect.xLeft, rect.yBottom, rect.xRight, rect.yTop));
    313 
    314         win32wnd->setWindowRect(wp.x, wp.y, wp.x + wp.cx, wp.y + wp.cy);
     308        POINTL point;
     309        point.x = swpFrame.x;
     310        point.y = swpFrame.y;
     311        WinMapWindowPoints(win32wnd->getOS2FrameWindowHandle(), HWND_DESKTOP,
     312                           &point, 1);
     313
     314        win32wnd->setWindowRect(point.x, point.y, point.x+swpFrame.cx, point.y+swpFrame.cy);
    315315        win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy);
    316316
     
    342342#ifdef DEBUG
    343343                Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    344                 dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d)", (window) ? window->getWindowHandle() : hwnd,
    345                          yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy));
     344                dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd,
     345                         yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl));
    346346#endif
    347347
     
    349349                    //child window at offset <> 0 from client area -> offset now changes
    350350                    swp[i].y  += yDelta;
    351                     swp[i].fl &= ~SWP_NOREDRAW;
     351                    swp[i].fl &= ~(SWP_NOREDRAW);
    352352                }
    353353                //else child window with the same start coorindates as the client area
     
    387387    case WM_ERASEBACKGROUND:
    388388    {
     389        dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle()));
    389390        if (!win32wnd->isSupressErase()) {
    390391            BOOL erased = sendEraseBkgnd (win32wnd);
  • 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//******************************************************************************
  • trunk/src/user32/window.cpp

    r1256 r1297  
    1 /* $Id: window.cpp,v 1.14 1999-10-12 14:47:24 sandervl Exp $ */
     1/* $Id: window.cpp,v 1.15 1999-10-14 18:27:59 sandervl Exp $ */
    22/*
    33 * Win32 window apis for OS/2
     
    617617BOOL WIN32API GetWindowRect( HWND hwnd, PRECT pRect)
    618618{
    619    Win32BaseWindow *window;
     619  Win32BaseWindow *window;
     620  BOOL rc;
    620621
    621622    window = Win32BaseWindow::GetWindowFromHandle(hwnd);
     
    625626        return 0;
    626627    }
    627     dprintf(("GetWindowRect %x", hwnd));
    628     return window->GetWindowRect(pRect);
     628    rc = window->GetWindowRect(pRect);
     629    dprintf(("GetWindowRect %x (%d,%d) (%d,%d)", hwnd, pRect->left, pRect->top, pRect->right, pRect->bottom));
     630    return rc;
    629631}
    630632//******************************************************************************
Note: See TracChangeset for help on using the changeset viewer.