Changeset 2458 for trunk/src/user32/new/menu.cpp
- Timestamp:
- Jan 16, 2000, 7:17:13 PM (26 years ago)
- File:
-
- 1 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 );
Note:
See TracChangeset
for help on using the changeset viewer.