Ignore:
Timestamp:
Jan 16, 2000, 7:17:13 PM (26 years ago)
Author:
cbratschi
Message:

menu and frame changes

File:
1 edited

Legend:

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

    r2444 r2458  
    1 /* $Id: menu.cpp,v 1.10 2000-01-15 14:18:16 cbratschi Exp $*/
     1/* $Id: menu.cpp,v 1.11 2000-01-16 18:17:10 cbratschi Exp $*/
    22/*
    33 * Menu functions
     
    104104#define TPM_BUTTONDOWN          0x40000000              /* menu was clicked before tracking */
    105105#define TPM_POPUPMENU           0x20000000              /* menu is a popup menu */
     106#define TPM_CAPTIONSYSMENU      0x10000000
    106107
    107108  /* popup menu shade thickness */
     
    20142015 */
    20152016static HMENU MENU_ShowSubPopup( HWND hwndOwner, HMENU hmenu,
    2016                                   BOOL selectFirst, UINT wFlags )
     2017                                  BOOL selectFirst, UINT wFlags,POINT *pt)
    20172018{
    20182019    RECT rect;
     
    20712072        MENU_InitSysMenuPopup(item->hSubMenu,GetWindowLongA(menu->hWnd,GWL_STYLE), GetClassLongA(menu->hWnd, GCL_STYLE));
    20722073
    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        }
    20772086    }
    20782087    else
     
    21852194    }
    21862195    else
    2187         pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hMenu, TRUE, wFlags);
     2196        pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd, hMenu, TRUE, wFlags,&pmt->pt);
    21882197
    21892198    return -1;
     
    22432252            if(!(item->fState & MF_MOUSESELECT ))
    22442253            {
    2245                 pmt->hCurrentMenu = MENU_ShowSubPopup( pmt->hOwnerWnd, hPtMenu, FALSE, wFlags );
     2254                pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,hPtMenu,FALSE,wFlags,&pmt->pt);
    22462255            }
    22472256
     
    23212330    {
    23222331            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);
    23242333    }
    23252334    return TRUE;
     
    25102519            if( !MENU_SuspendPopup( pmt, WM_KEYDOWN ) )
    25112520                pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,
    2512                                                 pmt->hTopMenu, TRUE, wFlags);
     2521                                                pmt->hTopMenu, TRUE, wFlags,&pmt->pt);
    25132522        }
    25142523    }
     
    25382547
    25392548        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);
    25412550
    25422551        /* if subpopup was displayed then we are done */
     
    25682577            if( !MENU_SuspendPopup(pmt, WM_KEYDOWN) )
    25692578                pmt->hCurrentMenu = MENU_ShowSubPopup(pmt->hOwnerWnd,
    2570                                                        pmt->hTopMenu, TRUE, wFlags);
     2579                                                       pmt->hTopMenu, TRUE, wFlags,&pmt->pt);
    25712580    }
    25722581}
     
    26972706                    menu = (POPUPMENU*)mt.hCurrentMenu;
    26982707                    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);
    27002709                    else      /* otherwise try to move selection */
    27012710                        MENU_MoveSelection( mt.hOwnerWnd, mt.hCurrentMenu, ITEM_NEXT );
     
    28442853    if (IsMenu(hMenu))
    28452854    {
     2855        if (ht == HTCAPTION) wFlags |= TPM_CAPTIONSYSMENU;
     2856        if (IsIconic(hWnd)) wFlags |= TPM_BOTTOMALIGN; //CB: todo: for minimized windows
     2857
    28462858        MENU_InitTracking( hWnd, hMenu, FALSE, wFlags );
    28472859        MENU_TrackMenu( hMenu, wFlags, pt.x, pt.y, hWnd,ht == 0, NULL );
Note: See TracChangeset for help on using the changeset viewer.