Ignore:
Timestamp:
Jan 5, 2000, 10:25:08 PM (26 years ago)
Author:
cbratschi
Message:

single frame works now

File:
1 edited

Legend:

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

    r2309 r2335  
    1 /* $Id: oslibmsgtranslate.cpp,v 1.4 2000-01-03 20:53:49 cbratschi Exp $ */
     1/* $Id: oslibmsgtranslate.cpp,v 1.5 2000-01-05 21:25:04 cbratschi Exp $ */
    22/*
    33 * Window message translation functions for OS/2
     
    112112  memset(winMsg, 0, sizeof(MSG));
    113113  win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(os2Msg->hwnd);
     114  if (!win32wnd) win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(os2Msg->hwnd);
    114115  //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle
    115116  if((win32wnd == 0) && (os2Msg->msg != WM_CREATE) && (os2Msg->msg != WIN32APP_POSTMSG))
     
    120121  winMsg->pt.x = os2Msg->ptl.x;
    121122  winMsg->pt.y = mapScreenY(os2Msg->ptl.y);
     123
    122124  if(win32wnd) //==0 for WM_CREATE
    123125    winMsg->hwnd = win32wnd->getWindowHandle();
     
    206208      case WM_HITTEST:
    207209      {
    208         OSLIBPOINT pt;
    209 
    210         pt.x = (*(POINTS *)&os2Msg->mp1).x;
    211         pt.y = (*(POINTS *)&os2Msg->mp1).y;
    212 
    213         mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);
    214210        winMsg->message  = WINWM_NCHITTEST;
    215211        winMsg->wParam  = 0;
    216         winMsg->lParam  = MAKELONG((USHORT)pt.x, (USHORT)pt.y);
     212        winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    217213        return TRUE;
    218214      }
     
    276272
    277273    case WM_WINDOWPOSCHANGED:
    278     {
    279       PSWP      pswp  = (PSWP)os2Msg->mp1;
    280       SWP       swpOld = *(pswp + 1);
    281       HWND      hParent = NULLHANDLE;
    282       LONG      yDelta = pswp->cy - swpOld.cy;
    283       LONG      xDelta = pswp->cx - swpOld.cx;
    284 
    285         dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));
    286 
    287         if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto dummymessage;
    288 
    289         if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {
    290             if (win32wnd->isChild()) {
    291                 if(win32wnd->getParent()) {
    292                         hParent = win32wnd->getParent()->getOS2WindowHandle();
    293                 }
    294                 else    goto dummymessage; //parent has just been destroyed
    295             }
    296         }
    297         OSLibMapSWPtoWINDOWPOS(pswp, &thdb->wp, &swpOld, hParent, win32wnd->getOS2FrameWindowHandle());
    298 
    299         if (!win32wnd->CanReceiveSizeMsgs())    goto dummymessage;
    300 //CB: todo: send WM_NCCALCSIZE
    301 #if 0   //CB: ignore it
    302         dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));
    303         win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);
    304 
    305         thdb->wp.hwnd = win32wnd->getWindowHandle();
    306         if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))
    307         {
    308            Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);
    309            thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();
    310         }
    311 
    312         PRECT lpRect = win32wnd->getWindowRect();
    313         //SvL: Only send it when the client has changed & the frame hasn't
    314         //     If the frame size/position has changed, pmframe.cpp will send
    315         //     this message
    316         if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) {
    317                 winMsg->message    = WINWM_WINDOWPOSCHANGED;
    318                 winMsg->lParam = (LPARAM)&thdb->wp;
    319         }
    320         else {
    321             win32wnd->setWindowRect(thdb->wp.x, thdb->wp.y, thdb->wp.x+thdb->wp.cx, thdb->wp.y+thdb->wp.cy);
    322             goto dummymessage;
    323         }
    324 #else
    325274        goto dummymessage;
    326 #endif
    327     }
    328275
    329276    case WM_ACTIVATE:
     
    668615    case WM_HITTEST:
    669616    {
    670         OSLIBPOINT pt;
    671 
    672         pt.x = (*(POINTS *)&os2Msg->mp1).x;
    673         pt.y = (*(POINTS *)&os2Msg->mp1).y;
    674 
    675         mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);
    676617        winMsg->message  = WINWM_NCHITTEST;
    677618        winMsg->wParam  = 0;
    678         winMsg->lParam  = MAKELONG((USHORT)pt.x, (USHORT)pt.y);
     619        winMsg->lParam  = MAKELONG(winMsg->pt.x,winMsg->pt.y);
    679620        break;
    680621    }
Note: See TracChangeset for help on using the changeset viewer.