- Timestamp:
- Jan 12, 2000, 11:07:28 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/pmframe.cpp
r2421 r2425 1 /* $Id: pmframe.cpp,v 1.1 3 2000-01-12 17:37:29cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.14 2000-01-12 22:07:28 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 212 212 if(!win32wnd->CanReceiveSizeMsgs()) 213 213 break; 214 214 //CB: todo: adjust maximized window rect (how does WINE it?) 215 215 WinQueryWindowPos(hwnd, &swpOld); 216 216 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { … … 252 252 case WM_WINDOWPOSCHANGED: 253 253 { 254 PSWP pswp = (PSWP)mp1 ;254 PSWP pswp = (PSWP)mp1,pswpOld = pswp+1; 255 255 SWP swpOld = *(pswp + 1); 256 256 WINDOWPOS wp; … … 284 284 OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd); 285 285 286 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 287 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 288 289 win32wnd->MsgFormatFrame(); 290 //CB: todo: use result for WM_CALCVALIDRECTS 291 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 292 293 swpClient.hwnd = win32wnd->getOS2WindowHandle(); 294 swpClient.hwndInsertBehind = 0; 295 swpClient.x = rect.xLeft; 296 swpClient.y = rect.yBottom; 297 swpClient.cx = rect.xRight-rect.xLeft; 298 swpClient.cy = rect.yTop-rect.yBottom; 299 //TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now 300 swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW; 301 WinSetMultWindowPos(thdb->hab, &swpClient, 1); 302 } 303 304 if(win32wnd->CanReceiveSizeMsgs()) 305 win32wnd->MsgPosChanged((LPARAM)&wp); 306 307 //update child positions: rectWindow is in window coordinates 308 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 309 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 286 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) 287 { 288 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 289 290 win32wnd->MsgFormatFrame(); 291 //CB: todo: use result for WM_CALCVALIDRECTS 292 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 293 294 swpClient.hwnd = win32wnd->getOS2WindowHandle(); 295 swpClient.hwndInsertBehind = 0; 296 swpClient.x = rect.xLeft; 297 swpClient.y = rect.yBottom; 298 swpClient.cx = rect.xRight-rect.xLeft; 299 swpClient.cy = rect.yTop-rect.yBottom; 300 //TODO: Get rid of SWP_SHOW; needed for winhlp32 button bar for now 301 swpClient.fl = (pswp->fl & ~SWP_ZORDER) | SWP_MOVE | SWP_SHOW; 302 WinSetMultWindowPos(thdb->hab, &swpClient, 1); 303 304 //update child positions: rectWindow is in window coordinates 305 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 306 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 307 } 308 309 if(win32wnd->CanReceiveSizeMsgs()) 310 win32wnd->MsgPosChanged((LPARAM)&wp); 311 312 if ((pswp->fl & SWP_SIZE) && ((pswp->cx != pswpOld->cx) || (pswp->cy != pswpOld->cy))) 313 { 314 //redraw the frame (to prevent unnecessary client updates) 315 BOOL redrawAll = FALSE; 316 317 if (win32wnd->getWindowClass()) 318 { 319 DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W); 320 321 if ((dwStyle & CS_HREDRAW_W) && (pswp->cx != pswpOld->cx)) 322 redrawAll = TRUE; 323 else if ((dwStyle & CS_VREDRAW_W) && (pswp->cy != pswpOld->cy)) 324 redrawAll = TRUE; 325 } else redrawAll = TRUE; 326 327 if (redrawAll) 328 { 329 WinInvalidateRect(hwnd,NULL,TRUE); 330 } else 331 { 332 HPS hps = WinGetPS(hwnd); 333 RECTL frame,client,arcl[4]; 334 335 WinQueryWindowRect(hwnd,&frame); 336 //top 337 arcl[0].xLeft = 0; 338 arcl[0].xRight = frame.xRight; 339 arcl[0].yBottom = rect.yTop; 340 arcl[0].yTop = frame.yTop; 341 //right 342 arcl[1].xLeft = rect.xRight; 343 arcl[1].xRight = frame.xRight; 344 arcl[1].yBottom = 0; 345 arcl[1].yTop = frame.yTop; 346 //left 347 arcl[2].xLeft = 0; 348 arcl[2].xRight = rect.xLeft; 349 arcl[2].yBottom = 0; 350 arcl[2].yTop = frame.yTop; 351 //bottom 352 arcl[3].xLeft = 0; 353 arcl[3].xRight = frame.xRight; 354 arcl[3].yBottom = 0; 355 arcl[3].yTop = rect.yBottom; 356 357 HRGN hrgn = GpiCreateRegion(hps,3,(PRECTL)&arcl); 358 359 WinInvalidateRegion(hwnd,hrgn,FALSE); 360 GpiDestroyRegion(hps,hrgn); 361 WinReleasePS(hps); 362 } 363 } 364 } else 365 { 366 //update child positions: rectWindow is in window coordinates 367 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 368 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 369 } 370 371 if(win32wnd->CanReceiveSizeMsgs()) 372 win32wnd->MsgPosChanged((LPARAM)&wp); 310 373 } 311 374 … … 317 380 case WM_CALCVALIDRECTS: 318 381 { 382 //don't redraw here or PM redraw the whole frame (done in WM_WINDOWPOSCHANGED) 319 383 RestoreOS2TIB(); 320 return (MRESULT) CVR_REDRAW; //always redraw frame384 return (MRESULT)(CVR_ALIGNLEFT | CVR_ALIGNTOP); 321 385 } 322 386 -
trunk/src/user32/new/pmwindow.cpp
r2422 r2425 1 /* $Id: pmwindow.cpp,v 1.3 8 2000-01-12 19:43:58 sandervlExp $ */1 /* $Id: pmwindow.cpp,v 1.39 2000-01-12 22:07:28 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 295 295 } 296 296 297 #if 0298 297 case WM_CALCVALIDRECTS: 299 {300 PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1;301 UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP;302 303 //CB: todo: use WM_NCCALCSIZE result304 if (win32wnd->getWindowClass())305 {306 DWORD dwStyle = win32wnd->getWindowClass()->getClassLongA(GCL_STYLE_W);307 308 if ((dwStyle & CS_HREDRAW_W) && (newRect->xRight-newRect->xLeft != oldRect->xRight-oldRect->xLeft))309 res |= CVR_REDRAW;310 else if ((dwStyle & CS_VREDRAW_W) && (newRect->yTop-newRect->yBottom != oldRect->yTop-oldRect->yBottom))311 res |= CVR_REDRAW;312 } else res |= CVR_REDRAW;313 314 298 RestoreOS2TIB(); 315 WinDefWindowProc(hwnd,msg,mp1,mp2); 316 RestoreOS2TIB(); 317 return (MRESULT)res; 318 } 319 #endif 299 return (MRESULT)(CVR_ALIGNLEFT | CVR_ALIGNTOP); 320 300 321 301 case WM_SETFOCUS: … … 440 420 { 441 421 dprintf(("OS2: WM_ERASEBACKGROUND %x", win32wnd->getWindowHandle())); 442 break; 422 RestoreOS2TIB(); 423 return (MRESULT)FALSE; 443 424 } 444 425
Note:
See TracChangeset
for help on using the changeset viewer.