user32: Use the correct bitmap location for MNS_CHECKORBMP.

This commit is contained in:
Vincent Povirk 2008-09-04 15:38:43 -05:00 committed by Alexandre Julliard
parent f4ba76e1d1
commit 3c4f44d1af
2 changed files with 8 additions and 10 deletions

View file

@ -1504,11 +1504,13 @@ static void MENU_DrawMenuItem( HWND hwnd, HMENU hmenu, HWND hwndOwner, HDC hdc,
bmprc.left = 3;
else
bmprc.left = lpitem->text ? menucharsize.cx : 0;
} else {
bmprc.left = 4;
if( !(menu->dwStyle & ( MNS_CHECKORBMP | MNS_NOCHECK)))
bmprc.left += GetSystemMetrics( SM_CXMENUCHECK);
}
else if (menu->dwStyle & MNS_NOCHECK)
bmprc.left = 4;
else if (menu->dwStyle & MNS_CHECKORBMP)
bmprc.left = 2;
else
bmprc.left = 4 + GetSystemMetrics(SM_CXMENUCHECK);
bmprc.right = bmprc.left + lpitem->bmpsize.cx;
if( menuBar && !(lpitem->hbmpItem == HBMMENU_CALLBACK))
bmprc.top = 0;

View file

@ -456,12 +456,8 @@ static void test_mbs_help( int ispop, int hassub, int mnuopt,
expect = 4;
else /* mnuopt == 2 */
expect = 2;
if (ispop && mnuopt == 2)
todo_wine ok( expect == MOD_rc[0].left,
"bitmap left is %d expected %d\n", MOD_rc[0].left, expect);
else
ok( expect == MOD_rc[0].left,
"bitmap left is %d expected %d\n", MOD_rc[0].left, expect);
ok( expect == MOD_rc[0].left,
"bitmap left is %d expected %d\n", MOD_rc[0].left, expect);
failed = failed || !(expect == MOD_rc[0].left);
/* vertical */
expect = (rc.bottom - rc.top - MOD_rc[0].bottom + MOD_rc[0].top) / 2;