Commit 7abca950 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

The MEASUREITEMSTRUCT and DRAWITEMSTRUCT were filled wrong.

parent c2606381
...@@ -238,6 +238,8 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp, ...@@ -238,6 +238,8 @@ static void do_debug_print_menuitem(const char *prefix, MENUITEM * mp,
/* Nothing */ ; /* Nothing */ ;
else else
dsprintf(menu, ", Text=%p", mp->text); dsprintf(menu, ", Text=%p", mp->text);
if (mp->dwItemData)
dsprintf(menu, ", ItemData=0x%08lx", mp->dwItemData);
dsprintf(menu, " }"); dsprintf(menu, " }");
} else { } else {
dsprintf(menu, "NULL"); dsprintf(menu, "NULL");
...@@ -676,10 +678,11 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner, ...@@ -676,10 +678,11 @@ static void MENU_CalcItemSize( HDC hdc, MENUITEM *lpitem, HWND hwndOwner,
{ {
MEASUREITEMSTRUCT mis; MEASUREITEMSTRUCT mis;
mis.CtlType = ODT_MENU; mis.CtlType = ODT_MENU;
mis.CtlID = 0;
mis.itemID = lpitem->wID; mis.itemID = lpitem->wID;
mis.itemData = (DWORD)lpitem->text; mis.itemData = (DWORD)lpitem->dwItemData;
mis.itemHeight = 16; mis.itemHeight = 0;
mis.itemWidth = 30; mis.itemWidth = 0;
SendMessageA( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis ); SendMessageA( hwndOwner, WM_MEASUREITEM, 0, (LPARAM)&mis );
lpitem->rect.bottom += mis.itemHeight; lpitem->rect.bottom += mis.itemHeight;
lpitem->rect.right += mis.itemWidth; lpitem->rect.right += mis.itemWidth;
...@@ -932,8 +935,9 @@ static void MENU_DrawMenuItem( HWND hwnd, HDC hdc, MENUITEM *lpitem, ...@@ -932,8 +935,9 @@ static void MENU_DrawMenuItem( HWND hwnd, HDC hdc, MENUITEM *lpitem,
DRAWITEMSTRUCT dis; DRAWITEMSTRUCT dis;
dis.CtlType = ODT_MENU; dis.CtlType = ODT_MENU;
dis.CtlID = 0;
dis.itemID = lpitem->wID; dis.itemID = lpitem->wID;
dis.itemData = (DWORD)lpitem->text; dis.itemData = (DWORD)lpitem->dwItemData;
dis.itemState = 0; dis.itemState = 0;
if (lpitem->fState & MF_CHECKED) dis.itemState |= ODS_CHECKED; if (lpitem->fState & MF_CHECKED) dis.itemState |= ODS_CHECKED;
if (lpitem->fState & MF_GRAYED) dis.itemState |= ODS_GRAYED; if (lpitem->fState & MF_GRAYED) dis.itemState |= ODS_GRAYED;
......
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