Changeset 3584 for trunk/src/user32/menu.cpp
- Timestamp:
- May 22, 2000, 7:21:11 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/user32/menu.cpp
r3501 r3584 1 /* $Id: menu.cpp,v 1.2 1 2000-05-09 18:56:56 sandervlExp $*/1 /* $Id: menu.cpp,v 1.22 2000-05-22 17:21:09 cbratschi Exp $*/ 2 2 /* 3 3 * Menu functions … … 9 9 * Copyright 1999 Christoph Bratschi 10 10 * 11 * Corel version: 20000 31711 * Corel version: 200005313 12 12 * (WINE version: 20000130) 13 13 * … … 837 837 lpitem->rect.right += mis.itemWidth; 838 838 839 839 //SvL: Add size of space between two menu items (fixes RealPlayer 7 menu) 840 840 if(menuBar) 841 841 { … … 1599 1599 if (!pTopPopupWnd) 1600 1600 { 1601 1601 DebugInt3(); 1602 1602 return FALSE; 1603 1603 } … … 1616 1616 if( !menu->hWnd ) 1617 1617 { 1618 1618 DebugInt3(); 1619 1619 return FALSE; 1620 1620 } … … 2187 2187 if(win32wnd==NULL) { 2188 2188 //SvL: This happens in Moraff's YourJongg 2.0, return here 2189 2189 //TODO: Check if this is supposed to happen at all... 2190 2190 return (HMENU)0; 2191 2191 } 2192 2192 2193 2193 ht = win32wnd->HandleNCHitTest(pt); … … 2433 2433 functionality. 2434 2434 */ 2435 2435 pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,hPtMenu,FALSE,wFlags,&pmt->pt); 2436 2436 return TRUE; 2437 2437 } … … 2784 2784 goto buttondown; 2785 2785 case WM_LBUTTONDBLCLK: 2786 2787 2788 2789 2790 2791 2786 if (bSysMenu && (hmenu == mt.hTopMenu)) 2787 { 2788 fEndMenu = TRUE; 2789 break; 2790 } 2791 /* fall through */ 2792 2792 case WM_LBUTTONDOWN: 2793 2793 /* If the message belongs to the menu, removes it from the queue */ 2794 2794 /* Else, end menu tracking */ 2795 2795 2796 2796 buttondown: 2797 2797 /* Forcing mouse popup NOW - Ensure timer doesn't popup menu also */ 2798 2798 mouseOverMenuID = -1; 2799 2799 fRemove = MENU_ButtonDown( &mt, hmenu, wFlags ); 2800 2800 fEndMenu = !fRemove; … … 2809 2809 { 2810 2810 /* Forcing mouse popup NOW - Ensure timer doesn't popup menu also */ 2811 2811 mouseOverMenuID = -1; 2812 2812 executedMenuId = MENU_ButtonUp( &mt, hmenu, wFlags); 2813 2813 … … 2852 2852 MENU_FindItemByCoords( ptmenu, mt.pt, &id ); 2853 2853 2854 2855 2856 2857 2854 /* If it is over the same item that set up the timer originally .... */ 2855 if (mouseOverMenuID != -1 && mouseOverMenuID == id) 2856 { 2857 /* .... Pop up the menu */ 2858 2858 mt.hCurrentMenu = MENU_ShowSubPopup(mt.hOwnerWnd, hmenu, FALSE, wFlags,&mt.pt); 2859 2859 } 2860 2860 } 2861 2861 … … 2968 2968 } /* switch(msg.message) - kbd */ 2969 2969 } 2970 2971 2972 2970 else if (msg.message == WM_SYSCOMMAND) 2971 { 2972 /* The user clicked on the system menu/button */ 2973 2973 fEndMenu = TRUE; 2974 2974 break; 2975 2975 } 2976 2976 else 2977 2977 { … … 3482 3482 //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", 3483 3483 // hMenu, wItemID, str, nMaxSiz, wFlags ); 3484 if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0; 3485 if (!IS_STRING_ITEM(item->fType)) return 0; 3486 if (!str || !nMaxSiz) return strlen(item->text); 3484 3485 item = MENU_FindItem( &hMenu, &wItemID, wFlags ); 3486 3487 if (!str || !nMaxSiz) 3488 { 3489 if (item && IS_STRING_ITEM(item->fType)) 3490 return strlen(item->text); 3491 else 3492 return 0; 3493 } 3494 3487 3495 str[0] = '\0'; 3488 lstrcpynA( str, item->text, nMaxSiz ); 3489 //TRACE("returning '%s'\n", str ); 3496 3497 if (item) 3498 { 3499 if (!IS_STRING_ITEM(item->fType)) return 0; 3500 lstrcpynA( str, item->text, nMaxSiz ); 3501 } 3502 3490 3503 return strlen(str); 3491 3504 } … … 3504 3517 //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n", 3505 3518 // hMenu, wItemID, str, nMaxSiz, wFlags ); 3506 if (!(item = MENU_FindItem( &hMenu, &wItemID, wFlags ))) return 0; 3507 if (!IS_STRING_ITEM(item->fType)) return 0; 3508 if (!str || !nMaxSiz) return strlen(item->text); 3519 3520 item = MENU_FindItem( &hMenu, &wItemID, wFlags ); 3521 3522 if (!str || !nMaxSiz) 3523 { 3524 if (item && IS_STRING_ITEM(item->fType)) 3525 return strlen(item->text); 3526 else 3527 return 0; 3528 } 3529 3509 3530 str[0] = '\0'; 3510 lstrcpynAtoW( str, item->text, nMaxSiz ); 3531 3532 if (item) 3533 { 3534 if (!IS_STRING_ITEM(item->fType)) return 0; 3535 lstrcpynAtoW( str, item->text, nMaxSiz ); 3536 } 3537 3511 3538 return lstrlenW(str); 3512 3539 } … … 4727 4754 * IsMenuActive (Internal) 4728 4755 */ 4729 BOOL IsMenuActive( )4756 BOOL IsMenuActive(void) 4730 4757 { 4731 4758 return pTopPopupWnd && (GetWindowLongA(pTopPopupWnd,GWL_STYLE) & WS_VISIBLE);
Note:
See TracChangeset
for help on using the changeset viewer.