Changeset 2335 for trunk/src/user32/new/oslibmsgtranslate.cpp
- Timestamp:
- Jan 5, 2000, 10:25:08 PM (26 years ago)
- 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:49cbratschi Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.5 2000-01-05 21:25:04 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 112 112 memset(winMsg, 0, sizeof(MSG)); 113 113 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(os2Msg->hwnd); 114 if (!win32wnd) win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(os2Msg->hwnd); 114 115 //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle 115 116 if((win32wnd == 0) && (os2Msg->msg != WM_CREATE) && (os2Msg->msg != WIN32APP_POSTMSG)) … … 120 121 winMsg->pt.x = os2Msg->ptl.x; 121 122 winMsg->pt.y = mapScreenY(os2Msg->ptl.y); 123 122 124 if(win32wnd) //==0 for WM_CREATE 123 125 winMsg->hwnd = win32wnd->getWindowHandle(); … … 206 208 case WM_HITTEST: 207 209 { 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);214 210 winMsg->message = WINWM_NCHITTEST; 215 211 winMsg->wParam = 0; 216 winMsg->lParam = MAKELONG( (USHORT)pt.x, (USHORT)pt.y);212 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 217 213 return TRUE; 218 214 } … … 276 272 277 273 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 destroyed295 }296 }297 OSLibMapSWPtoWINDOWPOS(pswp, &thdb->wp, &swpOld, hParent, win32wnd->getOS2FrameWindowHandle());298 299 if (!win32wnd->CanReceiveSizeMsgs()) goto dummymessage;300 //CB: todo: send WM_NCCALCSIZE301 #if 0 //CB: ignore it302 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't314 // If the frame size/position has changed, pmframe.cpp will send315 // this message316 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 #else325 274 goto dummymessage; 326 #endif327 }328 275 329 276 case WM_ACTIVATE: … … 668 615 case WM_HITTEST: 669 616 { 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);676 617 winMsg->message = WINWM_NCHITTEST; 677 618 winMsg->wParam = 0; 678 winMsg->lParam = MAKELONG( (USHORT)pt.x, (USHORT)pt.y);619 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 679 620 break; 680 621 }
Note:
See TracChangeset
for help on using the changeset viewer.