Changeset 1387 for trunk/src/user32/window.cpp
- Timestamp:
- Oct 21, 1999, 12:35:54 AM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/window.cpp
r1351 r1387 1 /* $Id: window.cpp,v 1.2 1 1999-10-18 11:59:58sandervl Exp $ */1 /* $Id: window.cpp,v 1.22 1999-10-20 22:35:54 sandervl Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 318 318 return 0; 319 319 } 320 dprintf(("GetParent %x", hwnd));320 // dprintf(("GetParent %x", hwnd)); 321 321 return window->GetParent(); 322 322 } … … 715 715 HWND hwndWin32 = hwnd; 716 716 717 #if 1718 717 Win32BaseWindow *window; 719 718 … … 728 727 dprintf(("GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwndWin32, pRect->left, pRect->top, pRect->right, pRect->bottom)); 729 728 return TRUE; 730 #else731 hwnd = Win32BaseWindow::Win32ToOS2Handle(hwnd);732 rc = OSLibWinQueryWindowRect(hwnd, pRect);733 dprintf(("GetClientRect of %X returned (%d,%d) (%d,%d)\n", hwndWin32, pRect->left, pRect->top, pRect->right, pRect->bottom));734 return rc;735 #endif736 729 } 737 730 //****************************************************************************** … … 747 740 dprintf(("AdjustWindowRectEx %x %x %d (%d,%d)(%d,%d)\n", style, exStyle, menu, rect->right, rect->top, rect->left, rect->bottom)); 748 741 749 #if 0750 O32_AdjustWindowRectEx(rect, style, menu, exStyle);751 #else752 742 /* Correct the window style */ 753 743 if (!(style & (WS_POPUP | WS_CHILD))) /* Overlapped window */ … … 761 751 Win32BaseWindow::NC_AdjustRectOuter( rect, style, menu, exStyle ); 762 752 Win32BaseWindow::NC_AdjustRectInner( rect, style, exStyle ); 763 #endif764 753 765 754 dprintf(("AdjustWindowRectEx returned (%d,%d)(%d,%d)\n", rect->right, rect->top, rect->left, rect->bottom)); 766 755 return TRUE; 756 } 757 //****************************************************************************** 758 /* Coordinate Space and Transformation Functions */ 759 //****************************************************************************** 760 int WIN32API MapWindowPoints(HWND hwndFrom, HWND hwndTo, LPPOINT lpPoints, 761 UINT cPoints) 762 { 763 Win32BaseWindow *wndfrom, *wndto; 764 int retval = 0; 765 OSLIBPOINT point; 766 767 if(lpPoints == NULL || cPoints == 0) { 768 SetLastError(ERROR_INVALID_PARAMETER); 769 return 0; 770 } 771 if(hwndFrom) 772 { 773 wndfrom = Win32BaseWindow::GetWindowFromHandle(hwndFrom); 774 if(!wndfrom) { 775 dprintf(("MapWindowPoints, window %x not found", hwndFrom)); 776 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 777 return 0; 778 } 779 } 780 else wndfrom = windowDesktop; 781 782 if(hwndTo) 783 { 784 wndto = Win32BaseWindow::GetWindowFromHandle(hwndTo); 785 if(!wndto) { 786 dprintf(("MapWindowPoints, window %x not found", hwndTo)); 787 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 788 return 0; 789 } 790 } 791 else wndto = windowDesktop; 792 793 if(wndto == wndfrom) 794 return 0; //nothing to do 795 796 dprintf(("USER32: MapWindowPoints %x to %x (%d,%d) (%d)", hwndFrom, hwndTo, lpPoints->x, lpPoints->y, cPoints)); 797 point.x = lpPoints->x; 798 point.y = wndfrom->getWindowHeight() - lpPoints->y; 799 800 OSLibWinMapWindowPoints(wndfrom->getOS2WindowHandle(), wndto->getOS2WindowHandle(), &point, 1); 801 point.y = wndto->getWindowHeight() - point.y; 802 803 WORD xinc = point.x - lpPoints->x; 804 WORD yinc = point.y - lpPoints->y; 805 806 for(int i=1;i<cPoints;i++) 807 { 808 lpPoints[i].x += xinc; 809 lpPoints[i].y += yinc; 810 } 811 retval = ((DWORD)yinc << 16) | xinc; 812 return retval; 813 } 814 //****************************************************************************** 815 //****************************************************************************** 816 BOOL WIN32API ScreenToClient (HWND hwnd, LPPOINT pt) 817 { 818 Win32BaseWindow *wnd; 819 PRECT rcl; 820 821 dprintf(("ScreenToClient %x (%d,%d)\n", hwnd, pt->x, pt->y)); 822 823 if (!hwnd) return (TRUE); 824 wnd = Win32BaseWindow::GetWindowFromHandle (hwnd); 825 if (!wnd) return (TRUE); 826 827 rcl = wnd->getClientRect(); 828 pt->y = ScreenHeight - pt->y; 829 OSLibWinMapWindowPoints (OSLIB_HWND_DESKTOP, wnd->getOS2WindowHandle(), (OSLIBPOINT *)pt, 1); 830 pt->y = (rcl->bottom - rcl->top) - pt->y; 831 dprintf(("ScreenToClient %x returned (%d,%d)\n", hwnd, pt->x, pt->y)); 832 return (TRUE); 767 833 } 768 834 //****************************************************************************** … … 1280 1346 1281 1347 if(lpfn == NULL) { 1282 dprintf(("EnumChildWindows invalid parameter %x %x\n", hwnd, lParam)); 1348 dprintf(("EnumChildWindows invalid parameter %x %x\n", hwnd, lParam)); 1283 1349 SetLastError(ERROR_INVALID_PARAMETER); 1284 1350 return FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.