- Timestamp:
- Oct 20, 1999, 3:46:29 PM (26 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/initterm.cpp
r1014 r1376 1 /* $Id: initterm.cpp,v 1.1 0 1999-09-23 10:33:59sandervl Exp $ */1 /* $Id: initterm.cpp,v 1.11 1999-10-20 13:46:25 sandervl Exp $ */ 2 2 3 3 /* … … 27 27 #define INCL_DOSMODULEMGR 28 28 #define INCL_DOSPROCESS 29 #define INCL_DOSSEMAPHORES 29 30 #include <os2wrap.h> //Odin32 OS/2 api wrappers 30 31 #include <stdlib.h> -
trunk/src/user32/oslibwin.cpp
r1337 r1376 1 /* $Id: oslibwin.cpp,v 1.3 1 1999-10-17 16:42:38sandervl Exp $ */1 /* $Id: oslibwin.cpp,v 1.32 1999-10-20 13:46:26 sandervl Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 484 484 ULONG parentHeight; 485 485 486 HWND hWinAfter; 487 ULONG flags = 0; 486 HWND hWinAfter; 487 ULONG flags = 0; 488 SWP swpFrame; 489 POINTL point; 488 490 489 491 HWND hWnd = (hWindow == HWND_DESKTOP) ? HWND_DESKTOP_W: hWindow; 490 492 491 if (hWndInsertAfter == HWND_TOP) 492 hWinAfter = HWND_TOP_W; 493 else if (hWndInsertAfter == HWND_BOTTOM) 494 hWinAfter = HWND_BOTTOM_W; 495 else 496 hWinAfter = (HWND) hWndInsertAfter; 497 498 //*********************************** 499 // convert PM flags to Windows flags 500 //*********************************** 501 if (!(fuFlags & SWP_SIZE)) flags |= SWP_NOSIZE_W; 502 if (!(fuFlags & SWP_MOVE)) flags |= SWP_NOMOVE_W; 503 if (!(fuFlags & SWP_ZORDER)) flags |= SWP_NOZORDER_W; 504 if ( fuFlags & SWP_NOREDRAW) flags |= SWP_NOREDRAW_W; 505 if (!(fuFlags & SWP_ACTIVATE)) flags |= SWP_NOACTIVATE_W; 506 if ( fuFlags & SWP_SHOW) flags |= SWP_SHOWWINDOW_W; 507 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W; 508 509 if (fuFlags & (SWP_MOVE | SWP_SIZE)) 510 { 511 if (hParent == NULLHANDLE) 512 { 513 ULONG Offset; 514 POINTL pt = {0, 0}; 515 516 Offset = OSLibGetWindowHeight(hFrame) - cy; 517 parentHeight = ScreenHeight; 518 519 cx += 2 * x; 520 cy += Offset; 521 WinMapWindowPoints (hFrame, HWND_DESKTOP, &pt, 1); 522 x = pt.x; 523 y = pt.y; 524 525 pswpOld->cx += 2 * pswpOld->x; 526 pswpOld->cy += Offset; 527 pswpOld->x = pt.x; 528 pswpOld->y = pt.y; 529 } 530 else 531 { 532 parentHeight = OSLibGetWindowHeight(hParent); 533 } 534 535 if (fuFlags & SWP_SIZE) 536 { 537 if (cy != pswpOld->cy) 538 { 539 flags &= ~SWP_NOMOVE_W; 540 } 541 } 542 else 543 { 544 cx = pswpOld->cx; 545 cy = pswpOld->cy; 546 } 547 548 if ((fuFlags & SWP_MOVE) == 0) 549 { 550 x = pswpOld->x; 551 y = pswpOld->y; 552 } 553 554 y = parentHeight - y - cy; 555 LONG oldY = parentHeight - pswpOld->y - pswpOld->cy; 556 557 if ((pswpOld->x == x) && (oldY == y)) 558 flags |= SWP_NOMOVE_W; 559 560 if ((pswpOld->cx == cx) && (pswpOld->cy == cy)) 561 flags |= SWP_NOSIZE_W; 562 } 563 564 if (hParent == NULLHANDLE) 565 { 566 pswpOld->x = x + pswp->x; 567 pswpOld->y = y + cy - pswp->y - pswp->cy; 568 } 569 else { 570 pswpOld->x = pswp->x; 571 pswpOld->y = parentHeight - pswp->y - cy; 572 } 573 pswpOld->cx = pswp->cx; 574 pswpOld->cy = pswp->cy; 575 576 dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)", 577 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy)); 578 579 pwpos->flags = (UINT)flags; 580 pwpos->cy = (int)cy; 581 pwpos->cx = (int)cx; 582 pwpos->x = (int)x; 583 pwpos->y = (int)y; 584 pwpos->hwndInsertAfter = hWinAfter; 585 pwpos->hwnd = hWindow; 493 if (hWndInsertAfter == HWND_TOP) 494 hWinAfter = HWND_TOP_W; 495 else if (hWndInsertAfter == HWND_BOTTOM) 496 hWinAfter = HWND_BOTTOM_W; 497 else 498 hWinAfter = (HWND) hWndInsertAfter; 499 500 //*********************************** 501 // convert PM flags to Windows flags 502 //*********************************** 503 if (!(fuFlags & SWP_SIZE)) flags |= SWP_NOSIZE_W; 504 if (!(fuFlags & SWP_MOVE)) flags |= SWP_NOMOVE_W; 505 if (!(fuFlags & SWP_ZORDER)) flags |= SWP_NOZORDER_W; 506 if ( fuFlags & SWP_NOREDRAW) flags |= SWP_NOREDRAW_W; 507 if (!(fuFlags & SWP_ACTIVATE)) flags |= SWP_NOACTIVATE_W; 508 if ( fuFlags & SWP_SHOW) flags |= SWP_SHOWWINDOW_W; 509 if ( fuFlags & SWP_HIDE) flags |= SWP_HIDEWINDOW_W; 510 511 WinQueryWindowPos(hFrame, &swpFrame); 512 513 if(fuFlags & (SWP_MOVE | SWP_SIZE)) 514 { 515 point.x = swpFrame.x; 516 point.y = swpFrame.y; 517 if(hParent) 518 { 519 WinMapWindowPoints(hParent, HWND_DESKTOP, &point, 1); 520 } 521 point.y = OSLibQueryScreenHeight() - point.y - swpFrame.cy; 522 523 cy = swpFrame.cy; 524 cx = swpFrame.cx; 525 x = point.x; 526 y = point.y; 527 528 if ((pswp->x == pswpOld->x) && (pswp->y == pswpOld->y)) 529 flags |= SWP_NOMOVE_W; 530 531 if ((pswp->cx == pswpOld->cx) && (pswp->cy == pswpOld->cy)) 532 flags |= SWP_NOSIZE_W; 533 534 if (fuFlags & SWP_SIZE) 535 { 536 if (pswp->cy != pswpOld->cy) 537 { 538 flags &= ~SWP_NOMOVE_W; 539 } 540 } 541 } 542 543 pswpOld->x = pswp->x; 544 pswpOld->y = swpFrame.cy - pswp->y - pswp->cy; 545 pswpOld->cx = pswp->cx; 546 pswpOld->cy = pswp->cy; 547 548 dprintf(("window (%d,%d)(%d,%d) client (%d,%d)(%d,%d)", 549 x,y,cx,cy, pswpOld->x,pswpOld->y,pswpOld->cx,pswpOld->cy)); 550 551 pwpos->flags = (UINT)flags; 552 pwpos->cy = cy; 553 pwpos->cx = cx; 554 pwpos->x = x; 555 pwpos->y = y; 556 pwpos->hwndInsertAfter = hWinAfter; 557 pwpos->hwnd = hWindow; 586 558 } 587 559 //****************************************************************************** -
trunk/src/user32/pmwindow.cpp
r1354 r1376 1 /* $Id: pmwindow.cpp,v 1.3 6 1999-10-19 12:32:13 dengertExp $ */1 /* $Id: pmwindow.cpp,v 1.37 1999-10-20 13:46:26 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 22 22 #include <win32wbase.h> 23 23 #include <win32dlg.h> 24 #include "win32wdesktop.h" 24 25 #include "pmwindow.h" 25 26 #include "oslibwin.h" … … 251 252 SWP swpOld; 252 253 WINDOWPOS wp; 253 ULONG parentHeight = 0;254 ULONG parentHeight = 0; 254 255 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; 255 256 256 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x (%d,%d) (%d,%d)",hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));257 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 257 258 258 259 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break; 259 if (!win32wnd->CanReceiveSizeMsgs())break;260 if(!win32wnd->CanReceiveSizeMsgs()) break; 260 261 261 262 WinQueryWindowPos(hwnd, &swpOld); … … 268 269 else break; 269 270 } 270 else 271 hFrame = win32wnd->getOS2FrameWindowHandle(); 272 } 271 } 272 hFrame = win32wnd->getOS2FrameWindowHandle(); 273 273 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame); 274 274 … … 279 279 if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle(); 280 280 } 281 win32wnd->MsgPosChanging((LPARAM)&wp); 281 if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0) 282 {//app or default window handler changed wp 283 dprintf(("OS2: WM_ADJUSTWINDOWPOS, app changed windowpos struct")); 284 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 285 OSLibMapWINDOWPOStoSWP(&wp, pswp, &swpOld, hParent, hFrame); 286 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 287 //TODO: What should we return here? 0 means no changes, but the AWP flags 288 // aren't very useful either 289 } 282 290 break; 283 291 } … … 285 293 case WM_WINDOWPOSCHANGED: 286 294 { 287 PSWP pswp = (PSWP)mp1;288 PSWP pswpo = pswp + 1;295 PSWP pswp = (PSWP)mp1; 296 SWP swpOld = *(pswp + 1); 289 297 WINDOWPOS wp; 290 298 ULONG parentHeight = 0; 291 299 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; 292 LONG yDelta = pswp->cy - pswpo->cy; 293 LONG xDelta = pswp->cx - pswpo->cx; 294 ULONG classStyle; 300 LONG yDelta = pswp->cy - swpOld.cy; 301 LONG xDelta = pswp->cx - swpOld.cx; 295 302 296 303 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 297 304 298 305 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break; 299 if (!win32wnd->CanReceiveSizeMsgs())break;306 if(!win32wnd->CanReceiveSizeMsgs()) break; 300 307 301 308 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { … … 306 313 else goto RunDefWndProc; //parent has just been destroyed 307 314 } 308 else 309 hFrame = WinQueryWindow(hwnd, QW_PARENT); 310 } 311 OSLibMapSWPtoWINDOWPOS(pswp, &wp, pswpo, hParent, hFrame); 312 313 SWP swpFrame; 314 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swpFrame); 315 dprintf(("WINDOWPOSCHANGE %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), win32wnd->getOS2FrameWindowHandle(), 316 swpFrame.fl,swpFrame.x, swpFrame.y, swpFrame.cx, swpFrame.cy)); 317 POINTL point; 318 319 point.x = swpFrame.x; 320 point.y = swpFrame.y; 321 if(win32wnd->getParent() != NULL) 322 { 323 WinMapWindowPoints(WinQueryWindow(hwnd, QW_PARENT), HWND_DESKTOP, 324 &point, 1); 325 } 326 point.y = OSLibQueryScreenHeight() - point.y - swpFrame.cy; 327 328 win32wnd->setWindowRect(point.x, point.y, point.x+swpFrame.cx, point.y+swpFrame.cy); 329 win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy); 315 } 316 hFrame = WinQueryWindow(hwnd, QW_PARENT); 317 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame); 318 319 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 320 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 330 321 331 322 wp.hwnd = win32wnd->getWindowHandle(); … … 335 326 wp.hwndInsertAfter = wndAfter->getWindowHandle(); 336 327 } 337 classStyle = win32wnd->getClass()->getStyle();338 328 339 329 if (yDelta != 0 || xDelta != 0) … … 395 385 win32wnd->MsgPosChanged((LPARAM)&wp); 396 386 397 goto RunDefWndProc; 398 // break; 387 goto RunDefWndProc; 399 388 } 400 389 … … 611 600 break; 612 601 } 613 614 //**************************************************************************615 //Slider messages616 //**************************************************************************617 /* CB: handled internally618 case WM_VSCROLL:619 case WM_HSCROLL:620 {621 ULONG scrollPos, scrollCode, scrollMsg;622 623 scrollCode = SHORT2FROMMP(mp2);624 scrollPos = SHORT1FROMMP(mp2);625 scrollMsg = msg;626 627 OSLibTranslateScrollCmdAndMsg(&scrollMsg, &scrollCode);628 629 if(win32wnd->MsgScroll(scrollMsg, scrollCode, scrollPos)) {630 goto RunDefWndProc;631 }632 break;633 }634 */635 602 636 603 case WM_CONTROL: … … 853 820 win32wnd->setEraseBkgnd (!erased, !erased); 854 821 } 822 855 823 break; 856 824 } … … 860 828 861 829 if (WinQueryUpdateRect (hwnd, NULL)) { 862 if ( win32wnd->isEraseBkgnd() &&!win32wnd->isSupressErase()) {830 if (!win32wnd->isSupressErase()) { 863 831 BOOL erased = sendEraseBkgnd (win32wnd); 864 832 win32wnd->setEraseBkgnd (!erased, !erased); … … 939 907 { 940 908 PSWP pswp = (PSWP)mp1; 941 PSWP pswpo = pswp + 1;909 SWP swpOld = *(pswp + 1); 942 910 WINDOWPOS wp; 943 911 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; … … 948 916 hFrame = WinQueryWindow(hwnd, QW_PARENT); 949 917 950 OSLibMapSWPtoWINDOWPOS(pswp,&wp,pswpo,hParent,hFrame); 951 952 SWP swpFrame; 953 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swpFrame); 954 POINTL point; 955 956 point.x = swpFrame.x; 957 point.y = swpFrame.y; 958 WinMapWindowPoints(WinQueryWindow(hwnd, QW_PARENT), HWND_DESKTOP, 959 &point, 1); 960 point.y = OSLibQueryScreenHeight() - point.y - swpFrame.cy; 961 962 win32wnd->setWindowRect(point.x, point.y, point.x+swpFrame.cx, point.y+swpFrame.cy); 963 win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy); 918 OSLibMapSWPtoWINDOWPOS(pswp,&wp, &swpOld,hParent,hFrame); 919 920 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 921 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 964 922 965 923 win32wnd->MsgPosChanged((LPARAM)&wp); -
trunk/src/user32/win32wbase.cpp
r1365 r1376 1 /* $Id: win32wbase.cpp,v 1.5 6 1999-10-19 19:26:08sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.57 1999-10-20 13:46:27 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 659 659 rectClient.right-rectClient.left, 660 660 rectClient.bottom-rectClient.top, 661 SWP_NOACTIVATE | SWP_NOZORDER );661 SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOREDRAW); 662 662 } 663 663 else { … … 665 665 rectClient.right-rectClient.left, 666 666 rectClient.bottom-rectClient.top, 667 SWP_NOACTIVATE); 668 } 667 SWP_NOACTIVATE | SWP_NOREDRAW); 668 } 669 //Note: Solitaire crashes when receiving WM_SIZE messages before WM_CREATE 669 670 fNoSizeMsg = FALSE; 670 671 … … 1479 1480 return 0; 1480 1481 } 1482 case WM_WINDOWPOSCHANGING: 1483 return HandleWindowPosChanging((WINDOWPOS *)lParam); 1484 1481 1485 case WM_ERASEBKGND: 1482 1486 case WM_ICONERASEBKGND: … … 2530 2534 ss.styleOld = dwExStyle; 2531 2535 ss.styleNew = value; 2532 dprintf(("SetWindowLong GWL_EXSTYLE %x new style %x", getWindowHandle(), value));2536 dprintf(("SetWindowLong GWL_EXSTYLE %x old %x new style %x", getWindowHandle(), dwExStyle, value)); 2533 2537 SendMessageA(WM_STYLECHANGING,GWL_EXSTYLE,(LPARAM)&ss); 2534 2538 setExStyle(ss.styleNew); … … 2545 2549 ss.styleOld = dwStyle; 2546 2550 ss.styleNew = value; 2547 dprintf(("SetWindowLong GWL_STYLE %x new style %x", getWindowHandle(), value));2551 dprintf(("SetWindowLong GWL_STYLE %x old %x new style %x", getWindowHandle(), dwStyle, value)); 2548 2552 SendMessageA(WM_STYLECHANGING,GWL_STYLE,(LPARAM)&ss); 2549 2553 setStyle(ss.styleNew); -
trunk/src/user32/win32wbase.h
r1351 r1376 1 /* $Id: win32wbase.h,v 1.3 0 1999-10-18 11:59:58 sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.31 1999-10-20 13:46:28 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 302 302 #ifndef OS2_INCLUDED 303 303 void GetMinMaxInfo(POINT *maxSize, POINT *maxPos, POINT *minTrack, POINT *maxTrack ); 304 LONG HandleWindowPosChanging(WINDOWPOS *winpos); 304 305 LONG HandleSysCommand(WPARAM wParam, POINT *pt32); 305 306 -
trunk/src/user32/win32wbasepos.cpp
r1336 r1376 1 /* $Id: win32wbasepos.cpp,v 1. 3 1999-10-17 15:46:10sandervl Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.4 1999-10-20 13:46:28 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 186 186 */ 187 187 void Win32BaseWindow::GetMinMaxInfo(POINT *maxSize, POINT *maxPos, 188 POINT *minTrack, POINT *maxTrack )188 POINT *minTrack, POINT *maxTrack ) 189 189 { 190 190 MINMAXINFO MinMax; … … 370 370 if ((style & WS_CAPTION) == WS_CAPTION) 371 371 { 372 373 374 375 372 if (exStyle & WS_EX_TOOLWINDOW) 373 rect->top -= GetSystemMetrics(SM_CYSMCAPTION); 374 else 375 rect->top -= GetSystemMetrics(SM_CYCAPTION); 376 376 } 377 377 // } 378 378 379 379 if (menu) 380 380 rect->top -= GetSystemMetrics(SM_CYMENU); 381 381 } 382 382 /****************************************************************************** … … 410 410 411 411 if (exStyle & WS_EX_CLIENTEDGE) 412 412 InflateRect(rect, GetSystemMetrics(SM_CXEDGE), GetSystemMetrics(SM_CYEDGE)); 413 413 414 414 if (exStyle & WS_EX_STATICEDGE) 415 415 InflateRect(rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); 416 416 417 417 if (style & WS_VSCROLL) rect->right += GetSystemMetrics(SM_CXVSCROLL); 418 418 if (style & WS_HSCROLL) rect->bottom += GetSystemMetrics(SM_CYHSCROLL); 419 419 } 420 /*********************************************************************** 421 * WINPOS_HandleWindowPosChanging16 422 * 423 * Default handling for a WM_WINDOWPOSCHANGING. Called from DefWindowProc(). 424 */ 425 LONG Win32BaseWindow::HandleWindowPosChanging(WINDOWPOS *winpos) 426 { 427 POINT maxSize, minTrack; 428 429 if (winpos->flags & SWP_NOSIZE) 430 return 1; 431 432 if ((getStyle() & WS_THICKFRAME) || 433 ((getStyle() & (WS_POPUP | WS_CHILD)) == 0)) 434 { 435 GetMinMaxInfo(&maxSize, NULL, &minTrack, NULL ); 436 if (maxSize.x < winpos->cx) winpos->cx = maxSize.x; 437 if (maxSize.y < winpos->cy) winpos->cy = maxSize.y; 438 if (!(getStyle() & WS_MINIMIZE)) 439 { 440 if (winpos->cx < minTrack.x ) winpos->cx = minTrack.x; 441 if (winpos->cy < minTrack.y ) winpos->cy = minTrack.y; 442 } 443 return 0; 444 } 445 return 1; 446 } 420 447 //****************************************************************************** 421 448 //****************************************************************************** -
trunk/src/user32/win32wdesktop.h
r1245 r1376 1 /* $Id: win32wdesktop.h,v 1. 3 1999-10-11 15:26:07sandervl Exp $ */1 /* $Id: win32wdesktop.h,v 1.4 1999-10-20 13:46:29 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Desktop Window for OS/2 … … 13 13 #define __WIN32WDESKTOP_H__ 14 14 15 #if defined(__cplusplus) && defined(_OS2WIN_H)15 #if defined(__cplusplus) 16 16 17 17 #include <win32wbase.h>
Note:
See TracChangeset
for help on using the changeset viewer.