- Timestamp:
- Jan 5, 2000, 10:25:08 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/oslibgdi.cpp
r2290 r2335 1 /* $Id: oslibgdi.cpp,v 1. 9 2000-01-01 14:57:18cbratschi Exp $ */1 /* $Id: oslibgdi.cpp,v 1.10 2000-01-05 21:25:03 cbratschi Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 430 430 //****************************************************************************** 431 431 //****************************************************************************** 432 BOOL mapWin32Rect(HWND os2From,HWND os2To,PRECT rectWin32) 433 { 434 RECTL rect; 435 436 mapWin32ToOS2Rect(os2From,rectWin32,(PRECTLOS2)&rect); 437 WinMapWindowPoints((os2From == OSLIB_HWND_DESKTOP) ? HWND_DESKTOP:os2From,(os2To == OSLIB_HWND_DESKTOP) ? HWND_DESKTOP:os2To,(PPOINTL)&rect,2); 438 mapOS2ToWin32Rect(os2To,(PRECTLOS2)&rect,rectWin32); 439 } 440 //****************************************************************************** 441 //****************************************************************************** 432 442 BOOL copyOS2ToWin32Rect(PRECTLOS2 rectOS2,PRECT rectWin32) 433 443 { -
trunk/src/user32/new/oslibgdi.h
r2290 r2335 1 /* $Id: oslibgdi.h,v 1. 7 2000-01-01 14:54:52cbratschi Exp $ */1 /* $Id: oslibgdi.h,v 1.8 2000-01-05 21:25:03 cbratschi Exp $ */ 2 2 /* 3 3 * Window GDI wrapper functions for OS/2 … … 69 69 BOOL mapWin32ToOS2Rect(HWND os2From,HWND os2To,PRECT rectWin32,PRECTLOS2 rectOS2); 70 70 BOOL mapWin32ToOS2Rect(Win32BaseWindow *wndFrom,Win32BaseWindow *wndTo,PRECT rectWin32,PRECTLOS2 rectOS2); 71 BOOL mapWin32Rect(HWND os2From,HWND os2To,PRECT rectWin32); 71 72 BOOL copyOS2ToWin32Rect(PRECTLOS2 rectOS2,PRECT rectWin32); 72 73 BOOL copyWin32ToOS2WindowRect(PRECT rectWin32,PRECTLOS2 rectOS2); -
trunk/src/user32/new/oslibmsg.cpp
r2314 r2335 1 /* $Id: oslibmsg.cpp,v 1. 8 2000-01-03 22:53:16 sandervlExp $ */1 /* $Id: oslibmsg.cpp,v 1.9 2000-01-05 21:25:03 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 225 225 while(rc == FALSE); 226 226 227 227 return rc; 228 228 } 229 229 else … … 237 237 } 238 238 if(rc) { 239 239 OS2ToWinMsgTranslate((PVOID)thdb, &os2msg, pMsg, isUnicode, MSG_REMOVE); 240 240 memcpy(MsgThreadPtr, &os2msg, sizeof(QMSG)); 241 241 } … … 410 410 411 411 return yyrc; 412 } 412 } 413 413 //****************************************************************************** 414 414 BOOL OSLibPostThreadMessage(ULONG threadid, UINT msg, WPARAM wParam, LPARAM lParam, BOOL fUnicode) -
trunk/src/user32/new/oslibmsgtranslate.cpp
r2309 r2335 1 /* $Id: oslibmsgtranslate.cpp,v 1. 4 2000-01-03 20:53:49cbratschi Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.5 2000-01-05 21:25:04 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 112 112 memset(winMsg, 0, sizeof(MSG)); 113 113 win32wnd = Win32BaseWindow::GetWindowFromOS2Handle(os2Msg->hwnd); 114 if (!win32wnd) win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(os2Msg->hwnd); 114 115 //PostThreadMessage posts WIN32APP_POSTMSG msg without window handle 115 116 if((win32wnd == 0) && (os2Msg->msg != WM_CREATE) && (os2Msg->msg != WIN32APP_POSTMSG)) … … 120 121 winMsg->pt.x = os2Msg->ptl.x; 121 122 winMsg->pt.y = mapScreenY(os2Msg->ptl.y); 123 122 124 if(win32wnd) //==0 for WM_CREATE 123 125 winMsg->hwnd = win32wnd->getWindowHandle(); … … 206 208 case WM_HITTEST: 207 209 { 208 OSLIBPOINT pt;209 210 pt.x = (*(POINTS *)&os2Msg->mp1).x;211 pt.y = (*(POINTS *)&os2Msg->mp1).y;212 213 mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);214 210 winMsg->message = WINWM_NCHITTEST; 215 211 winMsg->wParam = 0; 216 winMsg->lParam = MAKELONG( (USHORT)pt.x, (USHORT)pt.y);212 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 217 213 return TRUE; 218 214 } … … 276 272 277 273 case WM_WINDOWPOSCHANGED: 278 {279 PSWP pswp = (PSWP)os2Msg->mp1;280 SWP swpOld = *(pswp + 1);281 HWND hParent = NULLHANDLE;282 LONG yDelta = pswp->cy - swpOld.cy;283 LONG xDelta = pswp->cx - swpOld.cx;284 285 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));286 287 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto dummymessage;288 289 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) {290 if (win32wnd->isChild()) {291 if(win32wnd->getParent()) {292 hParent = win32wnd->getParent()->getOS2WindowHandle();293 }294 else goto dummymessage; //parent has just been destroyed295 }296 }297 OSLibMapSWPtoWINDOWPOS(pswp, &thdb->wp, &swpOld, hParent, win32wnd->getOS2FrameWindowHandle());298 299 if (!win32wnd->CanReceiveSizeMsgs()) goto dummymessage;300 //CB: todo: send WM_NCCALCSIZE301 #if 0 //CB: ignore it302 dprintf(("Set client rectangle to (%d,%d)(%d,%d)", swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy));303 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);304 305 thdb->wp.hwnd = win32wnd->getWindowHandle();306 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM))307 {308 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind);309 thdb->wp.hwndInsertAfter = wndAfter->getWindowHandle();310 }311 312 PRECT lpRect = win32wnd->getWindowRect();313 //SvL: Only send it when the client has changed & the frame hasn't314 // If the frame size/position has changed, pmframe.cpp will send315 // this message316 if(lpRect->right == thdb->wp.x+thdb->wp.cx && lpRect->bottom == thdb->wp.y+thdb->wp.cy) {317 winMsg->message = WINWM_WINDOWPOSCHANGED;318 winMsg->lParam = (LPARAM)&thdb->wp;319 }320 else {321 win32wnd->setWindowRect(thdb->wp.x, thdb->wp.y, thdb->wp.x+thdb->wp.cx, thdb->wp.y+thdb->wp.cy);322 goto dummymessage;323 }324 #else325 274 goto dummymessage; 326 #endif327 }328 275 329 276 case WM_ACTIVATE: … … 668 615 case WM_HITTEST: 669 616 { 670 OSLIBPOINT pt;671 672 pt.x = (*(POINTS *)&os2Msg->mp1).x;673 pt.y = (*(POINTS *)&os2Msg->mp1).y;674 675 mapOS2ToWin32Point(os2Msg->hwnd,OSLIB_HWND_DESKTOP,&pt);676 617 winMsg->message = WINWM_NCHITTEST; 677 618 winMsg->wParam = 0; 678 winMsg->lParam = MAKELONG( (USHORT)pt.x, (USHORT)pt.y);619 winMsg->lParam = MAKELONG(winMsg->pt.x,winMsg->pt.y); 679 620 break; 680 621 } -
trunk/src/user32/new/oslibwin.cpp
r2309 r2335 1 /* $Id: oslibwin.cpp,v 1.3 2 2000-01-03 20:53:50cbratschi Exp $ */1 /* $Id: oslibwin.cpp,v 1.33 2000-01-05 21:25:04 cbratschi Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 90 90 *hwndFrame = WinCreateWindow (hwndParent, 91 91 WC_FRAME, 92 pszName, dwWinStyle, 0, 0, 50, 30,92 pszName, dwWinStyle, 0, 0, 0, 0, 93 93 hwndParent, HWND_TOP, 94 94 id, &FCData, NULL); -
trunk/src/user32/new/pmframe.cpp
r2309 r2335 1 /* $Id: pmframe.cpp,v 1. 4 2000-01-03 20:53:50cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.5 2000-01-05 21:25:05 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 262 262 PSWP pswp = (PSWP)mp1,swpClient; 263 263 RECTL *client = (PRECTL)mp2,rect; 264 RECT winRect; 264 265 INT ccount; 265 266 … … 269 270 ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2); 270 271 SetWin32TIB(); 272 dprintf(("Frame size: %d %d",win32wnd->getWindowWidth(),win32wnd->getWindowHeight())); 273 win32wnd->MsgFormatFrame(); 274 //CB: todo: use result for WM_CALCVALIDRECTS 271 275 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 272 276 WinMapWindowPoints(WinQueryWindow(hwnd,QW_PARENT),hwnd,(PPOINTL)&rect,2); 273 //dprintf(("CB: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop));277 dprintf(("New client position: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop)); 274 278 swpClient = &pswp[ccount-1]; 275 279 swpClient->x = rect.xLeft; … … 339 343 else 340 344 { 341 dprintf((" USER32: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y));345 dprintf(("PMFRAME: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y)); 342 346 343 347 //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow … … 351 355 352 356 case WM_PAINT: 357 //CB: todo: call defframe if minimized 353 358 dprintf(("PMFRAME: WM_PAINT")); 354 359 if (win32wnd->IsWindowCreated()) … … 356 361 goto RunDefWndProc; 357 362 358 //CB: not yet checked 363 case WM_SIZE: 364 dprintf(("PMFRAME: WM_SIZE")); 365 goto RunDefFrameProc; 366 359 367 case WM_ADJUSTWINDOWPOS: 360 368 { … … 381 389 goto RunDefFrameProc; 382 390 383 if(!win32wnd->CanReceiveSizeMsgs()) { 384 //SvL: Doing this breaks button.exe, header4(a).exe & style.exe 385 // goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken 386 break; 387 } 391 if(!win32wnd->CanReceiveSizeMsgs()) 392 break; 388 393 389 394 WinQueryWindowPos(hwnd, &swpOld); … … 419 424 pswp->hwnd = hwnd; 420 425 421 // goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken422 426 RestoreOS2TIB(); 423 427 return (MRESULT)0xf; 424 428 } 425 goto RunDefFrameProc; //CB: must call def frame proc or frame control activation is broken429 goto RunDefFrameProc; 426 430 } 427 431 … … 434 438 435 439 dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 436 437 RestoreOS2TIB();438 rc = OldFrameProc(hwnd,msg,mp1,mp2);439 SetWin32TIB();440 440 441 441 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) … … 453 453 454 454 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 455 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 456 455 dprintf(("CB: %d %d %d %d",wp.x,wp.y,wp.x+wp.cx,wp.y+wp.cy)); 457 456 if(win32wnd->CanReceiveSizeMsgs()) 458 457 win32wnd->MsgPosChanged((LPARAM)&wp); 459 458 460 459 PosChangedEnd: 460 //calls WM_FORMATFRAME if SWP_SIZE is set 461 RestoreOS2TIB(); 462 rc = OldFrameProc(hwnd,msg,mp1,mp2); 463 SetWin32TIB(); 464 461 465 RestoreOS2TIB(); 462 466 return rc; -
trunk/src/user32/new/pmwindow.cpp
r2291 r2335 1 /* $Id: pmwindow.cpp,v 1.3 2 2000-01-01 17:07:42cbratschi Exp $ */1 /* $Id: pmwindow.cpp,v 1.33 2000-01-05 21:25:05 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 243 243 break; 244 244 245 #if 1246 245 case WM_ADJUSTWINDOWPOS: 247 { 248 // PSWP pswp = (PSWP)mp1; 249 250 // dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 251 goto RunDefWndProc; 252 } 253 #else 254 case WM_ADJUSTWINDOWPOS: 255 { 256 PSWP pswp = (PSWP)mp1; 257 SWP swpOld, swpNew; 258 WINDOWPOS wp; 259 ULONG parentHeight = 0; 260 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE, hwndAfter; 261 262 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 263 264 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;; 265 266 //SvL: TODO: Workaround. Why is this happening? 267 // When this flag is set the coordinates are 0, even though SWP_SIZE & SWP_MOVE are set. 268 // if ((pswp->fl & SWP_NOADJUST)) goto RunDefWndProc; 269 270 if(!win32wnd->CanReceiveSizeMsgs()) goto RunDefWndProc;; 271 272 WinQueryWindowPos(hwnd, &swpOld); 273 274 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 275 if (win32wnd->isChild()) { 276 if(win32wnd->getParent()) { 277 hParent = win32wnd->getParent()->getOS2WindowHandle(); 278 } 279 else goto RunDefWndProc;; 280 } 281 } 282 hwndAfter = pswp->hwndInsertBehind; 283 hFrame = win32wnd->getOS2FrameWindowHandle(); 284 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame); 285 286 wp.hwnd = win32wnd->getWindowHandle(); 287 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) 288 { 289 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 290 if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle(); 291 } 292 if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0) 293 {//app or default window handler changed wp 294 dprintf(("OS2: WM_ADJUSTWINDOWPOS, app changed windowpos struct")); 295 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 296 OSLibMapWINDOWPOStoSWP(&wp, &swpNew, &swpOld, hParent, hFrame); 297 dprintf(("%x (%d,%d), (%d,%d)", swpNew.fl, swpNew.x, swpNew.y, swpNew.cx, swpNew.cy)); 298 swpNew.fl |= SWP_NOADJUST; 299 swpNew.hwndInsertBehind = hwndAfter; 300 swpNew.hwnd = hFrame; 301 302 WinSetMultWindowPos(GetThreadHAB(), &swpNew, 1); 303 return (MRESULT)0; 304 } 305 break; 306 } 307 #endif 246 goto RunDefWndProc; 308 247 309 248 case WM_WINDOWPOSCHANGED: … … 584 523 585 524 win32wnd->setWindowRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 586 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy);525 //win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 587 526 wp.x = swpOld.x; 588 527 wp.y = swpOld.y; -
trunk/src/user32/new/user32.cpp
r2290 r2335 1 /* $Id: user32.cpp,v 1.2 3 2000-01-01 14:57:25cbratschi Exp $ */1 /* $Id: user32.cpp,v 1.24 2000-01-05 21:25:06 cbratschi Exp $ */ 2 2 3 3 /* … … 703 703 704 704 case SM_CXBORDER: 705 rc = 1;706 break;707 708 705 case SM_CYBORDER: 709 706 rc = 1; 707 break; 708 709 case SM_CXDLGFRAME: 710 case SM_CYDLGFRAME: 711 rc = 3; 712 break; 713 714 case SM_CYMENU: 715 case SM_CXMENUSIZE: 716 case SM_CYMENUSIZE: 717 rc = 19; 718 break; 719 720 case SM_CXSIZE: 721 case SM_CYSIZE: 722 rc = GetSystemMetrics(SM_CYCAPTION)-2; 723 break; 724 725 case SM_CXFRAME: 726 case SM_CYFRAME: 727 rc = 4; 728 break; 729 730 case SM_CXEDGE: 731 case SM_CYEDGE: 732 rc = 2; 733 break; 734 735 case SM_CXMINSPACING: 736 rc = 160; 737 break; 738 739 case SM_CYMINSPACING: 740 rc = 24; 741 break; 742 743 case SM_CXSMICON: 744 case SM_CYSMICON: 745 rc = 16; 746 break; 747 748 case SM_CYSMCAPTION: 749 rc = 16; 750 break; 751 752 case SM_CXSMSIZE: 753 case SM_CYSMSIZE: 754 rc = 15; 710 755 break; 711 756 … … 728 773 rc = FALSE; 729 774 break; 730 case SM_CXEDGE: //size of 3D window edge731 rc = 1;732 break;733 case SM_CYEDGE:734 rc = 1;735 break;736 case SM_CXMINSPACING: //can be SM_CXMINIMIZED or larger737 //CB: replace with const738 rc = O32_GetSystemMetrics(SM_CXMINIMIZED);739 break;740 case SM_CYMINSPACING:741 //CB: replace with const742 rc = GetSystemMetrics(SM_CYMINIMIZED);743 break;744 775 case SM_CXICON: 745 776 case SM_CYICON: 746 777 rc = 32; //CB: Win32: only 32x32, OS/2 32x32/40x40 747 778 // we must implement 32x32 for all screen resolutions 748 break;749 case SM_CXSMICON: //recommended size of small icons (TODO: adjust to screen res.)750 rc = 16;751 break;752 case SM_CYSMICON:753 rc = 16;754 break;755 case SM_CYSMCAPTION: //size in pixels of a small caption (TODO: ????)756 rc = 8;757 break;758 case SM_CXSMSIZE: //size of small caption buttons (pixels) (TODO: implement properly)759 rc = 16;760 break;761 case SM_CYSMSIZE:762 rc = 16;763 break;764 case SM_CXMENUSIZE: //TODO: size of menu bar buttons (such as MDI window close)765 rc = 16;766 break;767 case SM_CYMENUSIZE:768 rc = 16;769 779 break; 770 780 case SM_ARRANGE: -
trunk/src/user32/new/win32wbase.cpp
r2309 r2335 1 /* $Id: win32wbase.cpp,v 1.2 1 2000-01-03 20:53:50cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.22 2000-01-05 21:25:07 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 673 673 if ((dwStyle & (WS_CAPTION | WS_CHILD)) == WS_CAPTION ) 674 674 { 675 #if 0 //CB: todo 675 676 if (cs->hMenu) { 676 677 SetMenu(cs->hMenu); … … 682 683 } 683 684 } 685 #endif 684 686 } 685 687 else … … 697 699 rectWindow.top = cs->y; 698 700 rectWindow.bottom = cs->y+cs->cy; 699 rectClient = rectWindow; 700 if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2);701 rectClient = rectWindow; //dummy client rect 702 MapWindowPoints(getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,0,(PPOINT)&rectWindow,2); 701 703 /* Send the WM_CREATE message 702 704 * Perhaps we shouldn't allow width/height changes as well. … … 705 707 maxPos.x = rectWindow.left; maxPos.y = rectWindow.top; 706 708 707 //SetWindowPos(hwndLinkAfter,cs->x,cs->y,cs->cx,cs->cy,SWP_NOACTIVATE | SWP_NOREDRAW);708 709 709 //Note: Solitaire crashes when receiving WM_SIZE messages before WM_CREATE 710 fNoSizeMsg = FALSE;710 //fNoSizeMsg = FALSE; 711 711 fCreated = TRUE; 712 712 713 if (SendInternalMessageA(WM_NCCREATE, 0, (LPARAM)cs))713 if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs)) 714 714 { 715 715 RECT rect; … … 721 721 rectWindow.bottom = cs->y+cs->cy; 722 722 rectClient = rectWindow; 723 if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2); 724 SendNCCalcSize(FALSE, &rectWindow, NULL, NULL, 0, &rectClient ); 723 MapWindowPoints(getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,0,(PPOINT)&rectWindow,2); 725 724 OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top); 726 725 //set the window size and update the client 727 726 rect = rectWindow; 728 if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rect,2);727 MapWindowPoints(0,getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,(PPOINT)&rect,2); 729 728 SetWindowPos(hwndLinkAfter,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED); 729 fNoSizeMsg = FALSE; 730 730 if( (SendInternalMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 ) 731 731 { … … 737 737 } 738 738 739 if( getStyle() & WS_CHILD&& !(getExStyle() & WS_EX_NOPARENTNOTIFY) )739 if( (getStyle() & WS_CHILD) && !(getExStyle() & WS_EX_NOPARENTNOTIFY) ) 740 740 { 741 741 /* Notify the parent window only */ … … 886 886 ULONG Win32BaseWindow::MsgHitTest(MSG *msg) 887 887 { 888 lastHitTestVal = SendInternalMessageA(WM_NCHITTEST, 0, MAKELONG((USHORT)msg->pt.x, (USHORT)msg->pt.y));888 lastHitTestVal = SendInternalMessageA(WM_NCHITTEST,msg->wParam,msg->lParam); 889 889 dprintf2(("MsgHitTest returned %x", lastHitTestVal)); 890 890 … … 1110 1110 //****************************************************************************** 1111 1111 //****************************************************************************** 1112 ULONG Win32BaseWindow::MsgFormatFrame() 1113 { 1114 RECT window = rectWindow,client = rectClient,rect; 1115 WINDOWPOS wndPos; 1116 1117 wndPos.hwnd = Win32Hwnd; 1118 wndPos.hwndInsertAfter = 0; 1119 rect = rectWindow; 1120 MapWindowPoints(Win32Hwnd,(getParent()) ? getParent()->getWindowHandle():HWND_DESKTOP,(PPOINT)&rect,2); 1121 wndPos.x = rect.left; 1122 wndPos.y = rect.top; 1123 wndPos.cx = rect.right-rect.left; 1124 wndPos.cy = rect.bottom-rect.top; 1125 wndPos.flags = 0; 1126 1127 return SendNCCalcSize(TRUE,&window,&window,&client,&wndPos,&rectClient); 1128 } 1129 //****************************************************************************** 1130 //****************************************************************************** 1112 1131 ULONG Win32BaseWindow::MsgSetText(LPSTR lpsz, LONG cch) 1113 1132 { … … 1480 1499 1481 1500 /* Decide if the window will be managed (see CreateWindowEx) */ 1482 if (!WindowNeedsWMBorder())1501 //if (!WindowNeedsWMBorder()) //CB: check Options.managed 1483 1502 { 1484 1503 if (HAS_THICKFRAME(dwStyle,dwExStyle )) … … 1520 1539 //****************************************************************************** 1521 1540 //****************************************************************************** 1522 LONG Win32BaseWindow::HandleNCCalcSize(RECT *winRect) 1523 { 1524 RECT tmpRect = { 0, 0, 0, 0 }; 1525 LONG result = 0; 1526 UINT style = (UINT) GetClassLongA(Win32Hwnd,GCL_STYLE); 1541 LONG Win32BaseWindow::HandleNCCalcSize(BOOL calcValidRects,RECT *winRect) 1542 { 1543 RECT tmpRect = { 0, 0, 0, 0 },*clientRect; 1544 LONG result = WVR_ALIGNTOP | WVR_ALIGNLEFT; 1545 UINT style; 1546 1547 if (!calcValidRects) return 0; 1548 1549 style = (UINT) GetClassLongA(Win32Hwnd,GCL_STYLE); 1527 1550 1528 1551 if (style & CS_VREDRAW) result |= WVR_VREDRAW; 1529 1552 if (style & CS_HREDRAW) result |= WVR_HREDRAW; 1530 1553 1531 if( !( dwStyle & WS_MINIMIZE ) ) 1532 { 1533 AdjustRectOuter(&tmpRect,FALSE); 1534 1535 winRect->left -= tmpRect.left; 1536 winRect->top -= tmpRect.top; 1537 winRect->right -= tmpRect.right; 1538 winRect->bottom -= tmpRect.bottom; 1554 clientRect = &((NCCALCSIZE_PARAMS*)winRect)->rgrc[2]; 1555 clientRect->left = 0; 1556 clientRect->right = rectWindow.right-rectWindow.left; 1557 clientRect->top = 0; 1558 clientRect->bottom = rectWindow.bottom-rectWindow.top; 1559 mapWin32Rect(OS2HwndFrame,getParent() ? getParent()->getWindowHandle():OSLIB_HWND_DESKTOP,clientRect); 1560 1561 if(!(dwStyle & WS_MINIMIZE)) 1562 { 1563 AdjustRectOuter(&tmpRect,FALSE); //CB: todo: menu 1564 1565 clientRect->left -= tmpRect.left; 1566 clientRect->top -= tmpRect.top; 1567 clientRect->right -= tmpRect.right; 1568 clientRect->bottom -= tmpRect.bottom; 1539 1569 1540 1570 if (HAS_MENU(this)) … … 1550 1580 SetRect (&tmpRect, 0, 0, 0, 0); 1551 1581 AdjustRectInner(&tmpRect); 1552 winRect->left -= tmpRect.left;1553 winRect->top -= tmpRect.top;1554 winRect->right -= tmpRect.right;1555 winRect->bottom -= tmpRect.bottom;1582 clientRect->left -= tmpRect.left; 1583 clientRect->top -= tmpRect.top; 1584 clientRect->right -= tmpRect.right; 1585 clientRect->bottom -= tmpRect.bottom; 1556 1586 } 1557 1587 … … 1573 1603 if (HAS_THICKFRAME(dwStyle,dwExStyle)) 1574 1604 { 1575 InflateRect( &rect, -GetSystemMetrics(SM_CXFRAME), -GetSystemMetrics(SM_CYFRAME));1576 if (!PtInRect( &rect, pt))1605 InflateRect(&rect,-GetSystemMetrics(SM_CXFRAME),-GetSystemMetrics(SM_CYFRAME)); 1606 if (!PtInRect(&rect,pt)) 1577 1607 { 1578 1608 /* Check top sizing border */ … … 1605 1635 } 1606 1636 } 1607 } 1608 else /* No thick frame */ 1637 } else /* No thick frame */ 1609 1638 { 1610 1639 if (HAS_DLGFRAME(dwStyle,dwExStyle)) … … 1620 1649 { 1621 1650 if (dwExStyle & WS_EX_TOOLWINDOW) 1622 rect.top += GetSystemMetrics(SM_CYSMCAPTION) -1;1651 rect.top += GetSystemMetrics(SM_CYSMCAPTION)-1; 1623 1652 else 1624 rect.top += GetSystemMetrics(SM_CYCAPTION) -1;1625 if (!PtInRect( &rect, pt))1653 rect.top += GetSystemMetrics(SM_CYCAPTION)-1; 1654 if (!PtInRect(&rect,pt)) 1626 1655 { 1627 1656 /* Check system menu */ … … 1665 1694 1666 1695 ScreenToClient(Win32Hwnd,&pt); 1667 rect = rectClient;1696 getClientRect(&rect); 1668 1697 if (PtInRect(&rect,pt)) return HTCLIENT; 1669 1698 … … 2451 2480 2452 2481 case WM_NCCALCSIZE: 2453 return HandleNCCalcSize(( RECT*)lParam);2482 return HandleNCCalcSize((BOOL)wParam,(RECT*)lParam); 2454 2483 2455 2484 case WM_CTLCOLORMSGBOX: -
trunk/src/user32/new/win32wbase.h
r2312 r2335 1 /* $Id: win32wbase.h,v 1.1 6 2000-01-03 21:37:17 sandervlExp $ */1 /* $Id: win32wbase.h,v 1.17 2000-01-05 21:25:08 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 41 41 //PostThreadMessage is done through Open32; which means the message id will be translated 42 42 //(0xc00 added) 43 #define OPEN32_MSGDIFF 43 #define OPEN32_MSGDIFF 0xC00 44 44 #define WIN32APP_POSTMSG (0x1000+OPEN32_MSGDIFF) 45 45 … … 86 86 ULONG MsgHitTest(MSG *msg); 87 87 ULONG MsgNCPaint(); 88 ULONG MsgFormatFrame(); 88 89 ULONG DispatchMsgA(MSG *msg); 89 90 ULONG DispatchMsgW(MSG *msg); … … 138 139 { 139 140 *rect = rectClient; 140 rect Client.right -= rectClient.left;141 rect Client.bottom -= rectClient.top;142 rect Client.left = rectClient.top = 0;141 rect->right -= rect->left; 142 rect->bottom -= rect->top; 143 rect->left = rect->top = 0; 143 144 } 144 145 void setClientRect(PRECT rect) { rectClient = *rect; }; … … 164 165 HICON GetIcon() { return (HICON) iconResource; }; 165 166 166 167 HRGN GetWindowRegion(){ return hWindowRegion; };167 void SetWindowRegion(HRGN hRegion) { hWindowRegion = hRegion; }; 168 HRGN GetWindowRegion() { return hWindowRegion; }; 168 169 169 170 BOOL ShowWindow(ULONG nCmdShow); … … 318 319 BOOL fParentDC; 319 320 320 321 HRGN hWindowRegion; 321 322 322 323 DWORD dwThreadId; //id of thread that created this window … … 367 368 VOID AdjustRectOuter(LPRECT rect,BOOL menu); 368 369 VOID AdjustRectInner(LPRECT rect); 369 LONG HandleNCCalcSize( RECT *winRect);370 LONG HandleNCCalcSize(BOOL calcValidRects,RECT *winRect); 370 371 LONG HandleNCHitTest(POINT pt); 371 372 VOID GetInsideRect(RECT *rect); -
trunk/src/user32/new/win32wbasepos.cpp
r2292 r2335 1 /* $Id: win32wbasepos.cpp,v 1. 2 2000-01-02 19:30:45cbratschi Exp $ */1 /* $Id: win32wbasepos.cpp,v 1.3 2000-01-05 21:25:08 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (nonclient/position methods) … … 172 172 result = SendInternalMessageA(WM_NCCALCSIZE, calcValidRect, 173 173 (LPARAM)¶ms ); 174 *newClientRect = params.rgrc[0]; 174 if (calcValidRect) 175 { 176 /* If the application send back garbage, ignore it */ 177 if (params.rgrc[2].left <= params.rgrc[2].right && params.rgrc[2].top <= params.rgrc[2].bottom) 178 *newClientRect = params.rgrc[2]; 179 else 180 SetRectEmpty(newClientRect); 181 } 182 175 183 return result; 176 184 }
Note:
See TracChangeset
for help on using the changeset viewer.