Changeset 2383 for trunk/src/user32/oslibmsgtranslate.cpp
- Timestamp:
- Jan 9, 2000, 3:38:30 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsgtranslate.cpp
r2378 r2383 1 /* $Id: oslibmsgtranslate.cpp,v 1.1 0 2000-01-08 16:53:38sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.11 2000-01-09 14:37:09 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 7 7 * Copyright 1999 Daniela Engert (dani@ngrt.de) 8 8 * Copyright 1999 Rene Pronk (R.Pronk@twi.tudelft.nl) 9 * 10 * NOTE: WM_NCHITTEST messages are sent whenever the mouse cursor moves or a mouse button is clicked/released 11 * (directly when receiving those messages) 9 12 * 10 13 * Project Odin Software License can be found in LICENSE.TXT … … 119 122 fIsFrameControl = (win32wnd != 0); 120 123 } 121 //NOTE: We only translate WM_PAINT /WM_HITTEST& mouse messages; the rest must not be seen by win32 apps124 //NOTE: We only translate WM_PAINT, WM_ACTIVATE & mouse messages; the rest must not be seen by win32 apps 122 125 } 123 126 //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle … … 226 229 // this message 227 230 if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) { 228 winMsg->message 229 winMsg->lParam = (LPARAM)&thdb->wp;231 winMsg->message = WINWM_WINDOWPOSCHANGED; 232 winMsg->lParam = (LPARAM)&thdb->wp; 230 233 } 231 234 else { … … 252 255 } 253 256 254 winMsg->message = WINWM_ACTIVATE; 255 winMsg->wParam = MAKELONG((SHORT1FROMMP(os2Msg->mp1)) ? WA_ACTIVE_W : WA_INACTIVE_W, fMinimized); 256 winMsg->lParam = (LPARAM)hwndActivate; 257 if(fIsFrameControl) { 258 fTranslateFrameControlMsg = TRUE; //we want a win32 app to see this msg for a frame control 259 winMsg->message = WINWM_NCACTIVATE; 260 winMsg->wParam = SHORT1FROMMP(os2Msg->mp1); 261 } 262 else 263 { 264 winMsg->message = WINWM_ACTIVATE; 265 winMsg->wParam = MAKELONG((SHORT1FROMMP(os2Msg->mp1)) ? WA_ACTIVE_W : WA_INACTIVE_W, fMinimized); 266 winMsg->lParam = (LPARAM)hwndActivate; 267 } 257 268 break; 258 269 } … … 292 303 case WM_BUTTON3UP: 293 304 case WM_BUTTON3DBLCLK: 305 { 306 ULONG hittest; 307 294 308 if(fIsFrameControl) { 295 309 fTranslateFrameControlMsg = TRUE; //we want a win32 app to see this msg for a frame control 296 310 } 297 311 312 hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y); 313 298 314 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 299 if( win32wnd->lastHitTestVal!= HTCLIENT_W) {315 if(hittest != HTCLIENT_W) { 300 316 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 301 winMsg->wParam = win32wnd->lastHitTestVal;317 winMsg->wParam = hittest; 302 318 winMsg->lParam = MAKELONG(winMsg->pt.x, winMsg->pt.y); //screen coordinates 303 319 } … … 311 327 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 312 328 } 313 314 break;329 break; 330 } 315 331 316 332 case WM_BUTTON2MOTIONSTART: … … 327 343 case WM_MOUSEMOVE: 328 344 { 329 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE ;345 ULONG keystate = 0, setcursormsg = WINWM_MOUSEMOVE, hittest; 330 346 331 347 if(fIsFrameControl) { … … 344 360 keystate |= MK_CONTROL_W; 345 361 362 hittest = win32wnd->MsgHitTest(winMsg->pt.x, winMsg->pt.y); 363 346 364 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 347 if( win32wnd->lastHitTestVal!= HTCLIENT_W)365 if(hittest != HTCLIENT_W) 348 366 { 349 367 setcursormsg = WINWM_NCMOUSEMOVE; 350 winMsg->wParam = (WPARAM) win32wnd->lastHitTestVal;368 winMsg->wParam = (WPARAM)hittest; 351 369 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 352 370 } … … 546 564 547 565 if(wndParams->fsStatus & WPM_TEXT) { 548 win32wnd->MsgSetText(wndParams->pszText, wndParams->cchText); 566 winMsg->message = WINWM_SETTEXT; 567 winMsg->lParam = (LPARAM)wndParams->pszText; 549 568 break; 550 569 } … … 585 604 } 586 605 else winMsg->message = WINWM_PAINT; 587 break;588 }589 590 case WM_HITTEST:591 {592 OSLIBPOINT pt;593 594 fTranslateFrameControlMsg = TRUE; //we want a win32 app to see this msg for a frame control595 596 pt.x = (*(POINTS *)&os2Msg->mp1).x;597 pt.y = (*(POINTS *)&os2Msg->mp1).y;598 599 mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);600 winMsg->message = WINWM_NCHITTEST;601 winMsg->wParam = 0;602 winMsg->lParam = MAKELONG((USHORT)pt.x, (USHORT)pt.y);603 606 break; 604 607 }
Note:
See TracChangeset
for help on using the changeset viewer.