- Timestamp:
- Jan 16, 2000, 7:17:13 PM (26 years ago)
- Location:
- trunk/src/user32/new
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/new/menu.cpp
r2444 r2458 1 /* $Id: menu.cpp,v 1.1 0 2000-01-15 14:18:16cbratschi Exp $*/1 /* $Id: menu.cpp,v 1.11 2000-01-16 18:17:10 cbratschi Exp $*/ 2 2 /* 3 3 * Menu functions … … 104 104 #define TPM_BUTTONDOWN 0x40000000 /* menu was clicked before tracking */ 105 105 #define TPM_POPUPMENU 0x20000000 /* menu is a popup menu */ 106 #define TPM_CAPTIONSYSMENU 0x10000000 106 107 107 108 /* popup menu shade thickness */ … … 2014 2015 */ 2015 2016 static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu, 2016 BOOL selectFirst, UINT wFlags 2017 BOOL selectFirst, UINT wFlags,POINT *pt) 2017 2018 { 2018 2019 RECT rect; … … 2071 2072 MENU_InitSysMenuPopup(item->hSubMenu,GetWindowLongA(menu->hWnd,GWL_STYLE), GetClassLongA(menu->hWnd, GCL_STYLE)); 2072 2073 2073 if (win32wnd) win32wnd->GetSysPopupPos(&rect); 2074 rect.top = rect.bottom; 2075 rect.right = GetSystemMetrics(SM_CXSIZE); 2076 rect.bottom = GetSystemMetrics(SM_CYSIZE); 2074 if ((wFlags & TPM_CAPTIONSYSMENU) && pt) 2075 { 2076 rect.top = pt->y; 2077 rect.left = pt->x; 2078 rect.bottom = rect.right = 0; 2079 } else 2080 { 2081 if (win32wnd) win32wnd->GetSysPopupPos(&rect); 2082 rect.top = rect.bottom; 2083 rect.right = GetSystemMetrics(SM_CXSIZE); 2084 rect.bottom = GetSystemMetrics(SM_CYSIZE); 2085 } 2077 2086 } 2078 2087 else … … 2185 2194 } 2186 2195 else 2187 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hMenu, TRUE, wFlags );2196 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hMenu, TRUE, wFlags,&pmt->pt); 2188 2197 2189 2198 return -1; … … 2243 2252 if(!(item->fState & MF_MOUSESELECT )) 2244 2253 { 2245 pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE, wFlags);2254 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,hPtMenu,FALSE,wFlags,&pmt->pt); 2246 2255 } 2247 2256 … … 2321 2330 { 2322 2331 MENU_SwitchTracking( pmt, hPtMenu, id ); 2323 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hPtMenu, FALSE, wFlags );2332 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hPtMenu, FALSE, wFlags,&pmt->pt); 2324 2333 } 2325 2334 return TRUE; … … 2510 2519 if( !MENU_SuspendPopup( pmt, WM_KEYDOWN ) ) 2511 2520 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, 2512 pmt->hTopMenu, TRUE, wFlags );2521 pmt->hTopMenu, TRUE, wFlags,&pmt->pt); 2513 2522 } 2514 2523 } … … 2538 2547 2539 2548 hmenutmp = pmt->hCurrentMenu; 2540 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hmenutmp, TRUE, wFlags );2549 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hmenutmp, TRUE, wFlags,&pmt->pt); 2541 2550 2542 2551 /* if subpopup was displayed then we are done */ … … 2568 2577 if( !MENU_SuspendPopup(pmt, WM_KEYDOWN) ) 2569 2578 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, 2570 pmt->hTopMenu, TRUE, wFlags );2579 pmt->hTopMenu, TRUE, wFlags,&pmt->pt); 2571 2580 } 2572 2581 } … … 2697 2706 menu = (POPUPMENU*)mt.hCurrentMenu; 2698 2707 if (!(menu->wFlags & MF_POPUP)) 2699 mt.hCurrentMenu = MENU_ShowSubPopup(mt.hOwnerWnd, mt.hTopMenu, TRUE, wFlags );2708 mt.hCurrentMenu = MENU_ShowSubPopup(mt.hOwnerWnd, mt.hTopMenu, TRUE, wFlags,&mt.pt); 2700 2709 else /* otherwise try to move selection */ 2701 2710 MENU_MoveSelection( mt.hOwnerWnd, mt.hCurrentMenu, ITEM_NEXT ); … … 2844 2853 if (IsMenu(hMenu)) 2845 2854 { 2855 if (ht == HTCAPTION) wFlags |= TPM_CAPTIONSYSMENU; 2856 if (IsIconic(hWnd)) wFlags |= TPM_BOTTOMALIGN; //CB: todo: for minimized windows 2857 2846 2858 MENU_InitTracking( hWnd, hMenu, FALSE, wFlags ); 2847 2859 MENU_TrackMenu( hMenu, wFlags, pt.x, pt.y, hWnd,ht == 0, NULL ); -
trunk/src/user32/new/oslibwin.cpp
r2444 r2458 1 /* $Id: oslibwin.cpp,v 1.3 8 2000-01-15 14:18:16cbratschi Exp $ */1 /* $Id: oslibwin.cpp,v 1.39 2000-01-16 18:17:11 cbratschi Exp $ */ 2 2 /* 3 3 * Window API wrappers for OS/2 … … 996 996 void OSLibWinShowTaskList(HWND hwndFrame) 997 997 { 998 WinPostMsg(NULLHANDLE, WM_SYSCOMMAND, (MPARAM)SC_TASKMANAGER, MPFROM2SHORT(CMDSRC_MENU, TRUE)); 999 } 1000 //****************************************************************************** 1001 //****************************************************************************** 998 //CB: don't know if this works on all machines 999 WinSetActiveWindow(HWND_DESKTOP,0x8000000E); 1000 } 1001 //****************************************************************************** 1002 //****************************************************************************** -
trunk/src/user32/new/pmframe.cpp
r2435 r2458 1 /* $Id: pmframe.cpp,v 1.1 7 2000-01-14 13:16:57 sandervlExp $ */1 /* $Id: pmframe.cpp,v 1.18 2000-01-16 18:17:11 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Frame Managment Code for OS/2 … … 118 118 { 119 119 win32wnd->setStyle((win32wnd->getStyle() & ~WS_MINIMIZE_W) | WS_MAXIMIZE_W); 120 121 RECT rect; 122 123 rect.left = rect.top = rect.right = rect.bottom = 0; 124 win32wnd->AdjustMaximizedRect(&rect); 125 swp->x += rect.left; 126 swp->cx += rect.right-rect.left; 127 swp->y -= rect.bottom; 128 swp->cy += rect.bottom-rect.top; 120 129 } 121 130 else if ((swp->fl & SWP_MINIMIZE) == SWP_MINIMIZE) … … 131 140 132 141 case WM_QUERYBORDERSIZE: 133 goto RunDefFrameProc; 142 { 143 PWPOINT size = (PWPOINT)mp1; 144 145 size->x = 0; 146 size->y = 0; 147 RestoreOS2TIB(); 148 return (MRESULT)TRUE; 149 } 134 150 135 151 case WM_BUTTON1DOWN: … … 212 228 if(!win32wnd->CanReceiveSizeMsgs()) 213 229 break; 214 //CB: todo: adjust maximized window rect (how does WINE it?) 230 215 231 WinQueryWindowPos(hwnd, &swpOld); 216 232 if(pswp->fl & (SWP_MOVE | SWP_SIZE)) { … … 263 279 if ((pswp->fl & (SWP_SIZE | SWP_MOVE | SWP_ZORDER)) == 0) 264 280 { 265 281 goto RunDefFrameProc; 266 282 } 267 283 … … 276 292 OSLibMapSWPtoWINDOWPOSFrame(pswp, &wp, &swpOld, hParent, hwnd); 277 293 278 279 294 if(pswp->fl & SWP_ACTIVATE) 295 { 280 296 WinSendMsg(hwnd, WM_ACTIVATE, (MPARAM)TRUE, (MPARAM)hwnd); 281 282 283 if( pswp->fl & (SWP_MOVE | SWP_SIZE))284 { 285 297 } 298 299 if((pswp->fl & (SWP_MOVE | SWP_SIZE)) && !(win32wnd->getStyle() & WS_MINIMIZE_W)) 300 { 301 //Note: Also updates the new window rectangle 286 302 win32wnd->MsgFormatFrame(&wp); 287 303 … … 325 341 { 326 342 WinInvalidateRect(hwnd,NULL,TRUE); 327 } 343 } 328 344 else 329 345 { … … 360 376 } 361 377 } 362 } 378 } 363 379 else 364 380 { … … 378 394 379 395 case WM_ERASEBACKGROUND: 380 396 break; 381 397 382 398 case WM_CALCVALIDRECTS: … … 453 469 SWP swpClient = {0}; 454 470 455 471 rectOld = *win32wnd->getClientRectPtr(); 456 472 win32wnd->MsgFormatFrame(NULL); 457 473 rectNew = *win32wnd->getClientRectPtr(); 458 474 if(WinEqualRect(0, (PRECTL)&rectOld, (PRECTL)&rectNew) == 1) { 459 460 461 } 475 WinInvalidateRect(win32wnd->getOS2FrameWindowHandle(), NULL, FALSE); 476 return; 477 } 462 478 //CB: todo: use result for WM_CALCVALIDRECTS 463 479 mapWin32ToOS2Rect(win32wnd->getOS2FrameWindowHandle(), win32wnd->getClientRectPtr(), (PRECTLOS2)&rect); -
trunk/src/user32/new/scroll.cpp
r2433 r2458 1 /* $Id: scroll.cpp,v 1.1 1 2000-01-13 20:11:37 sandervlExp $ */1 /* $Id: scroll.cpp,v 1.12 2000-01-16 18:17:11 cbratschi Exp $ */ 2 2 /* 3 3 * Scrollbar control … … 73 73 static BOOL SCROLL_MovingThumb = FALSE; 74 74 75 // Get the infoPtr: works only with scrollbar handles76 77 75 static SCROLLBAR_INFO *SCROLL_GetInfoPtr( HWND hwnd, INT nBar ) 78 76 { 79 77 Win32BaseWindow *win32wnd; 80 HWND hwndFrame;81 78 82 79 switch(nBar) -
trunk/src/user32/new/win32wbase.cpp
r2444 r2458 1 /* $Id: win32wbase.cpp,v 1.4 3 2000-01-15 14:18:17cbratschi Exp $ */1 /* $Id: win32wbase.cpp,v 1.44 2000-01-16 18:17:12 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 1123 1123 { 1124 1124 horzScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO)); 1125 if (!horzScrollInfo) break; 1125 1126 horzScrollInfo->MinVal = horzScrollInfo->CurVal = horzScrollInfo->Page = 0; 1126 1127 horzScrollInfo->MaxVal = 100; … … 1133 1134 { 1134 1135 vertScrollInfo = (SCROLLBAR_INFO*)malloc(sizeof(SCROLLBAR_INFO)); 1136 if (!vertScrollInfo) break; 1135 1137 vertScrollInfo->MinVal = vertScrollInfo->CurVal = vertScrollInfo->Page = 0; 1136 1138 vertScrollInfo->MaxVal = 100; … … 1406 1408 point.x = rectClient.left; 1407 1409 point.y = rectClient.top; 1408 MapWindowPoints(getWindowHandle(), getParent()->getWindowHandle(), &point, 1);1410 ClientToScreen(getParent()->getWindowHandle(),&point); 1409 1411 1410 1412 lParam = MAKELONG(point.x, point.y); 1411 1413 } 1412 1414 else {//in screen coordinates 1413 lParam = MAKELONG(rect Window.left+rectClient.left, rectWindow.top+rectClient.top);1415 lParam = MAKELONG(rectClient.left,rectClient.top); 1414 1416 } 1415 1417 SendInternalMessageA(WM_MOVE, 0, lParam); -
trunk/src/user32/new/win32wbase.h
r2444 r2458 1 /* $Id: win32wbase.h,v 1.3 0 2000-01-15 14:18:18cbratschi Exp $ */1 /* $Id: win32wbase.h,v 1.31 2000-01-16 18:17:12 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 … … 428 428 fakeOpen32WinBaseClass fakeWinBase; 429 429 430 VOID AdjustMaximizedRect(LPRECT rect); 431 430 432 BOOL isOwnDC() { return (windowClass && windowClass->getStyle() & CS_OWNDC_W); } 431 433 HDC getOwnDC() { return ownDC; } -
trunk/src/user32/new/win32wbasenonclient.cpp
r2452 r2458 1 /* $Id: win32wbasenonclient.cpp,v 1.1 2 2000-01-15 17:27:20 sandervlExp $ */1 /* $Id: win32wbasenonclient.cpp,v 1.13 2000-01-16 18:17:13 cbratschi Exp $ */ 2 2 /* 3 3 * Win32 Window Base Class for OS/2 (non-client methods) … … 317 317 //****************************************************************************** 318 318 //****************************************************************************** 319 VOID Win32BaseWindow::AdjustRectOuter(LPRECT rect,BOOL menu) 320 { 321 if(dwStyle & WS_ICONIC) return; 322 319 VOID Win32BaseWindow::AdjustMaximizedRect(LPRECT rect) 320 { 323 321 /* Decide if the window will be managed (see CreateWindowEx) */ 324 322 //if (!WindowNeedsWMBorder()) //CB: check Options.managed … … 332 330 if (HAS_THINFRAME( dwStyle )) 333 331 InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); 332 } 333 } 334 //****************************************************************************** 335 //****************************************************************************** 336 VOID Win32BaseWindow::AdjustRectOuter(LPRECT rect,BOOL menu) 337 { 338 if(dwStyle & WS_ICONIC) return; 339 340 /* Decide if the window will be managed (see CreateWindowEx) */ 341 //if (!WindowNeedsWMBorder()) //CB: check Options.managed 342 { 343 if (HAS_THICKFRAME(dwStyle,dwExStyle )) 344 InflateRect( rect, GetSystemMetrics(SM_CXFRAME), GetSystemMetrics(SM_CYFRAME) ); 345 else 346 if (HAS_DLGFRAME( dwStyle, dwExStyle )) 347 InflateRect(rect, GetSystemMetrics(SM_CXDLGFRAME), GetSystemMetrics(SM_CYDLGFRAME) ); 348 else 349 if (HAS_THINFRAME( dwStyle )) 350 InflateRect( rect, GetSystemMetrics(SM_CXBORDER), GetSystemMetrics(SM_CYBORDER)); 334 351 335 352 if ((dwStyle & WS_CAPTION) == WS_CAPTION) … … 367 384 LONG result = 0; 368 385 UINT style; 386 387 dprintf(("Default WM_NCCALCSIZE handler")); 369 388 370 389 if (!calcValidRects) return 0; … … 408 427 RECT rect = rectWindow; 409 428 429 if (dwStyle & WS_MINIMIZE) return HTCAPTION; 430 410 431 if (!PtInRect(&rect,pt)) return HTNOWHERE; 411 412 if (dwStyle & WS_MINIMIZE) return HTCAPTION;413 432 414 433 if (!(flags & WIN_MANAGED)) … … 1197 1216 LONG Win32BaseWindow::HandleNCRButtonUp(WPARAM wParam,LPARAM lParam) 1198 1217 { 1199 if (wParam == HTCAPTION) 1200 { 1201 if (GetActiveWindow() != Win32Hwnd) 1218 switch(wParam) 1219 { 1220 case HTCAPTION: 1221 if (GetActiveWindow() != Win32Hwnd) 1202 1222 SetActiveWindow(); 1203 1223 1204 if ((GetActiveWindow() == Win32Hwnd) && (dwStyle & WS_SYSMENU)) 1205 { 1206 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam); 1207 } 1224 if ((GetActiveWindow() == Win32Hwnd) && (dwStyle & WS_SYSMENU)) 1225 { 1226 SendInternalMessageA(WM_SYSCOMMAND,SC_MOUSEMENU+HTCAPTION,lParam); 1227 } 1228 break; 1229 1230 default: 1231 break; 1208 1232 } 1209 1233 … … 1225 1249 case SC_SIZE: 1226 1250 { 1227 DWORD flags = 0; 1251 DWORD flags; 1252 1253 if (dwStyle & WS_MAXIMIZE) break; 1228 1254 1229 1255 switch ((wParam & 0xF)+2) … … 1260 1286 flags = TFOS_BOTTOM | TFOS_RIGHT; 1261 1287 break; 1288 1289 default: 1290 flags = TFOS_BOTTOM | TFOS_RIGHT; 1291 break; 1262 1292 } 1263 1293 if (flags) FrameTrackFrame(this,flags); … … 1266 1296 1267 1297 case SC_MOVE: 1298 if (dwStyle & WS_MAXIMIZE) break; 1268 1299 FrameTrackFrame(this,TFOS_MOVE); 1269 1300 break;
Note:
See TracChangeset
for help on using the changeset viewer.