- Timestamp:
- Feb 20, 2001, 6:22:06 PM (25 years ago)
- Location:
- trunk/src/user32
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/pmwindow.cpp
r5189 r5217 1 /* $Id: pmwindow.cpp,v 1.11 7 2001-02-19 10:15:52sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.118 2001-02-20 17:22:05 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 286 286 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 287 287 288 if(win32wnd->getParent() && win32wnd->getParent()->isOwnDC()) {289 dprintfOrigin(win32wnd->getParent()->getOwnDC());290 selectClientArea(win32wnd->getParent(), win32wnd->getParent()->getOwnDC());291 }292 293 288 if(pswp->fl & SWP_NOADJUST) { 294 289 //ignore weird messages (TODO: why are they sent?) … … 387 382 WINDOWPOS wp; 388 383 HWND hParent = NULLHANDLE; 389 RECTL rect;384 RECTL rect; 390 385 391 386 dprintf(("OS2: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); … … 396 391 { 397 392 //Only send PM WM_ACTIVATE to top-level windows (frame windows) 398 if(!(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & FF_ACTIVE))393 if(!(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & WINDOWFLAG_ACTIVE)) 399 394 { 400 395 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 396 } 397 } 398 else 399 if(pswp->fl & SWP_DEACTIVATE) 400 { 401 //Only send PM WM_ACTIVATE to top-level windows (frame windows) 402 if(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & WINDOWFLAG_ACTIVE) 403 { 404 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)FALSE, (MPARAM)hwnd); 401 405 } 402 406 } … … 417 421 418 422 if(win32wnd->getParent()) { 419 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, win32wnd->getParent()->getWindowHeight(),420 421 422 423 } 424 else 423 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, win32wnd->getParent()->getWindowHeight(), 424 win32wnd->getParent()->getClientRectPtr()->left, 425 win32wnd->getParent()->getClientRectPtr()->top, 426 hwnd); 427 } 428 else OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, OSLibQueryScreenHeight(), 0, 0, hwnd); 425 429 426 430 wp.hwnd = win32wnd->getWindowHandle(); 427 431 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) 428 432 { 429 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);430 if(wndAfter) {431 wp.hwndInsertAfter = wndAfter->getWindowHandle();432 }433 else wp.hwndInsertAfter = HWND_TOP_W;433 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 434 if(wndAfter) { 435 wp.hwndInsertAfter = wndAfter->getWindowHandle(); 436 } 437 else wp.hwndInsertAfter = HWND_TOP_W; 434 438 } 435 439 436 440 if((pswp->fl & (SWP_MOVE | SWP_SIZE)) && !(win32wnd->getStyle() & WS_MINIMIZE_W)) 437 441 { 438 //CB: todo: use result for WM_CALCVALIDRECTS 439 //Get old client rectangle (for invalidation of frame window parts later on) 440 //Use new window height to calculate the client area 441 mapWin32ToOS2Rect(pswp->cy, win32wnd->getClientRectPtr(), (PRECTLOS2)&rect); 442 443 //Note: Also updates the new window rectangle 444 win32wnd->MsgFormatFrame(&wp); 445 446 if(win32wnd->CanReceiveSizeMsgs()) 447 win32wnd->MsgPosChanged((LPARAM)&wp); 448 449 if((pswp->fl & SWP_SIZE) && ((pswp->cx != pswpOld->cx) || (pswp->cy != pswpOld->cy))) 450 { 451 //redraw the frame (to prevent unnecessary client updates) 452 BOOL redrawAll = FALSE; 453 454 if (win32wnd->getWindowClass()) 442 //CB: todo: use result for WM_CALCVALIDRECTS 443 //Get old client rectangle (for invalidation of frame window parts later on) 444 //Use new window height to calculate the client area 445 mapWin32ToOS2Rect(pswp->cy, win32wnd->getClientRectPtr(), (PRECTLOS2)&rect); 446 447 //Note: Also updates the new window rectangle 448 win32wnd->MsgFormatFrame(&wp); 449 450 if(win32wnd->CanReceiveSizeMsgs()) 451 win32wnd->MsgPosChanged((LPARAM)&wp); 452 453 if((pswp->fl & SWP_SIZE) && ((pswp->cx != pswpOld->cx) || (pswp->cy != pswpOld->cy))) 455 454 { 456 DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W); 457 458 if ((dwStyle & CS_HREDRAW_W) && (pswp->cx != pswpOld->cx)) 459 redrawAll = TRUE; 460 else if ((dwStyle & CS_VREDRAW_W) && (pswp->cy != pswpOld->cy)) 461 redrawAll = TRUE; 462 } else redrawAll = TRUE; 463 464 if (redrawAll) 465 { 466 //CB: redraw all children for now 467 // -> problems with update region if we don't do it 468 // todo: rewrite whole handling 469 WinInvalidateRect(hwnd,NULL,TRUE); 470 } 471 else 472 { 473 HPS hps = WinGetPS(hwnd); 474 RECTL frame,client,arcl[4]; 475 476 WinQueryWindowRect(hwnd,&frame); 477 478 //top 479 arcl[0].xLeft = 0; 480 arcl[0].xRight = frame.xRight; 481 arcl[0].yBottom = rect.yTop; 482 arcl[0].yTop = frame.yTop; 483 //right 484 arcl[1].xLeft = rect.xRight; 485 arcl[1].xRight = frame.xRight; 486 arcl[1].yBottom = 0; 487 arcl[1].yTop = frame.yTop; 488 //left 489 arcl[2].xLeft = 0; 490 arcl[2].xRight = rect.xLeft; 491 arcl[2].yBottom = 0; 492 arcl[2].yTop = frame.yTop; 493 //bottom 494 arcl[3].xLeft = 0; 495 arcl[3].xRight = frame.xRight; 496 arcl[3].yBottom = 0; 497 arcl[3].yTop = rect.yBottom; 498 499 HRGN hrgn = GpiCreateRegion(hps,4,(PRECTL)&arcl); 500 501 WinInvalidateRegion(hwnd,hrgn,FALSE); 502 GpiDestroyRegion(hps,hrgn); 503 WinReleasePS(hps); 504 } 505 } 506 } 507 else 508 { 509 if(win32wnd->CanReceiveSizeMsgs()) 510 win32wnd->MsgPosChanged((LPARAM)&wp); 511 } 512 513 if(pswp->fl & SWP_ACTIVATE) 514 { 515 //Only send PM WM_ACTIVATE to top-level windows (frame windows) 516 if(!(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & FF_ACTIVE)) 517 { 518 if(isFrame) { 519 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 455 //redraw the frame (to prevent unnecessary client updates) 456 BOOL redrawAll = FALSE; 457 458 if (win32wnd->getWindowClass()) 459 { 460 DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W); 461 462 if ((dwStyle & CS_HREDRAW_W) && (pswp->cx != pswpOld->cx)) 463 redrawAll = TRUE; 464 else 465 if ((dwStyle & CS_VREDRAW_W) && (pswp->cy != pswpOld->cy)) 466 redrawAll = TRUE; 467 } 468 else redrawAll = TRUE; 469 470 if (redrawAll) 471 { 472 //CB: redraw all children for now 473 // -> problems with update region if we don't do it 474 // todo: rewrite whole handling 475 WinInvalidateRect(hwnd,NULL,TRUE); 520 476 } 521 477 else 522 if(win32wnd->IsWindowCreated()) { 523 win32wnd->MsgActivate(1, 0, win32wnd->getWindowHandle(), hwnd); 478 { 479 HPS hps = WinGetPS(hwnd); 480 RECTL frame,client,arcl[4]; 481 482 WinQueryWindowRect(hwnd,&frame); 483 484 //top 485 arcl[0].xLeft = 0; 486 arcl[0].xRight = frame.xRight; 487 arcl[0].yBottom = rect.yTop; 488 arcl[0].yTop = frame.yTop; 489 //right 490 arcl[1].xLeft = rect.xRight; 491 arcl[1].xRight = frame.xRight; 492 arcl[1].yBottom = 0; 493 arcl[1].yTop = frame.yTop; 494 //left 495 arcl[2].xLeft = 0; 496 arcl[2].xRight = rect.xLeft; 497 arcl[2].yBottom = 0; 498 arcl[2].yTop = frame.yTop; 499 //bottom 500 arcl[3].xLeft = 0; 501 arcl[3].xRight = frame.xRight; 502 arcl[3].yBottom = 0; 503 arcl[3].yTop = rect.yBottom; 504 505 HRGN hrgn = GpiCreateRegion(hps,4,(PRECTL)&arcl); 506 507 WinInvalidateRegion(hwnd,hrgn,FALSE); 508 GpiDestroyRegion(hps,hrgn); 509 WinReleasePS(hps); 524 510 } 511 } 512 } 513 else 514 { 515 if(win32wnd->CanReceiveSizeMsgs()) 516 win32wnd->MsgPosChanged((LPARAM)&wp); 517 } 518 519 if(pswp->fl & SWP_ACTIVATE) 520 { 521 //Only send PM WM_ACTIVATE to top-level windows (frame windows) 522 if(!(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & WINDOWFLAG_ACTIVE)) 523 { 524 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 525 525 } 526 } 527 else 528 if(pswp->fl & SWP_DEACTIVATE) 529 { 530 //Only send PM WM_ACTIVATE to top-level windows (frame windows) 531 if(WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS) & WINDOWFLAG_ACTIVE) 532 { 533 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)FALSE, (MPARAM)hwnd); 534 } 526 535 } 527 536 … … 532 541 case WM_ACTIVATE: 533 542 { 534 U SHORTflags = WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS);543 ULONG flags = WinQueryWindowULong(hwnd, OFFSET_WIN32FLAGS); 535 544 536 545 dprintf(("OS2: WM_ACTIVATE %x %x %x", hwnd, mp1, mp2)); 537 546 538 WinSetWindowULong(hwnd, OFFSET_WIN32FLAGS, SHORT1FROMMP(mp1) ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE));547 WinSetWindowULong(hwnd, OFFSET_WIN32FLAGS, SHORT1FROMMP(mp1) ? (flags | WINDOWFLAG_ACTIVE):(flags & ~WINDOWFLAG_ACTIVE)); 539 548 if(win32wnd->IsWindowCreated()) 540 549 { … … 604 613 break; 605 614 } 606 //test 615 //Restore window origin of window with CS_OWNDC style 616 //(fixes paint offset problems in Opera windows) 607 617 if(win32wnd->isOwnDC()) { 608 618 dprintfOrigin(win32wnd->getOwnDC()); 609 619 selectClientArea(win32wnd, win32wnd->getOwnDC()); 610 620 } 611 //test612 621 goto RunDefWndProc; 613 622 -
trunk/src/user32/win32wbase.cpp
r5215 r5217 1 /* $Id: win32wbase.cpp,v 1.23 8 2001-02-20 15:40:22sandervl Exp $ */1 /* $Id: win32wbase.cpp,v 1.239 2001-02-20 17:22:05 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 925 925 return 0; 926 926 } 927 /* child windows get WM_CHILDACTIVATE message */927 /* child windows get a WM_CHILDACTIVATE message */ 928 928 if((getStyle() & (WS_CHILD | WS_POPUP)) == WS_CHILD ) 929 929 { 930 SendInternalMessageA(WM_CHILDACTIVATE, 0, 0L); 930 if(fActivate) {//WM_CHILDACTIVE is for activation only 931 SendInternalMessageA(WM_CHILDACTIVATE, 0, 0L); 932 } 931 933 return 0; 932 934 } … … 2429 2431 } 2430 2432 2431 //testestest 2433 //Restore window origin of parent window with CS_OWNDC style 2434 //(fixes paint offset problems in Opera windows) 2432 2435 if(getParent() && getParent()->isOwnDC()) { 2433 2436 dprintfOrigin(getParent()->getOwnDC()); 2434 2437 selectClientArea(getParent(), getParent()->getOwnDC()); 2435 2438 } 2436 //testestest2437 2439 2438 2440 if((fuFlags & SWP_FRAMECHANGED) && (fuFlags & (SWP_NOMOVE | SWP_NOSIZE) == (SWP_NOMOVE | SWP_NOSIZE))) … … 3114 3116 hwndActive = GetActiveWindow(); 3115 3117 return (hwndActive) ? hwndActive : windowDesktop->getWindowHandle(); //pretend the desktop was active 3118 } 3119 //****************************************************************************** 3120 //Used to change active status of an mdi window 3121 //****************************************************************************** 3122 BOOL Win32BaseWindow::DeactivateChildWindow() 3123 { 3124 /* child windows get a WM_CHILDACTIVATE message */ 3125 if((getStyle() & (WS_CHILD | WS_POPUP)) == WS_CHILD ) 3126 { 3127 ULONG flags = OSLibWinGetWindowULong(getOS2WindowHandle(), OFFSET_WIN32FLAGS); 3128 OSLibWinSetWindowULong(getOS2WindowHandle(), OFFSET_WIN32FLAGS, (flags & ~WINDOWFLAG_ACTIVE)); 3129 return TRUE; 3130 } 3131 DebugInt3(); //should not be called for non-child window 3132 return FALSE; 3116 3133 } 3117 3134 //****************************************************************************** -
trunk/src/user32/win32wbase.h
r5215 r5217 1 /* $Id: win32wbase.h,v 1.10 7 2001-02-20 15:40:23sandervl Exp $ */1 /* $Id: win32wbase.h,v 1.108 2001-02-20 17:22:05 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 29 29 #define OFFSET_WIN32FLAGS 8 30 30 #define NROF_WIN32WNDBYTES 12 31 32 #define WINDOWFLAG_ACTIVE 1 31 33 32 34 #define WIN32PM_MAGIC 0x12345678 … … 225 227 BOOL DestroyWindow(); 226 228 HWND SetActiveWindow(); 229 BOOL DeactivateChildWindow(); 227 230 HWND GetParent(); 228 231 HWND SetParent(HWND hwndNewParent); -
trunk/src/user32/win32wbasenonclient.cpp
r5215 r5217 1 /* $Id: win32wbasenonclient.cpp,v 1.2 7 2001-02-20 15:40:23sandervl Exp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.28 2001-02-20 17:22:06 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 335 335 VOID Win32BaseWindow::AdjustMaximizedRect(LPRECT rect) 336 336 { 337 if (HAS_THICKFRAME(dwStyle,dwExStyle ))338 InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );339 else337 if (HAS_THICKFRAME(dwStyle,dwExStyle )) 338 InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) ); 339 else 340 340 if (HAS_DLGFRAME( dwStyle, dwExStyle )) 341 InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) );341 InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) ); 342 342 else 343 343 if (HAS_THINFRAME( dwStyle )) 344 344 InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); 345 345 } … … 348 348 VOID Win32BaseWindow::AdjustTrackInfo(PPOINT minTrackSize,PPOINT maxTrackSize) 349 349 { 350 if ((dwStyle & WS_THICKFRAME) || !(dwStyle & (WS_POPUP | WS_CHILD)))351 GetMinMaxInfo(NULL,NULL,minTrackSize,maxTrackSize);350 if ((dwStyle & WS_THICKFRAME) || !(dwStyle & (WS_POPUP | WS_CHILD))) 351 GetMinMaxInfo(NULL,NULL,minTrackSize,maxTrackSize); 352 352 } 353 353 //****************************************************************************** … … 355 355 VOID Win32BaseWindow::AdjustRectOuter(LPRECT rect,BOOL menu) 356 356 { 357 if(dwStyle & WS_ICONIC) return;358 359 if (HAS_THICKFRAME(dwStyle,dwExStyle ))360 InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) );361 else357 if(dwStyle & WS_ICONIC) return; 358 359 if (HAS_THICKFRAME(dwStyle,dwExStyle )) 360 InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) ); 361 else 362 362 if (HAS_DLGFRAME( dwStyle, dwExStyle )) 363 InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) );363 InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) ); 364 364 else 365 365 if (HAS_THINFRAME( dwStyle )) 366 366 InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); 367 367 368 if ((dwStyle & WS_CAPTION) == WS_CAPTION)369 {370 if (dwExStyle & WS_EX_TOOLWINDOW)371 rect->top -= GetSystemMetrics(SM_CYSMCAPTION);372 else373 rect->top -= GetSystemMetrics(SM_CYCAPTION);374 }375 376 if (menu)377 rect->top -= GetSystemMetrics(SM_CYMENU);368 if ((dwStyle & WS_CAPTION) == WS_CAPTION) 369 { 370 if (dwExStyle & WS_EX_TOOLWINDOW) 371 rect->top -= GetSystemMetrics(SM_CYSMCAPTION); 372 else 373 rect->top -= GetSystemMetrics(SM_CYCAPTION); 374 } 375 376 if (menu) 377 rect->top -= GetSystemMetrics(SM_CYMENU); 378 378 } 379 379 //****************************************************************************** … … 685 685 GetInsideRect(rect ); 686 686 OffsetRect( rect, rectWindow.left, rectWindow.top); 687 688 687 if(getStyle() & WS_CHILD) 688 ClientToScreen(getParent()->getWindowHandle(), (POINT *)rect); 689 689 690 690 rect->right = rect->left + GetSystemMetrics(SM_CYCAPTION) - 1; -
trunk/src/user32/win32wmdiclient.cpp
r4839 r5217 1 /* $Id: win32wmdiclient.cpp,v 1.3 2 2000-12-24 14:54:07sandervl Exp $ */1 /* $Id: win32wmdiclient.cpp,v 1.33 2001-02-20 17:22:06 sandervl Exp $ */ 2 2 /* 3 3 * Win32 MDI Client Window Class for OS/2 … … 346 346 { 347 347 prevActive->setStyle(prevActive->getStyle() | WS_SYSMENU); 348 prevActive->DeactivateChildWindow(); 348 349 prevActive->SendInternalMessageA( WM_NCACTIVATE, FALSE, 0L ); 349 350 prevActive->SendInternalMessageA( WM_MDIACTIVATE, (WPARAM)prevActive->getWindowHandle(), (LPARAM)(child) ? child->getWindowHandle() : 0);
Note:
See TracChangeset
for help on using the changeset viewer.