Changeset 2377 for trunk/src/user32/new/pmframe.cpp
- Timestamp:
- Jan 8, 2000, 5:47:50 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/pmframe.cpp
r2353 r2377 1 /* $Id: pmframe.cpp,v 1. 7 2000-01-07 17:38:47 cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.8 2000-01-08 16:47:47 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 210 210 } 211 211 //****************************************************************************** 212 //****************************************************************************** 213 VOID FrameUpdateChildPositions(HWND hwnd) 214 { 215 HENUM henum; 216 HWND hchild; 217 RECTL rectl; 218 219 henum = WinBeginEnumWindows(hwnd); 220 while ((hchild = WinGetNextWindow(henum)) != NULLHANDLE) 221 { 222 Win32BaseWindow *child = Win32BaseWindow::GetWindowFromOS2FrameHandle(hchild); 223 224 if (child) 225 { 226 WinQueryWindowRect(child->getOS2FrameWindowHandle(),&rectl); 227 mapOS2ToWin32Rect(child->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,child->getWindowRect()); 228 FrameUpdateChildPositions(child->getOS2WindowHandle()); 229 } 230 } 231 WinEndEnumWindows(henum); 232 } 233 //****************************************************************************** 212 234 //Win32 frame message handler 213 235 //****************************************************************************** … … 273 295 win32wnd->MsgFormatFrame(); 274 296 //CB: todo: use result for WM_CALCVALIDRECTS 275 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 276 WinMapWindowPoints(WinQueryWindow(hwnd,QW_PARENT),hwnd,(PPOINTL)&rect,2); 277 dprintf(("New client position: %d %d %d %d",rect.xLeft,rect.yBottom,rect.xRight,rect.yTop)); 297 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 278 298 swpClient = &pswp[ccount-1]; 279 299 swpClient->x = rect.xLeft; … … 281 301 swpClient->cx = rect.xRight-rect.xLeft; 282 302 swpClient->cy = rect.yTop-rect.yBottom; 303 dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy)); 283 304 RestoreOS2TIB(); 284 305 return (MRESULT)ccount; … … 286 307 287 308 case WM_MINMAXFRAME: 309 { 310 PSWP swp = (PSWP)mp1; 311 312 if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc; 288 313 dprintf(("PMFRAME: WM_MINMAXFRAME %x",hwnd)); 289 //CB: todo 314 if ((swp->fl & SWP_MAXIMIZE) == SWP_MAXIMIZE) 315 { 316 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W); 317 } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE) 318 { 319 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W); 320 } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE) 321 { 322 win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W)); 323 } 290 324 goto RunDefFrameProc; 325 } 291 326 292 327 case WM_QUERYBORDERSIZE: … … 303 338 case WM_BUTTON3DBLCLK: 304 339 { 305 SWP swp;306 307 WinQueryWindowPos(hwnd,&swp);308 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)309 goto RunDefFrameProc;310 340 if (win32wnd->IsWindowCreated()) 311 341 { … … 330 360 case WM_MOUSEMOVE: 331 361 { 332 SWP swp;333 334 WinQueryWindowPos(hwnd,&swp);335 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)336 goto RunDefFrameProc;337 362 //OS/2 Window coordinates -> Win32 Window coordinates 338 363 if (win32wnd->IsWindowCreated()) … … 345 370 { 346 371 DWORD res; 347 SWP swp;348 349 WinQueryWindowPos(hwnd,&swp);350 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)351 goto RunDefFrameProc;352 372 353 373 // Only send this message if the window is enabled … … 373 393 case WM_PAINT: 374 394 { 375 SWP swp;376 377 WinQueryWindowPos(hwnd,&swp);378 if ((swp.fl & SWP_MINIMIZE) == SWP_MINIMIZE)379 goto RunDefFrameProc;380 395 dprintf(("PMFRAME: WM_PAINT")); 396 if (win32wnd->getStyle() & WS_MINIMIZE_W) 397 goto RunDefFrameProc; 381 398 if (win32wnd->IsWindowCreated()) 382 399 win32wnd->MsgNCPaint(); … … 416 433 417 434 WinQueryWindowPos(hwnd, &swpOld); 418 419 435 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 420 436 if (win32wnd->isChild()) { … … 484 500 RECTL rectl; 485 501 502 WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl); 503 mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect()); 486 504 WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl); 487 505 mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr()); … … 490 508 RestoreOS2TIB(); 491 509 rc = OldFrameProc(hwnd,msg,mp1,mp2); 510 SetWin32TIB(); 511 //update child positions: rectWindow is in window coordinates 512 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 513 RestoreOS2TIB(); 492 514 return rc; 493 515 }
Note:
See TracChangeset
for help on using the changeset viewer.