Changeset 2291 for trunk/src/user32/new/pmframe.cpp
- Timestamp:
- Jan 1, 2000, 6:07:42 PM (26 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/pmframe.cpp
r2290 r2291 1 /* $Id: pmframe.cpp,v 1. 1 2000-01-01 14:57:21cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.2 2000-01-01 17:07:42 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 215 215 PFNWP OldFrameProc; 216 216 MRESULT rc; 217 THDB *thdb; 218 MSG *pWinMsg; 217 219 218 220 SetWin32TIB(); 219 221 222 thdb = GetThreadTHDB(); 220 223 win32wnd = Win32BaseWindow::GetWindowFromOS2FrameHandle(hwnd); 221 224 222 if (win32wnd == NULL|| !win32wnd->getOldFrameProc())225 if (!thdb || (win32wnd == NULL) || !win32wnd->getOldFrameProc()) 223 226 { 224 227 dprintf(("Invalid win32wnd pointer for frame %x!!", hwnd)); 225 228 goto RunDefWndProc; 226 229 } 230 pWinMsg = &thdb->msg; 227 231 228 232 OldFrameProc = (PFNWP)win32wnd->getOldFrameProc(); … … 231 235 { 232 236 case WM_FORMATFRAME: 237 { 238 RECTL *client; 239 233 240 dprintf(("PMFRAME: WM_FORMATFRAME %x",hwnd)); 234 //CB: call WM_NCCALCSIZE and set client pos 235 // WM_PAINT -> WM_NCPAINT 236 // WM_HITTEST -> MsgHitTest() 237 // mouse messages -> MsgButton() 241 client = (PRECTL)mp2; 242 #if 0 243 //CB: todo: client rect is wrong/not set with WM_NCCALCSIZE 244 mapWin32ToOS2Rect(hwnd,win32wnd->getClientRectPtr(),(PRECTLOS2)client); 245 246 RestorOS2TIB(); 247 return (MRESULT)1; 248 #else 238 249 goto RunDefFrameProc; 250 #endif 251 } 252 253 case WM_MINMAXFRAME: 254 dprintf(("PMFRAME: WM_MINMAXFRAME %x",hwnd)); 255 //CB: todo 256 goto RunDefFrameProc; 239 257 240 258 case WM_QUERYBORDERSIZE: 241 //CB: todo: set to 0242 259 goto RunDefFrameProc; 243 260 261 case WM_BUTTON1DOWN: 262 case WM_BUTTON1UP: 263 case WM_BUTTON1DBLCLK: 264 case WM_BUTTON2DOWN: 265 case WM_BUTTON2UP: 266 case WM_BUTTON2DBLCLK: 267 case WM_BUTTON3DOWN: 268 case WM_BUTTON3UP: 269 case WM_BUTTON3DBLCLK: 270 win32wnd->MsgButton(pWinMsg); 271 RestoreOS2TIB(); 272 return (MRESULT)TRUE; 273 274 case WM_BUTTON2MOTIONSTART: 275 case WM_BUTTON2MOTIONEND: 276 case WM_BUTTON2CLICK: 277 case WM_BUTTON1MOTIONSTART: 278 case WM_BUTTON1MOTIONEND: 279 case WM_BUTTON1CLICK: 280 case WM_BUTTON3MOTIONSTART: 281 case WM_BUTTON3MOTIONEND: 282 case WM_BUTTON3CLICK: 283 RestoreOS2TIB(); 284 return (MRESULT)TRUE; 285 286 case WM_MOUSEMOVE: 287 { 288 //OS/2 Window coordinates -> Win32 Window coordinates 289 win32wnd->MsgMouseMove(pWinMsg); 290 RestoreOS2TIB(); 291 return (MRESULT)TRUE; 292 } 293 294 case WM_HITTEST: 295 { 296 DWORD res; 297 298 // Only send this message if the window is enabled 299 if (!WinIsWindowEnabled(hwnd)) 300 res = HT_ERROR; 301 else if (win32wnd->getIgnoreHitTest()) 302 res = HT_NORMAL; 303 else 304 { 305 dprintf(("USER32: WM_HITTEST %x (%d,%d)",hwnd,(*(POINTS *)&mp1).x,(*(POINTS *)&mp1).y)); 306 307 //CB: WinWindowFromPoint: PM sends WM_HITTEST -> loop -> stack overflow 308 win32wnd->setIgnoreHitTest(TRUE); 309 res = win32wnd->MsgHitTest(pWinMsg); 310 win32wnd->setIgnoreHitTest(FALSE); 311 } 312 RestoreOS2TIB(); 313 return (MRESULT)res; 314 } 315 316 case WM_PAINT: 317 win32wnd->DispatchMsgA(pWinMsg); 318 goto RunDefWndProc; 319 320 //CB: not yet checked 244 321 case WM_ADJUSTWINDOWPOS: 245 322 { … … 399 476 400 477 case WM_DESTROY: 401 #ifdef PMFRAMELOG 402 dprintf(("PMFRAME: WM_DESTROY")); 403 #endif 478 dprintf(("PMFRAME: WM_DESTROY %x",hwnd)); 404 479 WinSubclassWindow(hwnd,OldFrameProc); 405 480 win32wnd->setOldFrameProc(NULL); 406 481 goto RunDefFrameProc; 407 408 case WM_MOUSEMOVE:409 if (InSizeBox(win32wnd,(POINTS*)&mp1))410 {411 WinSetPointer(HWND_DESKTOP,WinQuerySysPointer(HWND_DESKTOP,SPTR_SIZENWSE,FALSE));412 RestoreOS2TIB();413 return (MRESULT)TRUE;414 }415 else if (win32wnd->isChild()) goto RunDefWndProc;416 else goto RunDefFrameProc;417 418 case WM_BUTTON1DOWN:419 #ifdef PMFRAMELOG420 dprintf(("PMFRAME: WM_BUTTON1DOWN"));421 #endif422 423 if (InSizeBox(win32wnd,(POINTS*)&mp1))424 {425 WinSetActiveWindow(HWND_DESKTOP,hwnd);426 WinSendMsg(hwnd,WM_TRACKFRAME,(MPARAM)(TF_RIGHT | TF_BOTTOM),(MPARAM)0);427 RestoreOS2TIB();428 return (MRESULT)TRUE;429 }430 else if (win32wnd->isChild()) goto RunDefWndProc;431 else goto RunDefFrameProc;432 433 case WM_BUTTON2DOWN:434 case WM_BUTTON3DOWN:435 #ifdef PMFRAMELOG436 dprintf(("PMFRAME: WM_BUTTON2/3DOWN"));437 #endif438 if (win32wnd->isChild()) goto RunDefWndProc;439 else goto RunDefFrameProc;440 441 case WM_PAINT:442 #ifdef PMFRAMELOG443 dprintf(("PMFRAME: WM_PAINT %x",hwnd));444 #endif445 if (!win32wnd->isChild())446 {447 if (CanDrawSizeBox(win32wnd))448 {449 MRESULT res;450 HPS hps;451 RECTL rect;452 453 RestoreOS2TIB();454 res = OldFrameProc(hwnd,msg,mp1,mp2);455 SetWin32TIB();456 457 GetSizeBox(win32wnd,&rect);458 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS);459 DrawSizeBox(hps,rect);460 WinReleasePS(hps);461 462 RestoreOS2TIB();463 return res;464 }465 else goto RunDefFrameProc;466 }467 else468 {469 RECTL rect;470 HPS hps;471 472 RestoreOS2TIB();473 OldFrameProc(hwnd,msg,mp1,mp2);474 SetWin32TIB();475 476 WinQueryWindowRect(hwnd,&rect);477 rect.xRight = rect.xRight-rect.xLeft;478 rect.yTop = rect.yTop-rect.yBottom;479 rect.xLeft = rect.yBottom = 0;480 hps = WinGetClipPS(hwnd,0,PSF_CLIPCHILDREN | PSF_CLIPSIBLINGS);481 DrawFrame(hps,&rect,win32wnd);482 WinReleasePS(hps);483 484 RestoreOS2TIB();485 return (MRESULT)0;486 }487 482 488 483 default:
Note:
See TracChangeset
for help on using the changeset viewer.