- Timestamp:
- Jan 26, 2000, 7:02:38 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibwin.cpp
r2489 r2521 1 /* $Id: oslibwin.cpp,v 1.6 3 2000-01-21 13:30:34 sandervlExp $ */1 /* $Id: oslibwin.cpp,v 1.64 2000-01-26 18:02:34 cbratschi Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 93 93 94 94 if (*hwndFrame) { 95 hwndClient = WinCreateWindow (*hwndFrame,saveBits ? WIN32_STDCLASS :WIN32_STDCLASS2,95 hwndClient = WinCreateWindow (*hwndFrame,saveBits ? WIN32_STDCLASS2:WIN32_STDCLASS, 96 96 NULL, dwClientStyle, 0, 0, 0, 0, 97 97 *hwndFrame, HWND_TOP, FID_CLIENT, NULL, NULL); … … 525 525 point.x = swpFrame.x; 526 526 point.y = swpFrame.y; 527 if(hParent) 527 528 if (hParent) 528 529 { 529 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1); 530 RECTL parentRect; 531 532 WinQueryWindowRect(hParent,&parentRect); 533 parentHeight = parentRect.yTop; 534 } else 535 { 536 parentHeight = ScreenHeight; 530 537 } 531 point.y = ScreenHeight-point.y-swpFrame.cy; 538 539 point.y = parentHeight-point.y-swpFrame.cy; 532 540 533 541 cy = swpFrame.cy; … … 610 618 if(fuFlags & (SWP_MOVE | SWP_SIZE)) 611 619 { 620 if (hParent) 621 { 622 RECTL parentRect; 623 624 WinQueryWindowRect(hParent,&parentRect); 625 parentHeight = parentRect.yTop; 626 } else 627 { 628 parentHeight = ScreenHeight; 629 } 630 612 631 point.x = x; 613 point.y = y; 614 615 if(hParent) 616 { 617 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1); 618 } 619 point.y = ScreenHeight-point.y-cy; 632 point.y = parentHeight-y-cy; 620 633 621 634 x = point.x; … … 706 719 y = pswpOld->y; 707 720 708 if (!((y == 0) && (pswpOld->cy == 0))) 709 { 710 y = parentHeight-y-pswpOld->cy; 711 } 721 y = parentHeight-y-pswpOld->cy; 712 722 } 713 723 … … 724 734 y = parentHeight-y-cy; 725 735 726 727 if ((pswpOld->x == x) && (pswpOld->y == y)) 736 if ((pswpOld->x == x) && (pswpOld->y == y)) 728 737 flags &= ~SWP_MOVE; 729 738 … … 757 766 UINT fuFlags = pwpos->flags; 758 767 ULONG parentHeight; 759 POINTL point;760 768 761 769 HWND hWinAfter; … … 787 795 if (flags & (SWP_MOVE | SWP_SIZE)) 788 796 { 789 point.x = x;790 point.y = y;791 792 if(hParent) { 793 parentHeight = OSLibGetWindowHeight(hParent);794 795 point.y = ScreenHeight-point.y-cy;796 WinMapWindowPoints(HWND_DESKTOP, hParent, &point, 1);797 point.y = parentHeight-point.y-cy;797 if (hParent) 798 { 799 RECTL parentRect; 800 801 WinQueryWindowRect(hParent,&parentRect); 802 parentHeight = parentRect.yTop; 803 } else 804 { 805 parentHeight = ScreenHeight; 798 806 } 799 else parentHeight = ScreenHeight;800 801 x = point.x;802 y = point.y;803 807 804 808 if (flags & SWP_SIZE) … … 814 818 y = parentHeight-y-cy; 815 819 816 817 if ((pswpOld->x == x) && (pswpOld->y == y)) 820 if ((pswpOld->x == x) && (pswpOld->y == y)) 818 821 flags &= ~SWP_MOVE; 819 822 -
trunk/src/user32/pmframe.cpp
r2483 r2521 1 /* $Id: pmframe.cpp,v 1.3 8 2000-01-20 16:48:55 cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.39 2000-01-26 18:02:35 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 141 141 case WM_QUERYTRACKINFO: 142 142 { 143 //CB: todo: use minmaxinfo 144 goto RunDefFrameProc; 143 PTRACKINFO trackInfo = (PTRACKINFO)mp2; 144 145 RestoreOS2TIB(); 146 OldFrameProc(hwnd,msg,mp1,mp2); 147 SetWin32TIB(); 148 trackInfo->cxBorder = 0; 149 trackInfo->cyBorder = 0; 150 win32wnd->AdjustTrackInfo((PPOINT)&trackInfo->ptlMinTrackSize,(PPOINT)&trackInfo->ptlMaxTrackSize); 151 RestoreOS2TIB(); 152 return (MRESULT)TRUE; 145 153 } 146 154 … … 212 220 PSWP pswp = (PSWP)mp1; 213 221 SWP swpOld; 214 WINDOWPOS wp ;222 WINDOWPOS wp,wpOld; 215 223 HWND hParent = NULLHANDLE, hwndAfter; 216 224 … … 254 262 } 255 263 256 //CB: problems with profmine titlebar tracking 257 if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0) 258 {//app or default window handler changed wp 259 dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS, app changed windowpos struct")); 260 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 261 262 OSLibMapWINDOWPOStoSWPFrame(&wp, pswp, &swpOld, hParent, hwnd); 263 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 264 pswp->fl |= SWP_NOADJUST; 265 pswp->hwndInsertBehind = hwndAfter; 266 pswp->hwnd = hwnd; 267 268 RestoreOS2TIB(); 269 return (MRESULT)0xf; 264 wpOld = wp; 265 win32wnd->MsgPosChanging((LPARAM)&wp); 266 267 if ((wp.hwndInsertAfter != wpOld.hwndInsertAfter) || 268 (wp.x != wpOld.x) || (wp.y != wpOld.y) || (wp.cx != wpOld.cx) || (wp.cy != wpOld.cy) || (wp.flags != wpOld.flags)) 269 { 270 dprintf(("PMFRAME: WM_ADJUSTWINDOWPOS, app changed windowpos struct")); 271 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 272 273 OSLibMapWINDOWPOStoSWPFrame(&wp, pswp, &swpOld, hParent, hwnd); 274 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 275 pswp->fl |= SWP_NOADJUST; 276 pswp->hwndInsertBehind = hwndAfter; 277 pswp->hwnd = hwnd; 278 279 RestoreOS2TIB(); 280 return (MRESULT)0xf; 270 281 } 271 282 goto RunDefFrameProc; -
trunk/src/user32/user32.cpp
r2469 r2521 1 /* $Id: user32.cpp,v 1.6 6 2000-01-18 20:10:47 sandervlExp $ */1 /* $Id: user32.cpp,v 1.67 2000-01-26 18:02:35 cbratschi Exp $ */ 2 2 3 3 /* … … 785 785 case SM_CYMINIMIZED: 786 786 break; 787 788 case SM_CXMINTRACK: 789 case SM_CXMIN: 790 rc = 112; 791 break; 792 793 case SM_CYMINTRACK: 794 case SM_CYMIN: 795 rc = 27; 796 break; 797 787 798 case SM_CXMAXTRACK: //max window size 788 799 case SM_CXMAXIMIZED: //max toplevel window size 789 800 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CXSCREEN); 790 801 break; 802 791 803 case SM_CYMAXTRACK: 792 804 case SM_CYMAXIMIZED: 793 805 rc = OSLibWinQuerySysValue(OSLIB_HWND_DESKTOP,SVOS_CYSCREEN); 794 806 break; 807 795 808 case SM_NETWORK: 796 809 rc = 0x01; //TODO: default = yes -
trunk/src/user32/win32wbase.cpp
r2489 r2521 1 /* $Id: win32wbase.cpp,v 1.14 4 2000-01-21 13:30:35 sandervlExp $ */1 /* $Id: win32wbase.cpp,v 1.145 2000-01-26 18:02:36 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 462 462 if (maxSize.x < cs->cx) cs->cx = maxSize.x; 463 463 if (maxSize.y < cs->cy) cs->cy = maxSize.y; 464 if (cs->cx < minTrack.x 465 if (cs->cy < minTrack.y 464 if (cs->cx < minTrack.x) cs->cx = minTrack.x; 465 if (cs->cy < minTrack.y) cs->cy = minTrack.y; 466 466 } 467 467 … … 653 653 MAKELONG(rectClient.right-rectClient.left, 654 654 rectClient.bottom-rectClient.top)); 655 DWORD lParam; 656 657 if(getParent()) {//in parent coordinates 658 POINT point; 659 660 point.x = rectClient.left; 661 point.y = rectClient.top; 662 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 663 664 lParam = MAKELONG(point.x, point.y); 665 } 666 else {//in screen coordinates 667 lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top); 668 } 669 SendInternalMessageA(WM_MOVE, 0, lParam); 655 SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top)); 670 656 } 671 657 … … 779 765 // a WM_WINDOWPOSCHANGED msg -> crash) 780 766 if(fNoSizeMsg || fDestroyWindowCalled) 781 return 1;767 return 0; 782 768 783 769 return SendInternalMessageA(WM_WINDOWPOSCHANGING, 0, lp); … … 1051 1037 ULONG rc; 1052 1038 1053 if(lpWndPos) { 1039 if(lpWndPos) 1040 { 1041 POINT point; 1042 1054 1043 //set new window rectangle 1055 setWindowRect(lpWndPos->x, lpWndPos->y, lpWndPos->x + lpWndPos->cx, lpWndPos->y + lpWndPos->cy); 1056 newWindowRect= rectWindow; 1044 point.x = lpWndPos->x; 1045 point.y = lpWndPos->y; 1046 if (getParent()) ClientToScreen(getParent()->getWindowHandle(),&point); 1047 setWindowRect(point.x,point.y,point.x+lpWndPos->cx,point.y+lpWndPos->cy); 1048 newWindowRect = rectWindow; 1057 1049 } 1058 1050 else { … … 1410 1402 if (!(wpos->flags & SWP_NOMOVE) && !(wpos->flags & SWP_NOCLIENTMOVE)) 1411 1403 { 1412 DWORD lParam; 1413 1414 if(getParent()) {//in parent coordinates 1415 POINT point; 1416 1417 point.x = rectClient.left; 1418 point.y = rectClient.top; 1419 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1); 1420 1421 lParam = MAKELONG(point.x, point.y); 1422 } 1423 else {//in screen coordinates 1424 lParam = MAKELONG(rectWindow.left+rectClient.left, rectWindow.top+rectClient.top); 1425 } 1426 SendInternalMessageA(WM_MOVE, 0, lParam); 1404 SendInternalMessageA(WM_MOVE,0,MAKELONG(rectClient.left,rectClient.top)); 1427 1405 } 1428 1406 if (!(wpos->flags & SWP_NOSIZE) && !(wpos->flags & SWP_NOCLIENTSIZE)) … … 2063 2041 2064 2042 #if 0 //CB: test: MSIE 2.0 displays the tool-/addressbar this way -> to check 2043 //CB: -> comctl32: toolbar (WM_SIZE), same bug: statusbar height 2065 2044 //CB: cx or cy are 0 2066 if (cx == 0) cx = 50; 2067 if (cy == 0) cy = 50; 2045 2046 if (cx == 0) 2047 { 2048 dprintf(("CB: cx is 0! %d",fuFlags)); 2049 if (fuFlags & SWP_NOSIZE) dprintf(("CB: nosize")); 2050 //cx = 50; 2051 } 2052 if (cy == 0) 2053 { 2054 dprintf(("CB: cy is 0! %d",fuFlags)); 2055 if (fuFlags & SWP_NOSIZE) dprintf(("CB: nosize")); 2056 //cy = 50; 2057 } 2058 2068 2059 #endif 2069 2060 … … 2110 2101 } 2111 2102 } 2112 //CB: todo 2113 #if 0 2114 if (isFrameWindow()) 2115 { 2116 if (!isChild()) 2117 { 2118 POINT maxSize, maxPos, minTrack, maxTrack; 2119 2120 GetMinMaxInfo(&maxSize, &maxPos, &minTrack, &maxTrack); 2121 2122 if (swp.cx > maxTrack.x) swp.cx = maxTrack.x; 2123 if (swp.cy > maxTrack.y) swp.cy = maxTrack.y; 2124 if (swp.cx < minTrack.x) swp.cx = minTrack.x; 2125 if (swp.cy < minTrack.y) swp.cy = minTrack.y; 2126 } 2127 swp.hwnd = OS2HwndFrame; 2128 } 2129 else 2130 #endif 2131 swp.hwnd = OS2HwndFrame; 2103 swp.hwnd = OS2HwndFrame; 2132 2104 2133 2105 dprintf (("WinSetWindowPos %x %x (%d,%d)(%d,%d) %x", swp.hwnd, swp.hwndInsertBehind, swp.x, swp.y, swp.cx, swp.cy, swp.fl)); -
trunk/src/user32/win32wbase.h
r2489 r2521 1 /* $Id: win32wbase.h,v 1.7 3 2000-01-21 13:30:35 sandervlExp $ */1 /* $Id: win32wbase.h,v 1.74 2000-01-26 18:02:37 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 429 429 430 430 VOID AdjustMaximizedRect(LPRECT rect); 431 VOID AdjustTrackInfo(PPOINT minTrackSize,PPOINT maxTrackSize); 431 432 432 433 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & CS_OWNDC_W); } -
trunk/src/user32/win32wbasenonclient.cpp
r2483 r2521 1 /* $Id: win32wbasenonclient.cpp,v 1. 4 2000-01-20 16:48:57 cbratschi Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.5 2000-01-26 18:02:37 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 334 334 //****************************************************************************** 335 335 //****************************************************************************** 336 VOID Win32BaseWindow::AdjustTrackInfo(PPOINT minTrackSize,PPOINT maxTrackSize) 337 { 338 if ((dwStyle & WS_THICKFRAME) || !(dwStyle & (WS_POPUP | WS_CHILD))) 339 GetMinMaxInfo(NULL,NULL,minTrackSize,maxTrackSize); 340 } 341 //****************************************************************************** 342 //****************************************************************************** 336 343 VOID Win32BaseWindow::AdjustRectOuter(LPRECT rect,BOOL menu) 337 344 { -
trunk/src/user32/win32wbasepos.cpp
r2469 r2521 1 /* $Id: win32wbasepos.cpp,v 1.1 0 2000-01-18 20:10:57 sandervlExp $ */1 /* $Id: win32wbasepos.cpp,v 1.11 2000-01-26 18:02:38 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 156 156 } 157 157 /*********************************************************************** 158 * WINPOS_HandleWindowPosChanging 16158 * WINPOS_HandleWindowPosChanging 159 159 * 160 160 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc(). … … 162 162 LONG Win32BaseWindow::HandleWindowPosChanging(WINDOWPOS *winpos) 163 163 { 164 POINT maxSize, minTrack;165 int rc = 1;164 POINT maxSize; 165 if (winpos->flags & SWP_NOSIZE) return 0; 166 166 167 if (winpos->flags & SWP_NOSIZE) 168 return 1; 169 170 if ((getStyle() & WS_THICKFRAME) || 171 ((getStyle() & (WS_POPUP | WS_CHILD)) == 0)) 167 if ((dwStyle & WS_THICKFRAME) || 168 ((dwStyle & (WS_POPUP | WS_CHILD)) == 0)) 172 169 { 173 GetMinMaxInfo(&maxSize, NULL, &minTrack, NULL ); 174 if (maxSize.x < winpos->cx) { 175 winpos->cx = maxSize.x; 176 rc = 0; 177 } 178 if (maxSize.y < winpos->cy) { 179 winpos->cy = maxSize.y; 180 rc = 0; 181 } 182 if (!(getStyle() & WS_MINIMIZE)) 183 { 184 if (winpos->cx < minTrack.x ) { 185 winpos->cx = minTrack.x; 186 rc = 0; 187 } 188 if (winpos->cy < minTrack.y ) { 189 winpos->cy = minTrack.y; 190 rc = 0; 191 } 192 } 170 GetMinMaxInfo( &maxSize, NULL, NULL, NULL ); 171 winpos->cx = MIN( winpos->cx, maxSize.x ); 172 winpos->cy = MIN( winpos->cy, maxSize.y ); 193 173 } 194 return rc;174 return 0; 195 175 } 196 176 //****************************************************************************** -
trunk/src/user32/window.cpp
r2483 r2521 1 /* $Id: window.cpp,v 1.5 0 2000-01-20 16:48:58 cbratschi Exp $ */1 /* $Id: window.cpp,v 1.51 2000-01-26 18:02:38 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 window apis for OS/2 … … 400 400 dprintf(("IsIconic, window %x not found", hwnd)); 401 401 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 402 return 0;402 return FALSE; 403 403 } 404 404 rc = window->IsIconic(); … … 493 493 Win32BaseWindow *window; 494 494 495 if (!hwnd) 496 { 497 dprintf(("SetWindowPos: Can't move desktop!")); 498 return TRUE; 499 } 495 500 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 496 501 if(!window) { 497 502 dprintf(("SetWindowPos, window %x not found", hwnd)); 498 503 SetLastError(ERROR_INVALID_WINDOW_HANDLE); 499 return 0;504 return FALSE; 500 505 } 501 506 dprintf(("SetWindowPos %x %x x=%d y=%d cx=%d cy=%d %x", hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags)); … … 560 565 BOOL rc; 561 566 562 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 567 if (hwnd) 568 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 569 else 570 window = windowDesktop; 563 571 if(!window) { 564 572 dprintf(("IsWindowVisible, window %x not found", hwnd)); … … 641 649 Win32BaseWindow *window; 642 650 643 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 651 if (hwnd) 652 window = Win32BaseWindow::GetWindowFromHandle(hwnd); 653 else 654 window = windowDesktop; 644 655 if(!window) { 645 656 dprintf(("GetWindowRect, window %x not found", hwnd));
Note:
See TracChangeset
for help on using the changeset viewer.