Changeset 5404 for trunk/src/user32/oslibmsgtranslate.cpp
- Timestamp:
- Mar 30, 2001, 1:14:36 PM (24 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibmsgtranslate.cpp
r5382 r5404 1 /* $Id: oslibmsgtranslate.cpp,v 1.4 2 2001-03-25 22:41:50sandervl Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.43 2001-03-30 11:14:35 sandervl Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 22 22 #include <misc.h> 23 23 #include <winconst.h> 24 #include <win32api.h> 24 25 #include "oslibmsg.h" 25 26 #include <winuser32.h> … … 360 361 //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen 361 362 //************************************************************************** 363 #ifndef ODIN_HITTEST 362 364 case WM_HITTEST: 363 365 winMsg->message = WINWM_NCHITTEST; … … 371 373 } 372 374 break; 375 #endif 373 376 374 377 case WM_BUTTON1DOWN: … … 381 384 case WM_BUTTON3UP: 382 385 case WM_BUTTON3DBLCLK: 386 { 383 387 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 384 388 385 389 #ifdef ODIN_HITTEST 386 //Send WM_HITTEST message 387 win32wnd->sendHitTest(MAKELONG(winMsg->pt.x,winMsg->pt.y)); 390 HWND hwnd; 391 392 hwnd = WindowFromPoint(winMsg->pt); 393 if(win32wnd->getWindowHandle() != hwnd) { 394 win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 395 if(win32wnd == NULL) { 396 DebugInt3(); 397 goto dummymessage; 398 } 399 } 388 400 #endif 389 win32wnd->sendHitTest(MAKELONG(winMsg->pt.x,winMsg->pt.y));390 401 391 402 //if a window is disabled, it's parent receives the mouse messages 392 403 if(!win32wnd->IsWindowEnabled()) { 393 394 395 396 404 if(win32wnd->getParent()) { 405 win32wnd = win32wnd->getParent(); 406 } 407 fWasDisabled = TRUE; 397 408 } 398 409 … … 403 414 } 404 415 else { 416 #ifdef ODIN_HITTEST 417 ClientPoint.x = winMsg->pt.x; 418 ClientPoint.y = winMsg->pt.y; 419 MapWindowPoints(0, win32wnd->getWindowHandle(), (LPPOINT)&ClientPoint, 1); 420 #else 405 421 point.x = (*(POINTS *)&os2Msg->mp1).x; 406 422 point.y = (*(POINTS *)&os2Msg->mp1).y; 407 423 ClientPoint.x = mapOS2ToWin32X(win32wnd, point.x); 408 424 ClientPoint.y = mapOS2ToWin32Y(win32wnd, point.y); 409 425 #endif 410 426 winMsg->message = WINWM_LBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 411 427 winMsg->wParam = GetMouseKeyState(); … … 420 436 421 437 if(fWasDisabled) { 422 if(win32wnd) { 423 winMsg->hwnd = win32wnd->getWindowHandle(); 424 } 425 else goto dummymessage; //don't send mouse messages to disabled windows 426 } 427 break; 438 if(win32wnd) { 439 winMsg->hwnd = win32wnd->getWindowHandle(); 440 } 441 else goto dummymessage; //don't send mouse messages to disabled windows 442 } 443 break; 444 } 428 445 429 446 case WM_BUTTON2CLICK: … … 447 464 448 465 #ifdef ODIN_HITTEST 449 //Send WM_HITTEST message 450 win32wnd->sendHitTest(MAKELONG(winMsg->pt.x,winMsg->pt.y)); 466 HWND hwnd; 467 468 hwnd = WindowFromPoint(winMsg->pt); 469 if(win32wnd->getWindowHandle() != hwnd) { 470 win32wnd = Win32BaseWindow::GetWindowFromHandle(hwnd); 471 if(win32wnd == NULL) { 472 DebugInt3(); 473 goto dummymessage; 474 } 475 } 451 476 #endif 452 477 453 478 //if a window is disabled, it's parent receives the mouse messages 454 479 if(!win32wnd->IsWindowEnabled()) { 455 456 457 458 480 if(win32wnd->getParent()) { 481 win32wnd = win32wnd->getParent(); 482 } 483 fWasDisabled = TRUE; 459 484 } 460 485 if(IsNCMouseMsg(win32wnd)) 461 486 { 462 winMsg->message = WINWM_NCMOUSEMOVE;463 winMsg->wParam = (WPARAM)win32wnd->getLastHitTestVal();464 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y);487 winMsg->message = WINWM_NCMOUSEMOVE; 488 winMsg->wParam = (WPARAM)win32wnd->getLastHitTestVal(); 489 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 465 490 } 466 491 else 467 492 { 468 point.x = (*(POINTS *)&os2Msg->mp1).x; 469 point.y = (*(POINTS *)&os2Msg->mp1).y; 470 ClientPoint.x = mapOS2ToWin32X(win32wnd, point.x); 471 ClientPoint.y = mapOS2ToWin32Y(win32wnd, point.y); 472 473 winMsg->message = WINWM_MOUSEMOVE; 474 winMsg->wParam = GetMouseKeyState(); 475 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 493 #ifdef ODIN_HITTEST 494 ClientPoint.x = winMsg->pt.x; 495 ClientPoint.y = winMsg->pt.y; 496 MapWindowPoints(0, win32wnd->getWindowHandle(), (LPPOINT)&ClientPoint, 1); 497 #else 498 point.x = (*(POINTS *)&os2Msg->mp1).x; 499 point.y = (*(POINTS *)&os2Msg->mp1).y; 500 ClientPoint.x = mapOS2ToWin32X(win32wnd, point.x); 501 ClientPoint.y = mapOS2ToWin32Y(win32wnd, point.y); 502 #endif 503 504 winMsg->message = WINWM_MOUSEMOVE; 505 winMsg->wParam = GetMouseKeyState(); 506 winMsg->lParam = MAKELONG(ClientPoint.x, ClientPoint.y); //client coordinates 476 507 } 477 508 if((fMsgRemoved == MSG_REMOVE) && ISMOUSE_CAPTURED())
Note:
See TracChangeset
for help on using the changeset viewer.