Changeset 1408 for trunk/src/user32/pmwindow.cpp
- Timestamp:
- Oct 23, 1999, 12:21:45 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/pmwindow.cpp
r1405 r1408 1 /* $Id: pmwindow.cpp,v 1.4 0 1999-10-22 18:11:47sandervl Exp $ */1 /* $Id: pmwindow.cpp,v 1.41 1999-10-23 10:21:43 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 247 247 break; 248 248 249 #if 1 250 case WM_ADJUSTWINDOWPOS: 251 { 252 PSWP pswp = (PSWP)mp1; 253 SWP swpOld; 254 WINDOWPOS wp; 255 ULONG parentHeight = 0; 256 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE, hwndAfter; 257 258 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 259 260 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) goto RunDefWndProc;; 261 262 //SvL: TODO: Workaround. Why is this happening? 263 // When this flag is set the coordinates are 0, even though SWP_SIZE & SWP_MOVE are set. 264 // if ((pswp->fl & SWP_NOADJUST)) goto RunDefWndProc; 265 266 if(!win32wnd->CanReceiveSizeMsgs()) goto RunDefWndProc;; 267 268 WinQueryWindowPos(hwnd, &swpOld); 269 270 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 271 if (win32wnd->isChild()) { 272 if(win32wnd->getParent()) { 273 hParent = win32wnd->getParent()->getOS2WindowHandle(); 274 } 275 else goto RunDefWndProc;; 276 } 277 } 278 hwndAfter = pswp->hwndInsertBehind; 279 hFrame = win32wnd->getOS2FrameWindowHandle(); 280 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame); 281 282 wp.hwnd = win32wnd->getWindowHandle(); 283 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) 284 { 285 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 286 if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle(); 287 } 288 if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0) 289 {//app or default window handler changed wp 290 dprintf(("OS2: WM_ADJUSTWINDOWPOS, app changed windowpos struct")); 291 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 292 OSLibMapWINDOWPOStoSWP(&wp, pswp, &swpOld, hParent, hFrame); 293 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 294 pswp->fl |= SWP_NOADJUST; 295 pswp->hwndInsertBehind = hwndAfter; 296 pswp->hwnd = hFrame; 297 298 WinSetMultWindowPos(GetThreadHAB(), pswp, 1); 299 return (MRESULT)0; 300 } 301 break; 302 } 303 #endif 304 305 case WM_WINDOWPOSCHANGED: 306 { 307 PSWP pswp = (PSWP)mp1; 308 SWP swpOld = *(pswp + 1); 309 WINDOWPOS wp; 310 HWND hParent = NULLHANDLE; 311 LONG yDelta = pswp->cy - swpOld.cy; 312 LONG xDelta = pswp->cx - swpOld.cx; 313 314 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 315 316 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break; 317 if (!win32wnd->CanReceiveSizeMsgs()) break; 318 319 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 320 if (win32wnd->isChild()) { 321 if(win32wnd->getParent()) { 322 hParent = win32wnd->getParent()->getOS2WindowHandle(); 323 } 324 else goto RunDefWndProc; //parent has just been destroyed 325 } 326 } 327 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hwnd); 328 329 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 330 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 331 332 wp.hwnd = win32wnd->getWindowHandle(); 333 if ((pswp->fl & SWP_ZORDER) && (pswp->hwndInsertBehind > HWND_BOTTOM)) 334 { 335 Win32BaseWindow *wndAfter = Win32BaseWindow::GetWindowFromOS2Handle(pswp->hwndInsertBehind); 336 wp.hwndInsertAfter = wndAfter->getWindowHandle(); 337 } 338 339 if (yDelta != 0 || xDelta != 0) 340 { 341 HENUM henum = WinBeginEnumWindows(pswp->hwnd); 342 SWP swp[10]; 343 int i = 0; 344 HWND hwnd; 345 346 while ((hwnd = WinGetNextWindow(henum)) != NULLHANDLE) 347 { 348 #if 0 349 if (mdiClient ) 350 { 351 continue; 352 } 353 #endif 354 WinQueryWindowPos(hwnd, &(swp[i])); 355 356 #ifdef DEBUG 357 Win32BaseWindow *window = Win32BaseWindow::GetWindowFromOS2Handle(hwnd); 358 dprintf(("ENUMERATE %x delta %d (%d,%d) (%d,%d) %x", (window) ? window->getWindowHandle() : hwnd, 359 yDelta, swp[i].x, swp[i].y, swp[i].cx, swp[i].cy, swp[i].fl)); 360 #endif 361 362 if(swp[i].y != 0) { 363 //child window at offset <> 0 from client area -> offset now changes 364 swp[i].y += yDelta; 365 swp[i].fl &= ~(SWP_NOREDRAW); 366 } 367 //else child window with the same start coorindates as the client area 368 //The app should resize it. 369 370 if (i == 9) 371 { 372 WinSetMultWindowPos(GetThreadHAB(), swp, 10); 373 i = 0; 374 } 375 else 376 { 377 i++; 378 } 379 } 380 381 WinEndEnumWindows(henum); 382 383 if (i) 384 WinSetMultWindowPos(GetThreadHAB(), swp, i); 385 } 386 if (yDelta != 0) 387 { 388 POINT pt; 389 if(GetCaretPos (&pt) == TRUE) 390 { 391 pt.y -= yDelta; 392 SetCaretPos (pt.x, pt.y); 393 } 394 } 395 win32wnd->MsgPosChanged((LPARAM)&wp); 396 397 goto RunDefWndProc; 398 } 399 249 400 case WM_SIZE: 250 401 {
Note:
See TracChangeset
for help on using the changeset viewer.