Changeset 1376 for trunk/src/user32/pmwindow.cpp
- Timestamp:
- Oct 20, 1999, 3:46:29 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/pmwindow.cpp
r1354 r1376 1 /* $Id: pmwindow.cpp,v 1.3 6 1999-10-19 12:32:13 dengertExp $ */1 /* $Id: pmwindow.cpp,v 1.37 1999-10-20 13:46:26 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Window Managment Code for OS/2 … … 22 22 #include <win32wbase.h> 23 23 #include <win32dlg.h> 24 #include "win32wdesktop.h" 24 25 #include "pmwindow.h" 25 26 #include "oslibwin.h" … … 251 252 SWP swpOld; 252 253 WINDOWPOS wp; 253 ULONG parentHeight = 0;254 ULONG parentHeight = 0; 254 255 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; 255 256 256 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x (%d,%d) (%d,%d)",hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy));257 dprintf(("OS2: WM_ADJUSTWINDOWPOS %x %x %x (%d,%d) (%d,%d)", hwnd, pswp->hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 257 258 258 259 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break; 259 if (!win32wnd->CanReceiveSizeMsgs())break;260 if(!win32wnd->CanReceiveSizeMsgs()) break; 260 261 261 262 WinQueryWindowPos(hwnd, &swpOld); … … 268 269 else break; 269 270 } 270 else 271 hFrame = win32wnd->getOS2FrameWindowHandle(); 272 } 271 } 272 hFrame = win32wnd->getOS2FrameWindowHandle(); 273 273 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame); 274 274 … … 279 279 if(wndAfter) wp.hwndInsertAfter = wndAfter->getWindowHandle(); 280 280 } 281 win32wnd->MsgPosChanging((LPARAM)&wp); 281 if(win32wnd->MsgPosChanging((LPARAM)&wp) == 0) 282 {//app or default window handler changed wp 283 dprintf(("OS2: WM_ADJUSTWINDOWPOS, app changed windowpos struct")); 284 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 285 OSLibMapWINDOWPOStoSWP(&wp, pswp, &swpOld, hParent, hFrame); 286 dprintf(("%x (%d,%d), (%d,%d)", pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 287 //TODO: What should we return here? 0 means no changes, but the AWP flags 288 // aren't very useful either 289 } 282 290 break; 283 291 } … … 285 293 case WM_WINDOWPOSCHANGED: 286 294 { 287 PSWP pswp = (PSWP)mp1;288 PSWP pswpo = pswp + 1;295 PSWP pswp = (PSWP)mp1; 296 SWP swpOld = *(pswp + 1); 289 297 WINDOWPOS wp; 290 298 ULONG parentHeight = 0; 291 299 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; 292 LONG yDelta = pswp->cy - pswpo->cy; 293 LONG xDelta = pswp->cx - pswpo->cx; 294 ULONG classStyle; 300 LONG yDelta = pswp->cy - swpOld.cy; 301 LONG xDelta = pswp->cx - swpOld.cx; 295 302 296 303 dprintf(("OS2: WM_WINDOWPOSCHANGED %x %x (%d,%d) (%d,%d)", hwnd, pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 297 304 298 305 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) break; 299 if (!win32wnd->CanReceiveSizeMsgs())break;306 if(!win32wnd->CanReceiveSizeMsgs()) break; 300 307 301 308 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { … … 306 313 else goto RunDefWndProc; //parent has just been destroyed 307 314 } 308 else 309 hFrame = WinQueryWindow(hwnd, QW_PARENT); 310 } 311 OSLibMapSWPtoWINDOWPOS(pswp, &wp, pswpo, hParent, hFrame); 312 313 SWP swpFrame; 314 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swpFrame); 315 dprintf(("WINDOWPOSCHANGE %x %x %x (%d,%d) (%d,%d)", win32wnd->getWindowHandle(), win32wnd->getOS2FrameWindowHandle(), 316 swpFrame.fl,swpFrame.x, swpFrame.y, swpFrame.cx, swpFrame.cy)); 317 POINTL point; 318 319 point.x = swpFrame.x; 320 point.y = swpFrame.y; 321 if(win32wnd->getParent() != NULL) 322 { 323 WinMapWindowPoints(WinQueryWindow(hwnd, QW_PARENT), HWND_DESKTOP, 324 &point, 1); 325 } 326 point.y = OSLibQueryScreenHeight() - point.y - swpFrame.cy; 327 328 win32wnd->setWindowRect(point.x, point.y, point.x+swpFrame.cx, point.y+swpFrame.cy); 329 win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy); 315 } 316 hFrame = WinQueryWindow(hwnd, QW_PARENT); 317 OSLibMapSWPtoWINDOWPOS(pswp, &wp, &swpOld, hParent, hFrame); 318 319 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 320 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 330 321 331 322 wp.hwnd = win32wnd->getWindowHandle(); … … 335 326 wp.hwndInsertAfter = wndAfter->getWindowHandle(); 336 327 } 337 classStyle = win32wnd->getClass()->getStyle();338 328 339 329 if (yDelta != 0 || xDelta != 0) … … 395 385 win32wnd->MsgPosChanged((LPARAM)&wp); 396 386 397 goto RunDefWndProc; 398 // break; 387 goto RunDefWndProc; 399 388 } 400 389 … … 611 600 break; 612 601 } 613 614 //**************************************************************************615 //Slider messages616 //**************************************************************************617 /* CB: handled internally618 case WM_VSCROLL:619 case WM_HSCROLL:620 {621 ULONG scrollPos, scrollCode, scrollMsg;622 623 scrollCode = SHORT2FROMMP(mp2);624 scrollPos = SHORT1FROMMP(mp2);625 scrollMsg = msg;626 627 OSLibTranslateScrollCmdAndMsg(&scrollMsg, &scrollCode);628 629 if(win32wnd->MsgScroll(scrollMsg, scrollCode, scrollPos)) {630 goto RunDefWndProc;631 }632 break;633 }634 */635 602 636 603 case WM_CONTROL: … … 853 820 win32wnd->setEraseBkgnd (!erased, !erased); 854 821 } 822 855 823 break; 856 824 } … … 860 828 861 829 if (WinQueryUpdateRect (hwnd, NULL)) { 862 if ( win32wnd->isEraseBkgnd() &&!win32wnd->isSupressErase()) {830 if (!win32wnd->isSupressErase()) { 863 831 BOOL erased = sendEraseBkgnd (win32wnd); 864 832 win32wnd->setEraseBkgnd (!erased, !erased); … … 939 907 { 940 908 PSWP pswp = (PSWP)mp1; 941 PSWP pswpo = pswp + 1;909 SWP swpOld = *(pswp + 1); 942 910 WINDOWPOS wp; 943 911 HWND hParent = NULLHANDLE, hFrame = NULLHANDLE; … … 948 916 hFrame = WinQueryWindow(hwnd, QW_PARENT); 949 917 950 OSLibMapSWPtoWINDOWPOS(pswp,&wp,pswpo,hParent,hFrame); 951 952 SWP swpFrame; 953 WinQueryWindowPos(WinQueryWindow(hwnd, QW_PARENT), &swpFrame); 954 POINTL point; 955 956 point.x = swpFrame.x; 957 point.y = swpFrame.y; 958 WinMapWindowPoints(WinQueryWindow(hwnd, QW_PARENT), HWND_DESKTOP, 959 &point, 1); 960 point.y = OSLibQueryScreenHeight() - point.y - swpFrame.cy; 961 962 win32wnd->setWindowRect(point.x, point.y, point.x+swpFrame.cx, point.y+swpFrame.cy); 963 win32wnd->setClientRect(pswpo->x, pswpo->y, pswpo->x + pswpo->cx, pswpo->y + pswpo->cy); 918 OSLibMapSWPtoWINDOWPOS(pswp,&wp, &swpOld,hParent,hFrame); 919 920 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 921 win32wnd->setClientRect(swpOld.x, swpOld.y, swpOld.x + swpOld.cx, swpOld.y + swpOld.cy); 964 922 965 923 win32wnd->MsgPosChanged((LPARAM)&wp);
Note:
See TracChangeset
for help on using the changeset viewer.