- Timestamp:
- Mar 30, 2001, 1:14:36 PM (24 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/Makefile
r4899 r5404 1 # $Id: Makefile,v 1.8 0 2001-01-09 18:14:01sandervl Exp $1 # $Id: Makefile,v 1.81 2001-03-30 11:14:35 sandervl Exp $ 2 2 3 3 # … … 18 18 # 19 19 !ifndef WAT 20 CDEFINES = $(CDEFINES) -DINVERT 20 CDEFINES = $(CDEFINES) -DINVERT -DODIN_HITTEST 21 21 !else 22 CDEFINES += -DINVERT 22 CDEFINES += -DINVERT -DODIN_HITTEST 23 23 !endif 24 24 -
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()) -
trunk/src/user32/pmwindow.cpp
r5258 r5404 1 /* $Id: pmwindow.cpp,v 1.12 0 2001-02-23 14:52:41sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.121 2001-03-30 11:14:35 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 105 105 (PSZ)WIN32_STDCLASS, /* Window class name */ 106 106 (PFNWP)Win32WindowProc, /* Address of window procedure */ 107 #ifdef ODIN_HITTEST 108 0, 109 #else 107 110 CS_HITTEST, 111 #endif 108 112 NROF_WIN32WNDBYTES)) 109 113 { … … 125 129 (PSZ)WIN32_STDFRAMECLASS, /* Window class name */ 126 130 (PFNWP)Win32FrameWindowProc, /* Address of window procedure */ 131 #ifdef ODIN_HITTEST 132 CS_FRAME, 133 #else 127 134 CS_HITTEST | CS_FRAME, 135 #endif 128 136 FrameClassInfo.cbWindowData+NROF_WIN32WNDBYTES)) 129 137 { … … 930 938 //Mouse messages (OS/2 Window coordinates -> Win32 coordinates relative to screen 931 939 //************************************************************************** 940 #ifndef ODIN_HITTEST 932 941 case WM_HITTEST: 933 942 { … … 944 953 return (MRESULT)HT_NORMAL; 945 954 } 955 #endif 946 956 947 957 case WM_BUTTON1DOWN: -
trunk/src/user32/static.cpp
r5373 r5404 1 /* $Id: static.cpp,v 1.2 2 2001-03-25 08:50:42sandervl Exp $ */1 /* $Id: static.cpp,v 1.23 2001-03-30 11:14:36 sandervl Exp $ */ 2 2 /* 3 3 * Static control … … 414 414 LRESULT lResult; 415 415 416 #ifndef ODIN_HITTEST 416 417 //SvL: If a static window has children, then we can't return HTTRANSPARENT 417 418 // here. For some reason PM then sends all mouse messages to the parent … … 423 424 return HTCLIENT; 424 425 } 426 #endif 425 427 426 428 if (dwStyle & SS_NOTIFY) … … 656 658 hdc, hwnd ); 657 659 if (!hBrush) hBrush = GetStockObject(WHITE_BRUSH); 658 FillRect( hdc, &rc, hBrush ); 660 FillRect( hdc, &rc, hBrush ); 659 661 } 660 662 #else -
trunk/src/user32/win32wbase.cpp
r5397 r5404 1 /* $Id: win32wbase.cpp,v 1.24 6 2001-03-29 17:39:19sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.247 2001-03-30 11:14:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 906 906 //****************************************************************************** 907 907 //****************************************************************************** 908 #ifndef ODIN_HITTEST 908 909 ULONG Win32BaseWindow::MsgHitTest(MSG *msg) 909 910 { … … 917 918 return HTOS_NORMAL; 918 919 } 920 #endif 919 921 //****************************************************************************** 920 922 //****************************************************************************** … … 1220 1222 //****************************************************************************** 1221 1223 //****************************************************************************** 1222 LONG Win32BaseWindow::sendHitTest(ULONG lParam)1223 {1224 lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, lParam);1225 return lastHitTestVal;1226 }1227 //******************************************************************************1228 //******************************************************************************1229 1224 BOOL Win32BaseWindow::isMDIClient() 1230 1225 { … … 1967 1962 break; 1968 1963 } 1964 case WM_NCHITTEST: 1965 rc = lastHitTestVal = win32wndproc(getWindowHandle(), WM_NCHITTEST, wParam, lParam); 1966 break; 1969 1967 1970 1968 case WM_DESTROY: … … 2023 2021 NotifyParent(Msg, wParam, lParam); 2024 2022 rc = win32wndproc(getWindowHandle(), Msg, wParam, lParam); 2023 break; 2024 2025 case WM_NCHITTEST: 2026 rc = lastHitTestVal = win32wndproc(getWindowHandle(), WM_NCHITTEST, wParam, lParam); 2025 2027 break; 2026 2028 -
trunk/src/user32/win32wbase.h
r5258 r5404 1 /* $Id: win32wbase.h,v 1.11 1 2001-02-23 14:52:42sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.112 2001-03-30 11:14:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 134 134 ULONG MsgPaint(ULONG tmp1, BOOL select = TRUE); 135 135 ULONG MsgEraseBackGround(HDC hdc); 136 #ifndef ODIN_HITTEST 136 137 ULONG MsgHitTest(MSG *msg); 138 #endif 137 139 ULONG MsgNCPaint(); 138 140 ULONG MsgFormatFrame(WINDOWPOS *lpWndPos); … … 161 163 162 164 LONG getLastHitTestVal() { return lastHitTestVal; } 163 LONG sendHitTest(ULONG lParam);164 165 165 166 DWORD getWindowContextHelpId() { return contextHelpId; }; -
trunk/src/user32/win32wbasenonclient.cpp
r5236 r5404 1 /* $Id: win32wbasenonclient.cpp,v 1. 29 2001-02-21 20:51:07sandervl Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.30 2001-03-30 11:14:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 450 450 if (dwStyle & WS_MINIMIZE) return HTCAPTION; 451 451 452 //TODO: is this correct??? 453 if (dwStyle & WS_DISABLED) return HTERROR; 454 452 455 GetWindowRect(getWindowHandle(), &rect); 453 456 -
trunk/src/user32/window.cpp
r5237 r5404 1 /* $Id: window.cpp,v 1. 89 2001-02-21 21:30:44sandervl Exp $ */1 /* $Id: window.cpp,v 1.90 2001-03-30 11:14:36 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 4 4 * 5 * Copyright 1999 Sander van Leeuwen5 * Copyright 1999-2001 Sander van Leeuwen (sandervl@xs4all.nl) 6 6 * Copyright 1999 Daniela Engert (dani@ngrt.de) 7 7 * Copyright 2000 Christoph Bratschi (cbratschi@datacomm.ch) … … 18 18 * TODO: ShowOwnedPopups needs to be tested 19 19 * GetLastActivePopup needs to be rewritten 20 * ArrangeIconicWindows probably also20 * ArrangeIconicWindows probably too 21 21 * 22 22 */ … … 700 700 dprintf(("SetFocus %x (%x) -> %x (%x)\n", lastFocus_W, lastFocus, hwnd, hwnd_O)); 701 701 702 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 702 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 703 703 //must delay this function call 704 704 if(teb->o.odin.fWM_SETFOCUS) { … … 724 724 return 0; 725 725 } 726 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 726 //PM doesn't allow SetFocus calls during WM_SETFOCUS message processing; 727 727 //If focus was changed during WM_SETFOCUS, the focus window handle is 728 728 //stored in teb->o.odin.hwndFocus (set back to 0 when delayed SetFocus … … 1493 1493 HWND WIN32API WindowFromPoint( POINT point) 1494 1494 { 1495 #if 01496 INT hittest = HTERROR;1497 HWND retvalue = 0;1498 HWND hwnd = GetDesktopWindow();1499 DWORD dwStyle;1500 RECT rectWindow, rectClient;1501 Win32BaseWindow *window;1502 1503 dprintf(("WindowFromPoint (%d,%d)", point.x, point.y));1504 1505 while(hwnd)1506 {1507 window = Win32BaseWindow::GetWindowFromHandle(hwnd);1508 1509 /* If point is in window, and window is visible, and it */1510 /* is enabled (or it's a top-level window), then explore */1511 /* its children. Otherwise, go to the next window. */1512 dwStyle = GetWindowLongA(hwnd, GWL_STYLE);1513 1514 if ((dwStyle & WS_VISIBLE) && (!(dwStyle & WS_DISABLED) ||1515 ((dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)))1516 {1517 GetWindowRect(hwnd, &rectWindow);1518 if(PtInRect(&rectWindow, point) == TRUE)1519 {1520 /* If window is minimized or disabled, return at once */1521 if(dwStyle & WS_MINIMIZE)1522 {1523 break;1524 }1525 if(dwStyle & WS_DISABLED)1526 {1527 break;1528 }1529 retvalue = hwnd;1530 1531 GetClientRect(hwnd, &rectClient);1532 InflateRect(&rectClient, rectWindow.left, rectWindow.top);1533 1534 /* If point is not in client area, ignore the children */1535 if(PtInRect(&rectClient, point) == FALSE) {1536 break;1537 }1538 if(window->getFirstChild()) {1539 hwnd = ((Win32BaseWindow *)window->getFirstChild())->getWindowHandle();1540 }1541 else break;1542 }1543 else1544 {1545 if(window->getNextChild()) {1546 hwnd = ((Win32BaseWindow *)window->getNextChild())->getWindowHandle();1547 }1548 else hwnd = 0;1549 }1550 }1551 else1552 {1553 if(window->getNextChild()) {1554 hwnd = ((Win32BaseWindow *)window->getNextChild())->getWindowHandle();1555 }1556 else hwnd = 0;1557 }1558 }1559 1560 dprintf(("WindowFromPoint (%d,%d) -> %x", point.x, point.y, hwnd));1561 return retvalue;1562 #else1563 1495 HWND hwndOS2, hwnd; 1564 1496 POINT wPoint; 1497 DWORD hittest, dwStyle, dwExStyle; 1565 1498 1566 1499 wPoint.x = point.x; … … 1570 1503 if(hwndOS2) 1571 1504 { 1572 hwnd = OS2ToWin32Handle(hwndOS2); 1573 if(hwnd) { 1574 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd)); 1575 return hwnd; 1576 } 1505 hwnd = OS2ToWin32Handle(hwndOS2); 1506 while(hwnd) 1507 { 1508 dwStyle = GetWindowLongA(hwnd, GWL_STYLE); 1509 dwExStyle = GetWindowLongA(hwnd, GWL_EXSTYLE); 1510 1511 /* If point is in window, and window is visible, and it */ 1512 /* is enabled (or it's a top-level window), then explore */ 1513 /* its children. Otherwise, go to the next window. */ 1514 1515 if( (dwStyle & WS_VISIBLE) && 1516 ((dwExStyle & (WS_EX_LAYERED | WS_EX_TRANSPARENT)) != (WS_EX_LAYERED | WS_EX_TRANSPARENT)) && 1517 (!(dwStyle & WS_DISABLED) || ((dwStyle & (WS_POPUP | WS_CHILD)) != WS_CHILD)) 1518 #if 1 1519 ) 1520 #else 1521 && 1522 (wndPtr->hrgnWnd ? PtInRegion(wndPtr->hrgnWnd, 1)) 1523 #endif 1524 { 1525 hittest = SendMessageA(hwnd, WM_NCHITTEST, 0, MAKELONG(point.x, point.y)); 1526 if(hittest != HTTRANSPARENT) { 1527 dprintf(("WindowFromPoint (%d,%d) %x->%x\n", point.x, point.y, hwndOS2, hwnd)); 1528 return hwnd; 1529 } 1530 } 1531 //TODO: Not correct for overlapping sibling windows! 1532 hwnd = GetParent(hwnd); 1533 } 1577 1534 } 1578 1535 dprintf(("WindowFromPoint (%d,%d) %x->1\n", point.x, point.y, hwndOS2)); 1579 1536 return windowDesktop->getWindowHandle(); 1580 #endif1581 1537 } 1582 1538 //******************************************************************************
Note:
See TracChangeset
for help on using the changeset viewer.