Commit 70cc169d authored by Aric Stewart's avatar Aric Stewart Committed by Alexandre Julliard

- Wine was passing the wrong hwnd as the owner when processing owner

drawn menubars. - When doing MENU_CalcItemSize for the menu bar we were not properly padding the returned rect.
parent ebf34ae4
...@@ -795,9 +795,25 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, ...@@ -795,9 +795,25 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
mis.itemHeight = 0; mis.itemHeight = 0;
mis.itemWidth = 0; mis.itemWidth = 0;
SendMessageA( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis ); SendMessageA( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis );
lpitem->rect.bottom += mis.itemHeight;
lpitem->rect.right += mis.itemWidth; lpitem->rect.right += mis.itemWidth;
TRACE("id=%04x size=%dx%d\n",
if (menuBar)
{
lpitem->rect.right += MENU_BAR_ITEMS_SPACE;
/* under at least win95 you seem to be given a standard
height for the menu and the height value is ignored */
if (TWEAK_WineLook == WIN31_LOOK)
lpitem->rect.bottom += GetSystemMetrics(SM_CYMENU);
else
lpitem->rect.bottom += GetSystemMetrics(SM_CYMENU)-1;
}
else
lpitem->rect.bottom += mis.itemHeight;
TRACE("id=%04x size=%dx%d\n",
lpitem->wID, mis.itemWidth, mis.itemHeight); lpitem->wID, mis.itemWidth, mis.itemHeight);
/* Fall through to get check/arrow width calculation. */ /* Fall through to get check/arrow width calculation. */
} }
...@@ -1481,7 +1497,7 @@ UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd, ...@@ -1481,7 +1497,7 @@ UINT MENU_DrawMenuBar( HDC hDC, LPRECT lprect, HWND hwnd,
for (i = 0; i < lppop->nItems; i++) for (i = 0; i < lppop->nItems; i++)
{ {
MENU_DrawMenuItem( hwnd, (HMENU)wndPtr->wIDmenu, GetWindow(hwnd,GW_OWNER), MENU_DrawMenuItem( hwnd, (HMENU)wndPtr->wIDmenu, hwnd,
hDC, &lppop->items[i], lppop->Height, TRUE, ODA_DRAWENTIRE ); hDC, &lppop->items[i], lppop->Height, TRUE, ODA_DRAWENTIRE );
} }
retvalue = lppop->Height; retvalue = lppop->Height;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment