Changeset 1000 for trunk/src/user32/oslibwin.cpp
- Timestamp:
- Sep 21, 1999, 7:05:36 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/oslibwin.cpp
r963 r1000 1 /* $Id: oslibwin.cpp,v 1. 2 1999-09-17 18:49:53dengert Exp $ */1 /* $Id: oslibwin.cpp,v 1.3 1999-09-21 17:04:26 dengert Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 157 157 //****************************************************************************** 158 158 //****************************************************************************** 159 ULONG OSLibSendMessage(HWND hwnd, ULONG msg, ULONG wParam, ULONG lParam) 160 { 161 return (ULONG)WinSendMsg(hwnd, msg, (MPARAM)wParam, (MPARAM)lParam); 162 } 163 //****************************************************************************** 164 //****************************************************************************** 159 165 //****************************************************************************** 160 166 //****************************************************************************** … … 423 429 ULONG flags = 0; 424 430 425 //***************************************************426 // Map constant HWNDs (e.g. HWND_DESKTOP, HWND_TOP)427 //***************************************************428 431 HWND hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow; 429 432 430 if ( hWndInsertAfter == HWND_TOP)433 if (hWndInsertAfter == HWND_TOP) 431 434 hWinAfter = HWND_TOP_W; 432 else if ( hWndInsertAfter == HWND_BOTTOM)435 else if (hWndInsertAfter == HWND_BOTTOM) 433 436 hWinAfter = HWND_BOTTOM_W; 434 437 else … … 446 449 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W; 447 450 448 //************************************************************************** 449 // When moving or sizing we'll have to do some calculations for Y inversion. 450 // 451 // If moving - invert Y coord. 452 // 453 // If sizing - if the height is changing, have to move the window to 454 // maintain correct windows position. If we just size then the 455 // TR corner will extend. The Windows behaviour should be to 456 // extend the BR corner. 457 // 458 // If this is a child window then we'll have to move within the client 459 // area of the parent. 460 // 461 // If this is an overlapped or popup window we'll have to move around 462 // within the desktop. 463 //************************************************************************** 464 if ( fuFlags & (SWP_MOVE | SWP_SIZE) ) 451 if (fuFlags & (SWP_MOVE | SWP_SIZE)) 465 452 { 466 453 if (hParent == NULLHANDLE) … … 490 477 if (fuFlags & SWP_SIZE) 491 478 { 492 // If height is changing we MUST move to maintain top-left alignment493 479 if (cy != pswpOld->cy) 494 480 { … … 502 488 } 503 489 504 //**********************************************************505 // We'll need both a y and cy for the Y inversion code.506 // If either wasn't passed in, calculate the current value.507 //**********************************************************508 490 if ((fuFlags & SWP_MOVE) == 0) 509 491 { … … 512 494 } 513 495 514 //******************************************************** 515 // Y inversion here... old Y is top left corner of window 516 // relative to top left of parent. 517 //******************************************************** 518 y = parentHeight - y - cy; 519 LONG oldY = parentHeight - pswpOld->y - pswpOld->cy; 520 521 // Set the SWP_NOMOVE_W flag if the window has not moved in windows 522 // coordinates. 523 if ( ( pswpOld->x == x ) && ( oldY == y ) ) 496 y = parentHeight - y - cy; 497 LONG oldY = parentHeight - pswpOld->y - pswpOld->cy; 498 499 if ((pswpOld->x == x) && (oldY == y)) 524 500 flags |= SWP_NOMOVE_W; 525 501 526 // Set the SWP_NOSIZE_W flag if the window is not really being sized. 527 if ( ( pswpOld->cx == cx ) && ( pswpOld->cy == cy ) ) 502 if ((pswpOld->cx == cx) && (pswpOld->cy == cy)) 528 503 flags |= SWP_NOSIZE_W; 529 504 } … … 544 519 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy)); 545 520 546 // Fill in the WINDOWPOS structure with the now calculated PM values.547 521 pwpos->flags = (UINT)flags; 548 522 pwpos->cy = (int)cy; … … 557 531 void OSLibMapWINDOWPOStoSWP(PWINDOWPOS pwpos, PSWP pswp, PSWP pswpOld, HWND hParent, HWND hFrame) 558 532 { 559 HWND hWnd 560 HWND hWndInsertAfter 561 long x 562 long y 563 long cx 564 long cy 565 UINT fuFlags 533 HWND hWnd = pwpos->hwnd; 534 HWND hWndInsertAfter = pwpos->hwndInsertAfter; 535 long x = pwpos->x; 536 long y = pwpos->y; 537 long cx = pwpos->cx; 538 long cy = pwpos->cy; 539 UINT fuFlags = pwpos->flags; 566 540 ULONG parentHeight; 567 541 568 542 HWND hWinAfter; 569 543 ULONG flags = 0; 570 571 //***************************************************572 // Map constant HWNDs (e.g. HWND_DESKTOP, HWND_TOP)573 //***************************************************574 544 HWND hWindow = hWnd ? (HWND)hWnd : HWND_DESKTOP; 575 545 576 if ( hWndInsertAfter == HWND_TOPMOST_W)546 if (hWndInsertAfter == HWND_TOPMOST_W) 577 547 // hWinAfter = HWND_TOPMOST; 578 548 hWinAfter = HWND_TOP; 579 else if ( hWndInsertAfter == HWND_NOTOPMOST_W)549 else if (hWndInsertAfter == HWND_NOTOPMOST_W) 580 550 // hWinAfter = HWND_NOTOPMOST; 581 551 hWinAfter = HWND_TOP; 582 else if ( hWndInsertAfter == HWND_TOP_W)552 else if (hWndInsertAfter == HWND_TOP_W) 583 553 hWinAfter = HWND_TOP; 584 else if ( hWndInsertAfter == HWND_BOTTOM_W)554 else if (hWndInsertAfter == HWND_BOTTOM_W) 585 555 hWinAfter = HWND_BOTTOM; 586 556 else 587 557 hWinAfter = (HWND) hWndInsertAfter; 588 558 589 //*********************************** 590 // convert Windows flags to PM flags 591 //*********************************** 592 if ( ! ( fuFlags & SWP_NOSIZE_W ) ) flags |= SWP_SIZE; 593 if ( ! ( fuFlags & SWP_NOMOVE_W ) ) flags |= SWP_MOVE; 594 if ( ! ( fuFlags & SWP_NOZORDER_W ) ) flags |= SWP_ZORDER; 595 if ( fuFlags & SWP_NOREDRAW_W ) flags |= SWP_NOREDRAW; 596 if ( ! ( fuFlags & SWP_NOACTIVATE_W ) ) flags |= SWP_ACTIVATE; 597 if ( fuFlags & SWP_SHOWWINDOW_W ) flags |= SWP_SHOW; 598 if ( fuFlags & SWP_HIDEWINDOW_W ) flags |= SWP_HIDE; 599 /* no PM equivalent for SWP_FRAMECHANGED_W, SWP_NOCOPYBITS_W and SWP_NOOWNERZORDER_W */ 600 601 //************************************************************************** 602 // When moving or sizing we'll have to do some calculations for Y inversion. 603 // 604 // If moving - invert Y coord. 605 // 606 // If sizing - if the height is changing, have to move the window to 607 // maintain correct windows position. If we just size then the 608 // TR corner will extend. The Windows behaviour should be to 609 // extend the BR corner. 610 // 611 // If this is a child window then we'll have to move within the client 612 // area of the parent. 613 // 614 // If this is an overlapped or popup window we'll have to move around 615 // within the desktop. 616 //************************************************************************** 617 if ( flags & (SWP_MOVE | SWP_SIZE) ) 559 if (!(fuFlags & SWP_NOSIZE_W )) flags |= SWP_SIZE; 560 if (!(fuFlags & SWP_NOMOVE_W )) flags |= SWP_MOVE; 561 if (!(fuFlags & SWP_NOZORDER_W )) flags |= SWP_ZORDER; 562 if ( fuFlags & SWP_NOREDRAW_W ) flags |= SWP_NOREDRAW; 563 if (!(fuFlags & SWP_NOACTIVATE_W)) flags |= SWP_ACTIVATE; 564 if ( fuFlags & SWP_SHOWWINDOW_W) flags |= SWP_SHOW; 565 if ( fuFlags & SWP_HIDEWINDOW_W) flags |= SWP_HIDE; 566 567 if (flags & (SWP_MOVE | SWP_SIZE)) 618 568 { 619 569 if (hParent == NULLHANDLE) … … 622 572 parentHeight = OSLibGetWindowHeight(hParent); 623 573 624 //**********************************************************625 // We'll need both a y and cy for the Y inversion code.626 // If either wasn't passed in, calculate the current value.627 //**********************************************************628 574 if ((flags & SWP_MOVE) == 0) 629 575 { … … 631 577 y = pswpOld->y; 632 578 633 // If the window is at (x,0) with a height of zero then this calculation 634 // won't quite work. Instead of calculating the Windows y coord, we set 635 // it at (x,0). 636 if (!(y == 0 && pswpOld->cy == 0)) 579 if (!((y == 0) && (pswpOld->cy == 0))) 637 580 { 638 // convert Y coordinate back to Windows's for later conversion with new size639 581 y = parentHeight - y - pswpOld->cy; 640 582 } … … 643 585 if (flags & SWP_SIZE) 644 586 { 645 // If height is changing we MUST move to maintain top-left alignment646 587 if (cy != pswpOld->cy) 647 588 flags |= SWP_MOVE; … … 653 594 } 654 595 655 //********************************************************656 // Y inversion here... old Y is top left corner of window657 // relative to top left of parent.658 //********************************************************659 596 y = parentHeight - y - cy; 660 597 661 // Clear the SWP_MOVE flag if the window is not really being moved. 662 if ( ( pswpOld->x == x ) && ( pswpOld->y == y ) ) 598 if ((pswpOld->x == x) && (pswpOld->y == y)) 663 599 flags &= ~SWP_MOVE; 664 600 665 // Clear the SWP_SIZE flag if the window is not really being sized. 666 if ( ( pswpOld->cx == cx ) && ( pswpOld->cy == cy ) ) 601 if ((pswpOld->cx == cx) && (pswpOld->cy == cy)) 667 602 flags &= ~SWP_SIZE; 668 603 } 669 604 670 // Fill in the SWP structure with the now calculated PM values.671 605 pswp->fl = flags; 672 606 pswp->cy = cy;
Note:
See TracChangeset
for help on using the changeset viewer.