Changeset 2292 for trunk/src/user32/new/pmframe.cpp
- Timestamp:
- Jan 2, 2000, 8:30:47 PM (26 years ago)
- File:
-
- 1 edited
-
trunk/src/user32/new/pmframe.cpp (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/pmframe.cpp
r2291 r2292 1 /* $Id: pmframe.cpp,v 1. 2 2000-01-01 17:07:42cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.3 2000-01-02 19:30:43 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 16 16 #include <os2wrap.h> 17 17 #include <stdlib.h> 18 #include <string.h> 18 19 #include "win32type.h" 19 20 #include <misc.h> … … 24 25 #include "oslibwin.h" 25 26 #include "caret.h" 27 #include "oslibmsg.h" 26 28 27 29 #define PMFRAMELOG … … 216 218 MRESULT rc; 217 219 THDB *thdb; 218 MSG *pWinMsg ;220 MSG *pWinMsg,winMsg; 219 221 220 222 SetWin32TIB(); … … 228 230 goto RunDefWndProc; 229 231 } 230 pWinMsg = &thdb->msg; 232 233 if((thdb->msgstate & 1) == 0) 234 {//message that was sent directly to our window proc handler; translate it here 235 QMSG qmsg; 236 237 qmsg.msg = msg; 238 qmsg.hwnd = hwnd; 239 qmsg.mp1 = mp1; 240 qmsg.mp2 = mp2; 241 qmsg.time = WinQueryMsgTime(thdb->hab); 242 WinQueryMsgPos(thdb->hab, &qmsg.ptl); 243 qmsg.reserved = 0; 244 245 if(OS2ToWinMsgTranslate((PVOID)thdb, &qmsg, &winMsg, FALSE, MSG_REMOVE) == FALSE) 246 {//message was not translated 247 memset(&winMsg, 0, sizeof(MSG)); 248 } 249 pWinMsg = &winMsg; 250 } 251 else { 252 pWinMsg = &thdb->msg; 253 thdb->msgstate++; 254 } 231 255 232 256 OldFrameProc = (PFNWP)win32wnd->getOldFrameProc(); … … 236 260 case WM_FORMATFRAME: 237 261 { 238 RECTL *client; 239 262 PSWP pswp = (PSWP)mp1,swpClient; 263 RECTL *client = (PRECTL)mp2,rect; 264 INT ccount; 265 266 if (!win32wnd->IsWindowCreated()) goto RunDefFrameProc; 240 267 dprintf(("PMFRAME: WM_FORMATFRAME %x",hwnd)); 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 249 goto RunDefFrameProc; 250 #endif 268 RestoreOS2TIB(); 269 ccount = (INT)OldFrameProc(hwnd,msg,mp1,mp2); 270 SetWin32TIB(); 271 mapWin32ToOS2Rect(WinQueryWindow(hwnd,QW_PARENT),win32wnd->getClientRectPtr(),(PRECTLOS2)&rect); 272 WinMapWindowPoints(WinQueryWindow(hwnd,QW_PARENT),hwnd,(PPOINTL)&rect,2); 273 swpClient = &pswp[ccount-1]; 274 swpClient->x = rect.xLeft; 275 swpClient->y = rect.yBottom; 276 swpClient->cx = rect.xRight-rect.xLeft; 277 swpClient->cy = rect.yTop-rect.yBottom; 278 RestoreOS2TIB(); 279 return (MRESULT)ccount; 251 280 } 252 281 … … 268 297 case WM_BUTTON3UP: 269 298 case WM_BUTTON3DBLCLK: 270 win32wnd->MsgButton(pWinMsg); 271 RestoreOS2TIB(); 299 if (win32wnd->IsWindowCreated()) 300 { 301 win32wnd->MsgButton(pWinMsg); 302 RestoreOS2TIB(); 303 } 272 304 return (MRESULT)TRUE; 273 305 … … 287 319 { 288 320 //OS/2 Window coordinates -> Win32 Window coordinates 289 win32wnd->MsgMouseMove(pWinMsg); 321 if (win32wnd->IsWindowCreated()) 322 win32wnd->MsgMouseMove(pWinMsg); 290 323 RestoreOS2TIB(); 291 324 return (MRESULT)TRUE; … … 297 330 298 331 // Only send this message if the window is enabled 299 if (!WinIsWindowEnabled(hwnd)) 332 if (!win32wnd->IsWindowCreated()) 333 res = HT_NORMAL; 334 else if (!WinIsWindowEnabled(hwnd)) 300 335 res = HT_ERROR; 301 336 else if (win32wnd->getIgnoreHitTest()) … … 315 350 316 351 case WM_PAINT: 317 win32wnd->DispatchMsgA(pWinMsg); 352 dprintf(("PMFRAME: WM_PAINT")); 353 if (win32wnd->IsWindowCreated()) 354 win32wnd->MsgNCPaint(); 318 355 goto RunDefWndProc; 319 356 … … 430 467 UINT res = CVR_ALIGNLEFT | CVR_ALIGNTOP; 431 468 432 //CB: only used if CS_SIZEDRAW isn't set 433 // PM moves children -> fast, no flickering (if redraw flags not set) 469 //CB: todo: use WM_NCCALCSIZE 434 470 if (win32wnd->getWindowClass()) 435 471 { … … 456 492 USHORT flags = WinQueryWindowUShort(hwnd,QWS_FLAGS); 457 493 458 //CB: emulate WM_ACTIVATE -> no flickering 459 hwndTitle = WinWindowFromID(hwnd,FID_TITLEBAR); 460 if (hwndTitle) WinSendMsg(hwndTitle,TBM_SETHILITE,mp1,MPVOID); 461 462 WinSendMsg(WinWindowFromID(hwnd,FID_CLIENT),WM_ACTIVATE,mp1,mp2); 463 WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE)); 464 465 //CB: show owner behind the dialog 466 if (win32wnd->IsModalDialog()) 494 if (win32wnd->IsWindowCreated()) 467 495 { 468 Win32BaseWindow *topOwner = win32wnd->getOwner()->GetTopParent(); 469 470 if (topOwner) WinSetWindowPos(topOwner->getOS2FrameWindowHandle(),hwnd,0,0,0,0,SWP_ZORDER); 496 WinSendMsg(WinWindowFromID(hwnd,FID_CLIENT),WM_ACTIVATE,mp1,mp2); 497 WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE)); 498 499 //CB: show owner behind the dialog 500 if (win32wnd->IsModalDialog()) 501 { 502 Win32BaseWindow *topOwner = win32wnd->getOwner()->GetTopParent(); 503 504 if (topOwner) WinSetWindowPos(topOwner->getOS2FrameWindowHandle(),hwnd,0,0,0,0,SWP_ZORDER); 505 } 506 } else 507 { 508 WinSetWindowUShort(hwnd,QWS_FLAGS,mp1 ? (flags | FF_ACTIVE):(flags & ~FF_ACTIVE)); 471 509 } 472 510
Note:
See TracChangeset
for help on using the changeset viewer.
