Changeset 2418 for trunk/src/user32


Ignore:
Timestamp:
Jan 12, 2000, 4:14:16 PM (26 years ago)
Author:
sandervl
Message:

client positioning + scrollbar fixes

Location:
trunk/src/user32/new
Files:
5 edited

Legend:

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

    r2415 r2418  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.11 2000-01-12 12:40:44 sandervl Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.12 2000-01-12 15:14:15 sandervl Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    235235        return TRUE;
    236236      }
    237 
    238237    }
    239238    //do normal translation for all other messages
     
    295294
    296295    case WM_WINDOWPOSCHANGED:
    297         goto dummymessage;
     296    {
     297      PSWP      pswp  = (PSWP)os2Msg->mp1;
     298      SWP       swpOld = *(pswp + 1);
     299      HWND      hParent = NULLHANDLE;
     300      LONG      yDelta = pswp->cy - swpOld.cy;
     301      LONG      xDelta = pswp->cx - swpOld.cx;
     302
     303        dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
     304
     305        if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto dummymessage;
     306
     307        if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
     308            if (win32wnd->isChild()) {
     309                if(win32wnd->getParent()) {
     310                        hParent = win32wnd->getParent()->getOS2WindowHandle();
     311                }
     312                else    goto dummymessage; //parent has just been destroyed
     313            }
     314        }
     315        OSLibMapSWPtoWINDOWPOS(pswp, &thdb->wp, &swpOld, hParent, win32wnd->getOS2FrameWindowHandle());
     316
     317        if (!win32wnd->CanReceiveSizeMsgs())    goto dummymessage;
     318
     319        dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));
     320        win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
     321
     322        thdb->wp.hwnd = win32wnd->getWindowHandle();
     323        if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
     324        {
     325           Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
     326           if(wndAfter)
     327                thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
     328        }
     329
     330        PRECT lpRect = win32wnd->getWindowRect();
     331        //SvL: Only send it when the client has changed & the frame hasn't
     332        //     If the frame size/position has changed, pmframe.cpp will send
     333        //     this message
     334        if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) {
     335                winMsg->message = WINWM_WINDOWPOSCHANGED;
     336                winMsg->lParam  = (LPARAM)&thdb->wp;
     337        }
     338        else {
     339////            win32wnd->setWindowRect(thdb->wp.x, thdb->wp.y, thdb->wp.x+thdb->wp.cx, thdb->wp.y+thdb->wp.cy);
     340            goto dummymessage;
     341        }
     342    }
    298343
    299344    case WM_ACTIVATE:
  • trunk/src/user32/new/pmframe.cpp

    r2415 r2418  
    1 /* $Id: pmframe.cpp,v 1.11 2000-01-12 12:40:45 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.12 2000-01-12 15:14:16 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    391391  return WinDefWindowProc(hwnd,msg,mp1,mp2);
    392392}
    393 
     393//******************************************************************************
     394//******************************************************************************
    394395PVOID FrameSubclassFrameWindow(Win32BaseWindow *win32wnd)
    395396{
    396397  return WinSubclassWindow(win32wnd->getOS2FrameWindowHandle(),PFNWP(Win32FrameProc));
    397398}
    398 
    399 VOID FrameUpdateFrame(Win32BaseWindow *win32wnd,DWORD flags)
     399//******************************************************************************
     400//******************************************************************************
     401VOID FrameUpdateClient(Win32BaseWindow *win32wnd)
    400402{
    401   WinSendMsg(win32wnd->getOS2FrameWindowHandle(),WM_UPDATEFRAME,(MPARAM)flags,(MPARAM)0);
     403  RECTL rect;
     404  SWP swpClient = {0};
     405
     406        win32wnd->MsgFormatFrame();
     407        //CB: todo: use result for WM_CALCVALIDRECTS
     408        mapWin32ToOS2Rect(WinQueryWindow(win32wnd->getOS2FrameWindowHandle(),QW_PARENT),win32wnd->getOS2FrameWindowHandle(),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect);
     409
     410        swpClient.hwnd = win32wnd->getOS2WindowHandle();
     411        swpClient.hwndInsertBehind = 0;
     412        swpClient.x  = rect.xLeft;
     413        swpClient.y  = rect.yBottom;
     414        swpClient.cx = rect.xRight-rect.xLeft;
     415        swpClient.cy = rect.yTop-rect.yBottom;
     416        swpClient.fl = SWP_MOVE | SWP_SIZE;
     417        WinSetMultWindowPos(GetThreadHAB(), &swpClient, 1);
    402418}
     419//******************************************************************************
     420//******************************************************************************
  • trunk/src/user32/new/pmframe.h

    r2381 r2418  
    1 /* $Id: pmframe.h,v 1.3 2000-01-09 14:14:23 cbratschi Exp $ */
     1/* $Id: pmframe.h,v 1.4 2000-01-12 15:14:16 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    1010
    1111PVOID FrameSubclassFrameWindow(Win32BaseWindow *win32wnd);
    12 VOID  FrameUpdateFrame(Win32BaseWindow *win32wnd,DWORD flags);
     12VOID  FrameUpdateClient(Win32BaseWindow *win32wnd);
    1313
    1414#define HTERROR_W             (-2)
  • trunk/src/user32/new/scroll.cpp

    r2381 r2418  
    1 /* $Id: scroll.cpp,v 1.8 2000-01-09 14:14:23 cbratschi Exp $ */
     1/* $Id: scroll.cpp,v 1.9 2000-01-12 15:14:16 sandervl Exp $ */
    22/*
    33 * Scrollbar control
     
    14711471{
    14721472    Win32BaseWindow *win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd);
    1473     BOOL fShowH = (nBar == SB_HORZ) ? 0:fShow,fShowV = (nBar == SB_VERT) ? 0:fShow;
     1473//    BOOL fShowH = (nBar == SB_HORZ) ? 0:fShow,fShowV = (nBar == SB_VERT) ? 0:fShow;
     1474    BOOL fShowH = (nBar == SB_HORZ) ? fShow : 0;
     1475    BOOL fShowV = (nBar == SB_VERT) ? fShow : 0;
    14741476
    14751477    dprintf(("ShowScrollBar %04x %d %d\n", hwnd, nBar, fShow));
  • trunk/src/user32/new/win32wbase.cpp

    r2415 r2418  
    1 /* $Id: win32wbase.cpp,v 1.35 2000-01-12 12:40:47 sandervl Exp $ */
     1/* $Id: win32wbase.cpp,v 1.36 2000-01-12 15:14:16 sandervl Exp $ */
    22/*
    33 * Win32 Window Base Class for OS/2
     
    20282028    }
    20292029
     2030    if(IsWindowDestroyed()) {
     2031        //changing the position of a window that's being destroyed can cause crashes in PMMERGE
     2032        dprintf(("SetWindowPos; window already destroyed"));
     2033        return TRUE;
     2034    }
    20302035    WINDOWPOS wpos;
    20312036    SWP swp, swpOld;
     
    20532058
    20542059    OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, hParent, OS2HwndFrame);
    2055     if (swp.fl == 0)
    2056       return TRUE;
     2060    if (swp.fl == 0) {
     2061        if (fuFlags & SWP_FRAMECHANGED)
     2062        {
     2063            FrameUpdateClient(this);
     2064        }
     2065        return TRUE;
     2066    }
    20572067
    20582068//   if ((swp.fl & SWPOS_ZORDER) && (swp.hwndInsertBehind > HWNDOS_BOTTOM))
     
    20982108    }
    20992109
    2100     if (fuFlags == SWP_FRAMECHANGED)
    2101     {
    2102       //CB: optimize: if frame size has changed not necessary!
    2103       FrameUpdateFrame(this,0);
     2110    if(fuFlags & SWP_FRAMECHANGED && (fuFlags & (SWP_NOMOVE | SWP_NOSIZE) == (SWP_NOMOVE | SWP_NOSIZE)))
     2111    {
     2112        FrameUpdateClient(this);
    21042113    }
    21052114
Note: See TracChangeset for help on using the changeset viewer.