/* the tests should however succeed on win2000, XP and Wine (at least up to 1.1.15) */
/* with a variety of dpis and desktop font sizes */
{
- /* check menu width */
- if( ispop)
- expect = ( text || hbmp ?
- 4 + (mnuopt != 1 ? GetSystemMetrics(SM_CXMENUCHECK) : 0)
- : 0) +
+ /* check menu width */
+ if( ispop)
+ expect = ( text || hbmp ?
+ 4 + (mnuopt != 1 ? GetSystemMetrics(SM_CXMENUCHECK) : 0)
+ : 0) +
arrowwidth + MOD_avec + (hbmp ?
((INT_PTR)hbmp<0||(INT_PTR)hbmp>12 ? bmpsize.cx + 2 : GetSystemMetrics( SM_CXMENUSIZE) + 2)
: 0) +
- (text && hastab ? /* TAB space */
- MOD_avec + ( hastab==2 ? sc_size.cx : 0) : 0) +
- (text ? 2 + (text[0] ? size.cx :0): 0) ;
- else
- expect = !(text || hbmp) ? 0 :
- ( hbmp ? (text ? 2:0) + bmpsize.cx : 0 ) +
- (text ? 2 * MOD_avec + (text[0] ? size.cx :0): 0) ;
- ok( rc.right - rc.left == expect,
+ (text && hastab ? /* TAB space */
+ MOD_avec + ( hastab==2 ? sc_size.cx : 0) : 0) +
+ (text ? 2 + (text[0] ? size.cx :0): 0) ;
+ else
+ expect = !(text || hbmp) ? 0 :
+ ( hbmp ? (text ? 2:0) + bmpsize.cx : 0 ) +
+ (text ? 2 * MOD_avec + (text[0] ? size.cx :0): 0) ;
+ ok( rc.right - rc.left == expect,
"menu width wrong, got %d expected %d\n", rc.right - rc.left, expect);
- failed = failed || !(rc.right - rc.left == expect);
- /* check menu height */
- if( ispop)
- expect = max( ( !(text || hbmp) ? GetSystemMetrics( SM_CYMENUSIZE)/2 : 0),
- max( (text ? max( 2 + size.cy, MOD_hic + 4) : 0),
+ failed = failed || !(rc.right - rc.left == expect);
+ /* check menu height */
+ if( ispop)
+ expect = max( ( !(text || hbmp) ? GetSystemMetrics( SM_CYMENUSIZE)/2 : 0),
+ max( (text ? max( 2 + size.cy, MOD_hic + 4) : 0),
(hbmp ?
((INT_PTR)hbmp<0||(INT_PTR)hbmp>12 ?
bmpsize.cy + 2
: GetSystemMetrics( SM_CYMENUSIZE) + 2)
: 0)));
- else
- expect = ( !(text || hbmp) ? GetSystemMetrics( SM_CYMENUSIZE)/2 :
- max( GetSystemMetrics( SM_CYMENU) - 1, (hbmp ? bmpsize.cy : 0)));
- ok( rc.bottom - rc.top == expect,
+ else
+ expect = ( !(text || hbmp) ? GetSystemMetrics( SM_CYMENUSIZE)/2 :
+ max( GetSystemMetrics( SM_CYMENU) - 1, (hbmp ? bmpsize.cy : 0)));
+ ok( rc.bottom - rc.top == expect,
"menu height wrong, got %d expected %d (%d)\n",
rc.bottom - rc.top, expect, GetSystemMetrics( SM_CYMENU));
- failed = failed || !(rc.bottom - rc.top == expect);
- if( hbmp == HBMMENU_CALLBACK && MOD_GotDrawItemMsg) {
- /* check the position of the bitmap */
- /* horizontal */
+ failed = failed || !(rc.bottom - rc.top == expect);
+ if( hbmp == HBMMENU_CALLBACK && MOD_GotDrawItemMsg) {
+ /* check the position of the bitmap */
+ /* horizontal */
if (!ispop)
expect = 3;
else if (mnuopt == 0)
expect = 4;
else /* mnuopt == 2 */
expect = 2;
- ok( expect == MOD_rc[0].left,
+ 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;
- ok( expect == MOD_rc[0].top,
+ failed = failed || !(expect == MOD_rc[0].left);
+ /* vertical */
+ expect = (rc.bottom - rc.top - MOD_rc[0].bottom + MOD_rc[0].top) / 2;
+ ok( expect == MOD_rc[0].top,
"bitmap top is %d expected %d\n", MOD_rc[0].top, expect);
- failed = failed || !(expect == MOD_rc[0].top);
- }
+ failed = failed || !(expect == MOD_rc[0].top);
+ }
}
/* if there was a failure, report details */
if( failed) {
{
ok_(__FILE__, line)( !ret, "GetMenuItemInfo should have failed.\n" );
return;
- }
+}
ok_(__FILE__, line)( ret, "GetMenuItemInfo failed, err %u\n", GetLastError());
if (mask & MIIM_TYPE)
ok_(__FILE__, line)( info.fType == type || info.fType == LOWORD(type),
#define TMII_INSMI( c1,d1,e1,f1,g1,h1,i1,j1,k1,l1,m1,eret1 )\
hmenu = CreateMenu();\
submenu = CreateMenu();\
- if(ansi)strcpy( string, init );\
+ if(ansi)strcpy( string, init);\
else strcpyW( string, init );\
insert_menu_item( __LINE__, hmenu, ansi, c1, d1, e1, f1, g1, h1, i1, j1, k1, l1, m1, eret1 )
0, 0, 0, 0, 0, 0, 0, string, 80, 0,
init, OK, OK );
TMII_DONE
- /* some tests with small cbSize: the hbmpItem is to be ignored */
+ /* some tests with small cbSize: the hbmpItem is to be ignored */
TMII_INSMI( MIIM_BITMAP, -1, -1, -1, 0, 0, 0, -1, 0, -1, dummy_hbm, OK );
TMII_GMII ( MIIM_TYPE, 80,
MFT_SEPARATOR, 0, 0, 0, 0, 0, 0, NULL, 0, NULL,
wclass.hInstance = hInstance;
wclass.hIcon = LoadIconA( 0, IDI_APPLICATION );
wclass.hCursor = LoadCursorA( NULL, IDC_ARROW );
- wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
+ wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1);
wclass.lpszMenuName = 0;
wclass.cbClsExtra = 0;
wclass.cbWndExtra = 0;
wclass.hInstance = GetModuleHandleA( NULL );
wclass.hIcon = LoadIconA( 0, IDI_APPLICATION );
wclass.hCursor = LoadCursorA( NULL, IDC_ARROW );
- wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1 );
+ wclass.hbrBackground = (HBRUSH)( COLOR_WINDOW + 1);
wclass.lpszMenuName = 0;
wclass.cbClsExtra = 0;
wclass.cbWndExtra = 0;