Changeset 2415 for trunk/src/user32/new/pmframe.cpp
- Timestamp:
- Jan 12, 2000, 1:41:20 PM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/new/pmframe.cpp (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/pmframe.cpp
r2400 r2415 1 /* $Id: pmframe.cpp,v 1.1 0 2000-01-10 23:29:13sandervl Exp $ */1 /* $Id: pmframe.cpp,v 1.11 2000-01-12 12:40:45 sandervl Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 107 107 { 108 108 case WM_FORMATFRAME: 109 { 110 PSWP pswp = (PSWP)mp1,swpClient; 111 RECTL *client = (PRECTL)mp2,rect; 112 RECT winRect; 113 INT ccount; 114 115 if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc; 116 dprintf(("PMFRAME: WM_FORMATFRAME %x",hwnd)); 117 RestoreOS2TIB(); 118 ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2); 119 SetWin32TIB(); 120 dprintf(("Frame size: %d %d",win32wnd->getWindowWidth(),win32wnd->getWindowHeight())); 121 win32wnd->MsgFormatFrame(); 122 //CB: todo: use result for WM_CALCVALIDRECTS 123 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 124 swpClient = &pswp[ccount-1]; 125 swpClient->x = rect.xLeft; 126 swpClient->y = rect.yBottom; 127 swpClient->cx = rect.xRight-rect.xLeft; 128 swpClient->cy = rect.yTop-rect.yBottom; 129 dprintf(("New client position: x=%d y=%d w=%d h=%d",swpClient->x,swpClient->y,swpClient->cx,swpClient->cy)); 130 RestoreOS2TIB(); 131 return (MRESULT)ccount; 132 } 109 break; 133 110 134 111 case WM_MINMAXFRAME: … … 141 118 { 142 119 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W); 143 } else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE) 120 } 121 else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE) 144 122 { 145 123 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MAXIMIZE_W) | WS_MINIMIZE_W); 146 } else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE) 124 } 125 else if ((swp->fl & SWP_RESTORE) == SWP_RESTORE) 147 126 { 148 127 win32wnd->setStyle(win32wnd->getStyle() & ~(WS_MINIMIZE_W | WS_MAXIMIZE_W)); … … 277 256 WINDOWPOS wp; 278 257 HWND hParent = NULLHANDLE; 258 RECTL rect; 259 SWP swpClient = {0}; 279 260 280 261 dprintf(("PMFRAME: WM_WINDOWPOSCHANGED (%x) %x %x (%d,%d) (%d,%d)", mp2, win32wnd->getWindowHandle(), pswp->fl, pswp->x, pswp->y, pswp->cx, pswp->cy)); 281 262 282 263 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) 283 goto PosChangedEnd; 264 { 265 swpClient.hwnd = win32wnd->getOS2WindowHandle(); 266 swpClient.hwndInsertBehind = 0; 267 swpClient.x = 0; 268 swpClient.y = 0; 269 swpClient.cx = 0; 270 swpClient.cy = 0; 271 swpClient.fl = pswp->fl & ~SWP_ZORDER; 272 WinSetMultWindowPos(thdb->hab, &swpClient, 1); 273 goto PosChangedEnd; 274 } 284 275 285 276 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { … … 293 284 OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd); 294 285 295 win32wnd->setWindowRect(wp.x, wp.y, wp.x+wp.cx, wp.y+wp.cy); 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 } 296 303 297 304 if(win32wnd->CanReceiveSizeMsgs()) 298 305 win32wnd->MsgPosChanged((LPARAM)&wp); 299 306 307 //update child positions: rectWindow is in window coordinates 308 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { 309 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 310 } 311 300 312 PosChangedEnd: 301 //update the client rect302 RECTL rectl;303 304 WinQueryWindowRect(win32wnd->getOS2FrameWindowHandle(),&rectl);305 mapOS2ToWin32Rect(win32wnd->getOS2FrameWindowHandle(),OSLIB_HWND_DESKTOP,(PRECTLOS2)&rectl,win32wnd->getWindowRect());306 WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl);307 mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr());308 309 //calls WM_FORMATFRAME if SWP_SIZE is set310 313 RestoreOS2TIB(); 311 rc = OldFrameProc(hwnd,msg,mp1,mp2); 312 SetWin32TIB(); 313 //update child positions: rectWindow is in window coordinates 314 FrameUpdateChildPositions(win32wnd->getOS2WindowHandle()); 315 RestoreOS2TIB(); 316 return rc; 314 return (MRESULT)FALSE; 317 315 } 318 316 … … 320 318 { 321 319 PRECTL oldRect = (PRECTL)mp1,newRect = oldRect+1; 322 UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP;320 UINT res = 0; //= CVR_ALIGNLEFT | CVR_ALIGNTOP; 323 321 324 322 //CB: todo: use WM_NCCALCSIZE result … … 334 332 335 333 //CB: PM sets client window position 336 RestoreOS2TIB();337 OldFrameProc(hwnd,msg,mp1,mp2);338 SetWin32TIB();334 // RestoreOS2TIB(); 335 // OldFrameProc(hwnd,msg,mp1,mp2); 336 // SetWin32TIB(); 339 337 340 338 RestoreOS2TIB();
Note:
See TracChangeset
for help on using the changeset viewer.
