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

client positioning + scrollbar fixes

File:
1 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:
Note: See TracChangeset for help on using the changeset viewer.