Ignore:
Timestamp:
Oct 23, 1999, 12:21:45 PM (26 years ago)
Author:
sandervl
Message:

Put back pos change messages in pmwindow.cpp, changed message logging

File:
1 edited

Legend:

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

    r1405 r1408  
    1 /* $Id: pmframe.cpp,v 1.9 1999-10-22 18:11:46 sandervl Exp $ */
     1/* $Id: pmframe.cpp,v 1.10 1999-10-23 10:21:43 sandervl Exp $ */
    22/*
    33 * Win32 Frame Managment Code for OS/2
     
    180180  switch(msg)
    181181  {
    182 #if 1
     182#if 0
    183183    case WM_ADJUSTWINDOWPOS:
    184184    {
     
    194194            goto RunDefFrameProc;
    195195        if(!win32wnd->CanReceiveSizeMsgs()) {
    196             break;
     196            goto RunDefFrameProc;
    197197        }
    198198
     
    233233    }
    234234
    235     case WM_WINDOWPOSCHANGED:
    236     {
    237       PSWP      pswp   = (PSWP)mp1;
    238       SWP       swpOld = *(pswp + 1);
    239       WINDOWPOS wp;
    240       ULONG     parentHeight = 0;
    241       HWND      hParent = NULLHANDLE, hFrame = NULLHANDLE;
    242       LONG      yDelta = pswp->cy - swpOld.cy;
    243       LONG      xDelta = pswp->cx - swpOld.cx;
    244 
    245         dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    246         RestoreOS2TIB();
    247         rc = OldFrameProc(hwnd,msg,mp1,mp2);
    248         SetWin32TIB();
    249 //        dprintf(("After calling frameproc: (%x) %x %x (%d,%d) (%d,%d)", mp2, hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    250 
    251         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0)
    252             break;
    253 
    254         if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    255             if (win32wnd->isChild()) {
    256                 if(win32wnd->getParent()) {
    257                         hParent = win32wnd->getParent()->getOS2WindowHandle();
    258                 }
    259                 else    break; //parent has just been destroyed
    260             }
    261         }
    262         OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd);
    263 
    264         //delta is difference between old and new client height
    265         yDelta = swpOld.cy - win32wnd->getWindowHeight();
    266 
    267         win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy);
    268         win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    269 
    270         if(!win32wnd->CanReceiveSizeMsgs())
    271             break;
    272 
    273         wp.hwnd = win32wnd->getWindowHandle();
    274         if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    275         {
    276            Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    277            if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle();
    278         }
    279 
    280         if (yDelta != 0 || xDelta != 0)
    281         {
    282             HENUM henum = WinBeginEnumWindows(WinWindowFromID(pswp->hwnd, FID_CLIENT));
    283             SWP swp[10];
    284             int i = 0;
    285             HWND hwnd;
    286 
    287             while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE)
    288             {
    289 #if 0
    290                 if (mdiClient )
    291                 {
    292                   continue;
    293                 }
    294 #endif
    295                 WinQueryWindowPos(hwnd, &(swp[i]));
    296 
    297 #ifdef DEBUG
    298                 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd);
    299                 dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd,
    300                          yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl));
    301 #endif
    302 
    303                 if(swp[i].y != 0) {
    304                     //child window at offset <> 0 from client area -> offset now changes
    305                     swp[i].y  += yDelta;
    306                     swp[i].fl &= ~(SWP_NOREDRAW);
    307                 }
    308                 //else child window with the same start coorindates as the client area
    309                 //The app should resize it.
    310 
    311                if (i == 9)
    312                 {
    313                     WinSetMultWindowPos(GetThreadHAB(), swp, 10);
    314                     i = 0;
    315                 }
    316                 else
    317                 {
    318                     i++;
    319                 }
    320             }
    321 
    322             WinEndEnumWindows(henum);
    323 
    324             if (i)
    325                WinSetMultWindowPos(GetThreadHAB(), swp, i);
    326         }
    327         if (yDelta != 0)
    328         {
    329             POINT pt;
    330             if(GetCaretPos (&pt) == TRUE)
    331             {
    332                 pt.y -= yDelta;
    333                 SetCaretPos (pt.x, pt.y);
    334             }
    335         }
    336         win32wnd->MsgPosChanged((LPARAM)&wp);
    337         break;
    338     }
    339235#else
    340236    case WM_ADJUSTWINDOWPOS:
Note: See TracChangeset for help on using the changeset viewer.