Ignore:
Timestamp:
May 22, 2000, 7:21:11 PM (25 years ago)
Author:
cbratschi
Message:

merged controls with Corel WINE 20000513, maximize/minimize fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/user32/menu.cpp

    r3501 r3584  
    1 /* $Id: menu.cpp,v 1.21 2000-05-09 18:56:56 sandervl Exp $*/
     1/* $Id: menu.cpp,v 1.22 2000-05-22 17:21:09 cbratschi Exp $*/
    22/*
    33 * Menu functions
     
    99 * Copyright 1999 Christoph Bratschi
    1010 *
    11  * Corel version: 20000317
     11 * Corel version: 200005313
    1212 * (WINE version: 20000130)
    1313 *
     
    837837        lpitem->rect.right  += mis.itemWidth;
    838838
    839         //SvL: Add size of space between two menu items (fixes RealPlayer 7 menu)
     839        //SvL: Add size of space between two menu items (fixes RealPlayer 7 menu)
    840840        if(menuBar)
    841841        {
     
    15991599            if (!pTopPopupWnd)
    16001600            {
    1601                 DebugInt3();
     1601                DebugInt3();
    16021602                return FALSE;
    16031603            }
     
    16161616                if( !menu->hWnd )
    16171617                {
    1618                     DebugInt3();
     1618                    DebugInt3();
    16191619                    return FALSE;
    16201620                }
     
    21872187        if(win32wnd==NULL) {
    21882188            //SvL: This happens in Moraff's YourJongg 2.0, return here
    2189             //TODO: Check if this is supposed to happen at all...
     2189            //TODO: Check if this is supposed to happen at all...
    21902190            return (HMENU)0;
    2191         }
     2191        }
    21922192
    21932193        ht = win32wnd->HandleNCHitTest(pt);
     
    24332433              functionality.
    24342434            */
    2435             pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,hPtMenu,FALSE,wFlags,&pmt->pt);
     2435            pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,hPtMenu,FALSE,wFlags,&pmt->pt);
    24362436            return TRUE;
    24372437         }
     
    27842784                    goto buttondown;
    27852785                case WM_LBUTTONDBLCLK:
    2786                     if (bSysMenu && (hmenu == mt.hTopMenu))
    2787                     {
    2788                         fEndMenu = TRUE;
    2789                         break;
    2790                     }
    2791                     /* fall through */
     2786                    if (bSysMenu && (hmenu == mt.hTopMenu))
     2787                    {
     2788                        fEndMenu = TRUE;
     2789                        break;
     2790                    }
     2791                    /* fall through */
    27922792                case WM_LBUTTONDOWN:
    27932793                    /* If the message belongs to the menu, removes it from the queue */
    27942794                    /* Else, end menu tracking */
    27952795
    2796                 buttondown:
     2796                buttondown:
    27972797                    /* Forcing mouse popup NOW - Ensure timer doesn't popup menu also */
    2798                     mouseOverMenuID = -1;
     2798                    mouseOverMenuID = -1;
    27992799                    fRemove = MENU_ButtonDown( &mt, hmenu, wFlags );
    28002800                    fEndMenu = !fRemove;
     
    28092809                    {
    28102810                        /* Forcing mouse popup NOW - Ensure timer doesn't popup menu also */
    2811                         mouseOverMenuID = -1;
     2811                        mouseOverMenuID = -1;
    28122812                        executedMenuId = MENU_ButtonUp( &mt, hmenu, wFlags);
    28132813
     
    28522852                   MENU_FindItemByCoords( ptmenu, mt.pt, &id );
    28532853
    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 */
     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 */
    28582858                   mt.hCurrentMenu = MENU_ShowSubPopup(mt.hOwnerWnd, hmenu, FALSE, wFlags,&mt.pt);
    2859                   }
     2859                  }
    28602860              }
    28612861
     
    29682968            }  /* switch(msg.message) - kbd */
    29692969        }
    2970         else if (msg.message == WM_SYSCOMMAND)
    2971         {
    2972                 /* The user clicked on the system menu/button */
     2970        else if (msg.message == WM_SYSCOMMAND)
     2971        {
     2972                /* The user clicked on the system menu/button */
    29732973        fEndMenu = TRUE;
    29742974        break;
    2975         }
     2975        }
    29762976        else
    29772977        {
     
    34823482    //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
    34833483    //             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
    34873495    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
    34903503    return strlen(str);
    34913504}
     
    35043517    //TRACE("menu=%04x item=%04x ptr=%p len=%d flags=%04x\n",
    35053518    //             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
    35093530    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
    35113538    return lstrlenW(str);
    35123539}
     
    47274754 *         IsMenuActive    (Internal)
    47284755 */
    4729 BOOL IsMenuActive()
     4756BOOL IsMenuActive(void)
    47304757{
    47314758    return pTopPopupWnd &&  (GetWindowLongA(pTopPopupWnd,GWL_STYLE) & WS_VISIBLE);
Note: See TracChangeset for help on using the changeset viewer.