Commit ca7b0c86 authored by Mikołaj Zalewski's avatar Mikołaj Zalewski Committed by Alexandre Julliard

comctl32: toolbar: In CreateToolbarEx the default bitmap size is also 16x16.

parent 3d7a6535
......@@ -686,12 +686,13 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
/* set bitmap and button size */
/*If CreateToolbarEx receives 0, windows sets default values*/
if (dxBitmap <= 0)
if (dxBitmap < 0)
dxBitmap = 16;
if (dyBitmap <= 0)
dyBitmap = 15;
SendMessageW (hwndTB, TB_SETBITMAPSIZE, 0,
MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap));
if (dyBitmap < 0)
dyBitmap = 16;
if (dxBitmap == 0 || dyBitmap == 0)
dxBitmap = dyBitmap = 16;
SendMessageW(hwndTB, TB_SETBITMAPSIZE, 0, MAKELPARAM(dxBitmap, dyBitmap));
if (dxButton < 0)
dxButton = dxBitmap;
......
......@@ -807,7 +807,7 @@ static void test_sizes(void)
SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(3, 3));
ok(SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0) == MAKELONG(23, 22), "Unexpected button size\n");
check_sizes();
/* except for the first size, the default size is bitmap size + padding */
/* the default size is bitmap size + padding */
SendMessageA(hToolbar, TB_SETPADDING, 0, MAKELONG(1, 1));
SendMessageA(hToolbar, TB_SETBUTTONSIZE, 0, MAKELONG(3, 3));
ok(SendMessageA(hToolbar, TB_GETBUTTONSIZE, 0, 0) == MAKELONG(17, 17), "Unexpected button size\n");
......@@ -922,6 +922,18 @@ static void test_createtoolbarex()
CHECK_IMAGELIST(16, 16, 8);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xe0017, "%x");
DestroyWindow(hToolbar);
hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns,
3, 0, 0, 12, -1, sizeof(TBBUTTON));
CHECK_IMAGELIST(16, 12, 16);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x160013, "%x");
DestroyWindow(hToolbar);
hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns,
3, 0, 0, 0, 12, sizeof(TBBUTTON));
CHECK_IMAGELIST(16, 16, 16);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x160017, "%x");
DestroyWindow(hToolbar);
}
......
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