- Timestamp:
- Jan 7, 2000, 6:38:48 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/dc.cpp
r2317 r2353 1 /* $Id: dc.cpp,v 1. 9 2000-01-04 19:51:32 sandervlExp $ */1 /* $Id: dc.cpp,v 1.10 2000-01-07 17:38:46 cbratschi Exp $ */ 2 2 3 3 /* … … 584 584 pRect->left = pRect->top = pRect->right = pRect->bottom = 0; 585 585 } 586 587 return updateRegionExists; 588 } 589 590 //functions for WM_NCPAINT 591 592 INT SYSTEM GetOS2UpdateRgn(HWND hwnd,HRGN hrgn) 593 { 594 return O32_GetUpdateRgn(hwnd,hrgn,FALSE); 595 } 596 597 BOOL SYSTEM GetOS2UpdateRect(HWND hwnd,LPRECT pRect) 598 { 599 RECTL rectl; 600 BOOL updateRegionExists = WinQueryUpdateRect(hwnd,pRect ? &rectl:NULL); 601 602 if (!pRect) 603 return (updateRegionExists); 604 605 if (updateRegionExists) 606 mapOS2ToWin32Rect(hwnd,(PRECTLOS2)&rectl,pRect); 607 else 608 pRect->left = pRect->top = pRect->right = pRect->bottom = 0; 586 609 587 610 return updateRegionExists; … … 1451 1474 * display any portion of a window that lies outside of the window region 1452 1475 * When this function is called, the system sends the WM_WINDOWPOSCHANGING and 1453 * WM_WINDOWPOSCHANGED messages to the window. 1476 * WM_WINDOWPOSCHANGED messages to the window. 1454 1477 * 1455 1478 * Parameters: HWND hWnd handle to window whose window region is to be set … … 1480 1503 dprintf(("USER32:SetWindowRgn (%x,%x,%d)", hwnd, hRgn, bRedraw)); 1481 1504 if(window->GetWindowRegion()) { 1482 1505 O32_DeleteObject(window->GetWindowRegion()); 1483 1506 } 1484 1507 window->SetWindowRegion(hRgn); 1485 1508 if(bRedraw) { 1486 RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W); 1509 RedrawWindow(hwnd, 0, 0, RDW_UPDATENOW_W); 1487 1510 } 1488 1511 //TODO: 1489 1512 // When this function is called, the system sends the WM_WINDOWPOSCHANGING and 1490 // WM_WINDOWPOSCHANGED messages to the window. 1513 // WM_WINDOWPOSCHANGED messages to the window. 1491 1514 return 1; 1492 1515 } -
trunk/src/user32/new/oslibmsgtranslate.cpp
r2335 r2353 1 /* $Id: oslibmsgtranslate.cpp,v 1. 5 2000-01-05 21:25:04cbratschi Exp $ */1 /* $Id: oslibmsgtranslate.cpp,v 1.6 2000-01-07 17:38:47 cbratschi Exp $ */ 2 2 /* 3 3 * Window message translation functions for OS/2 … … 141 141 case WM_BUTTON3DBLCLK: 142 142 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 143 if( (win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle())) {143 if(win32wnd->lastHitTestVal != HTCLIENT_W) { 144 144 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 145 145 winMsg->wParam = win32wnd->lastHitTestVal; … … 185 185 186 186 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 187 if( (win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle()))187 if(win32wnd->lastHitTestVal != HTCLIENT_W) 188 188 { 189 189 setcursormsg = WINWM_NCMOUSEMOVE; … … 332 332 case WM_BUTTON3DBLCLK: 333 333 //WM_NC*BUTTON* is posted when the cursor is in a non-client area of the window 334 if( (win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle())) {334 if(win32wnd->lastHitTestVal != HTCLIENT_W) { 335 335 winMsg->message = WINWM_NCLBUTTONDOWN + (os2Msg->msg - WM_BUTTON1DOWN); 336 336 winMsg->wParam = win32wnd->lastHitTestVal; … … 376 376 377 377 //WM_NCMOUSEMOVE is posted when the cursor moves into a non-client area of the window 378 if( (win32wnd->lastHitTestVal != HTCLIENT_W) && (WinQueryCapture(HWND_DESKTOP) != win32wnd->getOS2WindowHandle()))378 if(win32wnd->lastHitTestVal != HTCLIENT_W) 379 379 { 380 380 setcursormsg = WINWM_NCMOUSEMOVE; -
trunk/src/user32/new/pmframe.cpp
r2340 r2353 1 /* $Id: pmframe.cpp,v 1. 6 2000-01-06 17:05:52cbratschi Exp $ */1 /* $Id: pmframe.cpp,v 1.7 2000-01-07 17:38:47 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 481 481 482 482 PosChangedEnd: 483 //update the client rect 484 RECTL rectl; 485 486 WinQueryWindowRect(win32wnd->getOS2WindowHandle(),&rectl); 487 mapOS2ToWin32Rect(win32wnd->getOS2WindowHandle(),WinQueryWindow(hwnd,QW_PARENT),(PRECTLOS2)&rectl,win32wnd->getClientRectPtr()); 488 483 489 //calls WM_FORMATFRAME if SWP_SIZE is set 484 490 RestoreOS2TIB(); 485 491 rc = OldFrameProc(hwnd,msg,mp1,mp2); 486 SetWin32TIB();487 488 RestoreOS2TIB();489 492 return rc; 490 493 } -
trunk/src/user32/new/win32wbase.cpp
r2340 r2353 1 /* $Id: win32wbase.cpp,v 1.2 3 2000-01-06 17:05:52cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.24 2000-01-07 17:38:47 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 713 713 if (SendInternalMessageA(WM_NCCREATE,0,(LPARAM)cs)) 714 714 { 715 RECT rect;716 717 715 //update rect 718 716 rectWindow.left = cs->x; … … 720 718 rectWindow.top = cs->y; 721 719 rectWindow.bottom = cs->y+cs->cy; 722 rectClient = rectWindow;723 720 if (getParent()) MapWindowPoints(getParent()->getWindowHandle(),0,(PPOINT)&rectWindow,2); 724 721 OffsetRect(&rectWindow, maxPos.x - rectWindow.left, maxPos.y - rectWindow.top); 722 rectClient = rectWindow; 723 if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rectClient,2); 725 724 //set the window size and update the client 726 rect = rectWindow; 727 if (getParent()) MapWindowPoints(0,getParent()->getWindowHandle(),(PPOINT)&rect,2); 728 SetWindowPos(hwndLinkAfter,rect.left,rect.top,rect.right-rect.left,rect.bottom-rect.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED); 725 SetWindowPos(hwndLinkAfter,rectClient.left,rectClient.top,rectClient.right-rectClient.left,rectClient.bottom-rectClient.top,SWP_NOACTIVATE | SWP_NOREDRAW | SWP_FRAMECHANGED); 729 726 fNoSizeMsg = FALSE; 730 727 if( (SendInternalMessageA(WM_CREATE, 0, (LPARAM)cs )) != -1 ) … … 1103 1100 ULONG Win32BaseWindow::MsgNCPaint() 1104 1101 { 1105 HRGN hrgn; 1106 1107 hrgn = 0; //CB: todo: set to frame update region 1108 return SendInternalMessageA(WM_NCPAINT,hrgn,0); 1102 RECT rect; 1103 1104 if (GetOS2UpdateRect(OS2HwndFrame,&rect)) 1105 { 1106 HRGN hrgn; 1107 ULONG rc; 1108 RECT client = rectClient; 1109 1110 //CB: bug in dc.cpp!!! 1111 if ((rect.left == rect.right) || (rect.bottom == rect.top)) return 0; 1112 mapWin32Rect(getParent() ? getParent()->getOS2WindowHandle():OSLIB_HWND_DESKTOP,OS2HwndFrame,&client); 1113 if ((rect.left >= client.left) && (rect.left < client.right) && 1114 (rect.right >= client.left) && (rect.right < client.right) && 1115 (rect.top >= client.top) && (rect.top < client.bottom) && 1116 (rect.bottom >= client.top) && (rect.bottom < client.bottom)) 1117 return 0; 1118 hrgn = CreateRectRgnIndirect(&rect); 1119 if (!hrgn) return 0; 1120 //CB: bug in GetDCEx with region!!! 1121 rc = SendInternalMessageA(WM_NCPAINT,/*hrgn*/0,0); 1122 dprintf(("CB: %d %d %d %d",rect.left,rect.top,rect.bottom,rect.right)); 1123 DeleteObject(hrgn); 1124 //CB: todo: check if intersection with client 1125 1126 return rc; 1127 } else return 0; 1109 1128 } 1110 1129 //****************************************************************************** … … 1343 1362 DrawMaxButton(hdc,pressed,FALSE); 1344 1363 } 1345 } while ( msg.message != WM_LBUTTONUP);1364 } while ((msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP)); 1346 1365 if (wParam == HTMINBUTTON) 1347 1366 DrawMinButton(hdc,FALSE,FALSE); … … 1372 1391 return; 1373 1392 state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); 1393 #else 1394 state = 0; 1374 1395 #endif 1375 1396 /* If the item close of the sysmenu is disabled or not there do nothing */ … … 1387 1408 if (pressed != oldstate) 1388 1409 DrawCloseButton(hdc, pressed, FALSE); 1389 } while ( msg.message != WM_LBUTTONUP);1390 DrawCloseButton(hdc, FALSE,FALSE);1410 } while ((msg.message != WM_LBUTTONUP) && (msg.message != WM_NCLBUTTONUP)); 1411 DrawCloseButton(hdc,FALSE,FALSE); 1391 1412 ReleaseCapture(); 1392 ReleaseDC(Win32Hwnd, hdc);1413 ReleaseDC(Win32Hwnd,hdc); 1393 1414 if (!pressed) return; 1394 1415 SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,*(LPARAM*)&msg.pt); … … 1459 1480 //****************************************************************************** 1460 1481 //****************************************************************************** 1461 LONG Win32BaseWindow::HandleNCLButtonUp(WPARAM wParam,LPARAM lParam)1462 {1463 switch(wParam) /* Hit test */1464 {1465 case HTMINBUTTON:1466 SendInternalMessageA(WM_SYSCOMMAND,SC_MINIMIZE,lParam);1467 break;1468 1469 case HTMAXBUTTON:1470 SendInternalMessageA(WM_SYSCOMMAND,SC_MAXIMIZE,lParam);1471 break;1472 1473 case HTCLOSE:1474 SendInternalMessageA(WM_SYSCOMMAND,SC_CLOSE,lParam);1475 break;1476 }1477 1478 return 0;1479 }1480 //******************************************************************************1481 //******************************************************************************1482 1482 BOOL Win32BaseWindow::WindowNeedsWMBorder() 1483 1483 { … … 1770 1770 { 1771 1771 INT width, height; 1772 HBRUSH oldBrush; 1772 1773 1773 1774 if (dlgFrame) … … 1781 1782 } 1782 1783 1783 SelectObject( hdc, GetSysColorBrush(active ? COLOR_ACTIVEBORDER : 1784 COLOR_INACTIVEBORDER) ); 1784 oldBrush = SelectObject(hdc,GetSysColorBrush(active ? COLOR_ACTIVEBORDER:COLOR_INACTIVEBORDER)); 1785 1785 1786 1786 /* Draw frame */ 1787 PatBlt( hdc, rect->left, rect->top, 1788 rect->right - rect->left, height, PATCOPY ); 1789 PatBlt( hdc, rect->left, rect->top, 1790 width, rect->bottom - rect->top, PATCOPY ); 1791 PatBlt( hdc, rect->left, rect->bottom - 1, 1792 rect->right - rect->left, -height, PATCOPY ); 1793 PatBlt( hdc, rect->right - 1, rect->top, 1794 -width, rect->bottom - rect->top, PATCOPY ); 1795 1796 InflateRect( rect, -width, -height ); 1787 1788 PatBlt(hdc,rect->left,rect->top,rect->right-rect->left,height,PATCOPY); 1789 PatBlt(hdc,rect->left,rect->top,width,rect->bottom-rect->top,PATCOPY); 1790 PatBlt(hdc,rect->left,rect->bottom-1,rect->right-rect->left,-height,PATCOPY); 1791 PatBlt(hdc,rect->right-1,rect->top,-width,rect->bottom-rect->top,PATCOPY); 1792 SelectObject(hdc,oldBrush); 1793 1794 InflateRect(rect,-width,-height); 1797 1795 } 1798 1796 //****************************************************************************** … … 2002 2000 /* Go get the sysmenu */ 2003 2001 state = GetMenuState(hSysMenu, SC_CLOSE, MF_BYCOMMAND); 2002 #else 2003 state = 0; 2004 2004 #endif 2005 2005 /* Draw a grayed close button if disabled and a normal one if SC_CLOSE is not there */ … … 2137 2137 r.top = r.bottom - GetSystemMetrics(SM_CYHSCROLL) + 1; 2138 2138 FillRect( hdc, &r, GetSysColorBrush(COLOR_SCROLLBAR) ); 2139 //CB: todo: use scroll code for size grip 2139 2140 } 2140 2141 … … 2294 2295 case SC_SCREENSAVE: 2295 2296 if (wParam == SC_ABOUTWINE) 2296 ShellAboutA(hwnd, "Odin", WINE_RELEASE_INFO, 0);2297 ShellAboutA(hwnd, "Odin", ODIN_RELEASE_INFO, 0); 2297 2298 else 2298 2299 if (wParam == SC_PUTMARK) 2299 2300 dprintf(("Mark requested by user\n")); 2300 2301 break; 2301 2302 #endif 2302 2303 case SC_HOTKEY: 2303 2304 case SC_ARRANGE: … … 2305 2306 case SC_PREVWINDOW: 2306 2307 break; 2307 #endif2308 2308 } 2309 2309 return 0; … … 2468 2468 case WM_NCACTIVATE: 2469 2469 return HandleNCActivate(wParam); 2470 return TRUE;2471 2470 2472 2471 case WM_NCCREATE: … … 2512 2511 2513 2512 case WM_ACTIVATE: 2514 //CB: todo2515 2513 return 0; 2516 2514 … … 2642 2640 return HandleNCLButtonDown(wParam,lParam); 2643 2641 2644 case WM_NCLBUTTONUP: 2645 return HandleNCLButtonUp(wParam,lParam); 2646 2642 case WM_LBUTTONDBLCLK: 2647 2643 case WM_NCLBUTTONDBLCLK: 2648 2644 return HandleNCLButtonDblClk(wParam,lParam); -
trunk/src/user32/new/win32wbase.h
r2335 r2353 1 /* $Id: win32wbase.h,v 1.1 7 2000-01-05 21:25:08 cbratschi Exp $ */1 /* $Id: win32wbase.h,v 1.18 2000-01-07 17:38:48 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 363 363 VOID TrackCloseButton(WORD wParam); 364 364 LONG HandleNCLButtonDown(WPARAM wParam,LPARAM lParam); 365 LONG HandleNCLButtonUp(WPARAM wParam,LPARAM lParam);366 365 LONG HandleNCLButtonDblClk(WPARAM wParam,LPARAM lParam); 367 366 BOOL WindowNeedsWMBorder();
Note:
See TracChangeset
for help on using the changeset viewer.