- Timestamp:
- Aug 27, 1999, 7:50:57 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibwin.cpp
r693 r715 1 /* $Id: oslibwin.cpp,v 1.2 4 1999-08-25 15:08:50dengert Exp $ */1 /* $Id: oslibwin.cpp,v 1.25 1999-08-27 17:50:56 dengert Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 64 64 dwFrameStyle |= FCF_TITLEBAR; 65 65 66 dwFrameStyle |= FCF_TASKLIST ;66 dwFrameStyle |= FCF_TASKLIST | FCF_NOMOVEWITHOWNER | FCF_NOBYTEALIGN; 67 67 *hwndFrame = WinCreateStdWindow(hwndParent, dwWinStyle, 68 68 &dwFrameStyle, WIN32_STDCLASS, … … 403 403 //****************************************************************************** 404 404 //****************************************************************************** 405 void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld, ULONG parentHeight)405 void OSLibMapSWPtoWINDOWPOS(PSWP pswp, PWINDOWPOS pwpos, PSWP pswpOld, HWND hParent, HWND hFrame) 406 406 { 407 407 HWND hWindow = pswp->hwnd; … … 412 412 long cy = pswp->cy; 413 413 UINT fuFlags = (UINT)pswp->fl; 414 ULONG parentHeight; 414 415 415 416 HWND hWinAfter; … … 457 458 if ( fuFlags & (SWP_MOVE | SWP_SIZE) ) 458 459 { 460 if (hParent == NULLHANDLE) 461 { 462 ULONG Offset; 463 POINTL pt = {0, 0}; 464 465 Offset = OSLibGetWindowHeight(hFrame) - cy; 466 parentHeight = ScreenHeight; 467 468 cx += 2 * x; 469 cy += Offset; 470 WinMapWindowPoints (hFrame, HWND_DESKTOP, &pt, 1); 471 x = pt.x; 472 y = pt.y; 473 474 pswpOld->cx += 2 * pswpOld->x; 475 pswpOld->cy += Offset; 476 pswpOld->x = pt.x; 477 pswpOld->y = pt.y; 478 } 479 else 480 { 481 parentHeight = OSLibGetWindowHeight(hParent); 482 } 483 459 484 if (fuFlags & SWP_SIZE) 460 485 { … … 485 510 // relative to top left of parent. 486 511 //******************************************************** 487 y = parentHeight - y - cy; 488 489 LONG oldY = parentHeight - pswpOld->y - pswpOld->cy; 512 y = parentHeight - y - cy; 513 LONG oldY = parentHeight - pswpOld->y - pswpOld->cy; 490 514 491 515 // Set the SWP_NOMOVE_W flag if the window has not moved in windows … … 498 522 flags |= SWP_NOSIZE_W; 499 523 } 524 525 if (hParent == NULLHANDLE) 526 { 527 pswpOld->x = x + pswp->x; 528 pswpOld->y = y + cy - pswp->y - pswp->cy; 529 } 530 else { 531 pswpOld->x = pswp->x; 532 pswpOld->y = parentHeight - pswp->y - cy; 533 } 534 pswpOld->cx = pswp->cx; 535 pswpOld->cy = pswp->cy; 536 537 dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)", 538 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy)); 500 539 501 540 // Fill in the WINDOWPOS structure with the now calculated PM values. … … 510 549 //****************************************************************************** 511 550 //****************************************************************************** 512 void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, ULONG parentHeight)551 void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame) 513 552 { 514 553 HWND hWnd = pwpos->hwnd; … … 519 558 long cy = pwpos->cy; 520 559 UINT fuFlags = pwpos->flags; 560 ULONG parentHeight; 521 561 522 562 HWND hWinAfter; … … 571 611 if ( flags & (SWP_MOVE | SWP_SIZE) ) 572 612 { 613 if (hParent == NULLHANDLE) 614 parentHeight = ScreenHeight; 615 else 616 parentHeight = OSLibGetWindowHeight(hParent); 617 573 618 //********************************************************** 574 619 // We'll need both a y and cy for the Y inversion code. … … 617 662 } 618 663 619 // Fill in the WINDOWPOSstructure with the now calculated PM values.664 // Fill in the SWP structure with the now calculated PM values. 620 665 pswp->fl = flags; 621 666 pswp->cy = cy; -
trunk/src/user32/new/oslibwin.h
r693 r715 1 /* $Id: oslibwin.h,v 1.2 1 1999-08-25 15:08:50dengert Exp $ */1 /* $Id: oslibwin.h,v 1.22 1999-08-27 17:50:56 dengert Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 234 234 235 235 BOOL OSLibWinQueryWindowPos (HWND hwnd, PSWP pswp); 236 void OSLibMapSWPtoWINDOWPOS(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, ULONG parentHeight);237 void OSLibMapWINDOWPOStoSWP(struct tagWINDOWPOS *pwpos, PSWP pswp, PSWP pswpOld, ULONG parentHeight);236 void OSLibMapSWPtoWINDOWPOS(PSWP pswp, struct tagWINDOWPOS *pwpos, PSWP pswpOld, HWND hParent, HWND hFrame); 237 void OSLibMapWINDOWPOStoSWP(struct tagWINDOWPOS *pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame); 238 238 239 239 #endif //__OSLIBWIN_H__ -
trunk/src/user32/new/pmwindow.cpp
r693 r715 1 /* $Id: pmwindow.cpp,v 1.2 1 1999-08-25 15:08:50dengert Exp $ */1 /* $Id: pmwindow.cpp,v 1.22 1999-08-27 17:50:56 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 179 179 WINDOWPOS wp; 180 180 ULONG parentHeight = 0; 181 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; 181 182 182 183 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 183 184 185 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break; 186 184 187 WinQueryWindowPos(hwnd, &swpOld); 185 188 186 189 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 187 parentHeight = (win32wnd->isChild()) ? 188 OSLibGetWindowHeight(win32wnd->getParent()->getOS2WindowHandle()) 189 : OSLibQueryScreenHeight(); 190 } 191 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, parentHeight); 190 if (win32wnd->isChild()) 191 hParent = win32wnd->getParent()->getOS2WindowHandle(); 192 else 193 hFrame = win32wnd->getOS2FrameWindowHandle(); 194 } 195 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame); 196 192 197 wp.hwnd = win32wnd->getWindowHandle(); 193 198 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) … … 202 207 case WM_WINDOWPOSCHANGED: 203 208 { 204 PSWP pswp = (PSWP)mp1; 209 PSWP pswp = (PSWP)mp1; 210 PSWP pswpo = pswp + 1; 205 211 WINDOWPOS wp; 206 212 ULONG parentHeight = 0; 213 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; 207 214 208 215 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 216 217 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break; 218 209 219 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 210 parentHeight = (win32wnd->isChild()) ? 211 OSLibGetWindowHeight(win32wnd->getParent()->getOS2WindowHandle()) 212 : OSLibQueryScreenHeight(); 213 } 214 OSLibMapSWPtoWINDOWPOS(pswp, &wp, pswp+1, parentHeight); 220 if (win32wnd->isChild()) 221 hParent = win32wnd->getParent()->getOS2WindowHandle(); 222 else 223 hFrame = win32wnd->getOS2FrameWindowHandle(); 224 } 225 OSLibMapSWPtoWINDOWPOS(pswp, &wp, pswpo, hParent, hFrame); 226 227 win32wnd->setWindowRect(wp.x, wp.y, wp.x + wp.cx, wp.y + wp.cy); 228 win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy); 229 215 230 wp.hwnd = win32wnd->getWindowHandle(); 216 231 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) -
trunk/src/user32/new/win32wnd.cpp
r693 r715 1 /* $Id: win32wnd.cpp,v 1.3 0 1999-08-25 15:08:50dengert Exp $ */1 /* $Id: win32wnd.cpp,v 1.31 1999-08-27 17:50:56 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 256 256 { 257 257 SetParent(cs->hwndParent); 258 owner = GetWindowFromHandle(cs->hwndParent); 259 if(owner == NULL) 260 { 261 dprintf(("HMHandleTranslateToOS2 couldn't find owner window %x!!!", cs->hwndParent)); 262 return FALSE; 263 } 258 264 } 259 265 else … … 367 373 OS2Hwnd = OSLibWinCreateWindow((getParent()) ? getParent()->getOS2WindowHandle() : OSLIB_HWND_DESKTOP, 368 374 dwOSWinStyle, dwOSFrameStyle, (char *)cs->lpszName, 369 (owner) ? owner->getOS2 FrameWindowHandle() : OSLIB_HWND_DESKTOP,375 (owner) ? owner->getOS2WindowHandle() : OSLIB_HWND_DESKTOP, 370 376 (hwndLinkAfter == HWND_BOTTOM) ? TRUE : FALSE, 371 377 &OS2HwndFrame); … … 1068 1074 1069 1075 if (!(wpos->flags & SWP_NOCLIENTMOVE)) 1070 SendMessageA(WM_MOVE, 0, MAKELONG( wpos->x, wpos->y));1076 SendMessageA(WM_MOVE, 0, MAKELONG(rectClient.left, rectClient.top)); 1071 1077 1072 1078 if (!(wpos->flags & SWP_NOCLIENTSIZE)) … … 1075 1081 else if (dwStyle & WS_MINIMIZE) wp = SIZE_MINIMIZED; 1076 1082 1077 SendMessageA(WM_SIZE, wp, MAKELONG(wpos->cx,wpos->cy)); 1083 SendMessageA(WM_SIZE, wp, MAKELONG(rectClient.right - rectClient.left, 1084 rectClient.bottom - rectClient.top)); 1078 1085 } 1079 1086 return 0; … … 1469 1476 BOOL rc = FALSE; 1470 1477 Win32Window *window; 1478 HWND hParent = 0; 1471 1479 1472 1480 dprintf (("SetWindowPos %x %x (%d,%d)(%d,%d) %x", Win32Hwnd, hwndInsertAfter, x, y, cx, cy, fuFlags)); … … 1484 1492 WINDOWPOS wpos; 1485 1493 SWP swp, swpOld; 1486 ULONG parentHeight;1487 1494 1488 1495 //**************************** … … 1501 1508 //********************************************** 1502 1509 if(~fuFlags & (SWP_NOMOVE | SWP_NOSIZE)) { 1503 OSLibWinQueryWindowPos(OS2Hwnd, &swpOld); 1504 parentHeight = isChild() ? 1505 OSLibGetWindowHeight(getParent()->getOS2WindowHandle()) 1506 : OSLibQueryScreenHeight(); 1510 if (isChild()) 1511 { 1512 hParent = getParent()->getOS2WindowHandle(); 1513 OSLibWinQueryWindowPos(OS2Hwnd, &swpOld); 1514 } else 1515 OSLibWinQueryWindowPos(OS2HwndFrame, &swpOld); 1507 1516 } 1508 OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, parentHeight);1517 OSLibMapWINDOWPOStoSWP(&wpos, &swp, &swpOld, hParent, OS2HwndFrame); 1509 1518 1510 1519 /* MapSWP can clear the SWP_MOVE and SWP_SIZE flags if the window is not -
trunk/src/user32/new/win32wnd.h
r693 r715 1 /* $Id: win32wnd.h,v 1.2 5 1999-08-25 15:08:51dengert Exp $ */1 /* $Id: win32wnd.h,v 1.26 1999-08-27 17:50:57 dengert Exp $ */ 2 2 /* 3 3 * Win32 Window Code for OS/2 … … 102 102 PRECT getClientRect() { return &rectClient; }; 103 103 PRECT getWindowRect() { return &rectWindow; }; 104 void setClientRect(LONG left, LONG top, LONG right, LONG bottom) 105 { rectClient.left = left; rectClient.top = top; 106 rectClient.right = right; rectClient.bottom = bottom; 107 }; 108 void setWindowRect(LONG left, LONG top, LONG right, LONG bottom) 109 { rectWindow.left = left; rectWindow.top = top; 110 rectWindow.right = right; rectWindow.bottom = bottom; 111 }; 112 void setWindowRect(PRECT rect) { rectWindow = *rect; }; 104 113 105 114 DWORD getFlags() { return flags; };
Note:
See TracChangeset
for help on using the changeset viewer.