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

comctl32: CreateToolbarEx should send TB_SETBITMAPSIZE twice.

parent 4893b157
...@@ -693,12 +693,13 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps, ...@@ -693,12 +693,13 @@ CreateToolbarEx (HWND hwnd, DWORD style, UINT wID, INT nBitmaps,
SendMessageW (hwndTB, TB_SETBITMAPSIZE, 0, SendMessageW (hwndTB, TB_SETBITMAPSIZE, 0,
MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap)); MAKELPARAM((WORD)dxBitmap, (WORD)dyBitmap));
if (dxButton <= 0) if (dxButton < 0)
dxButton = 24; dxButton = dxBitmap;
if (dyButton <= 0) if (dyButton < 0)
dyButton = 22; dyButton = dyBitmap;
SendMessageW (hwndTB, TB_SETBUTTONSIZE, 0, /* TB_SETBUTTONSIZE -> TB_SETBITMAPSIZE bug introduced for Windows compatibility */
MAKELPARAM((WORD)dxButton, (WORD)dyButton)); if (dxButton != 0 && dyButton != 0)
SendMessageW(hwndTB, TB_SETBITMAPSIZE, 0, MAKELPARAM(dxButton, dyButton));
/* add bitmaps */ /* add bitmaps */
......
...@@ -869,6 +869,45 @@ static void test_sizes(void) ...@@ -869,6 +869,45 @@ static void test_sizes(void)
DestroyWindow(hToolbar); DestroyWindow(hToolbar);
} }
static void test_createtoolbarex()
{
HWND hToolbar;
TBBUTTON btns[3];
ZeroMemory(&btns, sizeof(btns));
hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns,
3, 20, 20, 16, 16, sizeof(TBBUTTON));
CHECK_IMAGELIST(16, 20, 20);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x1a001b, "%x");
DestroyWindow(hToolbar);
hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns,
3, 4, 4, 16, 16, sizeof(TBBUTTON));
CHECK_IMAGELIST(32, 4, 4);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xa000b, "%x");
DestroyWindow(hToolbar);
hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns,
3, 0, 8, 12, 12, sizeof(TBBUTTON));
CHECK_IMAGELIST(16, 12, 12);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0x120013, "%x");
DestroyWindow(hToolbar);
hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns,
3, -1, 8, 12, 12, sizeof(TBBUTTON));
CHECK_IMAGELIST(16, 12, 8);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xe0013, "%x");
DestroyWindow(hToolbar);
hToolbar = CreateToolbarEx(hMainWnd, WS_VISIBLE, 1, 16, GetModuleHandle(NULL), IDB_BITMAP_128x15, btns,
3, -1, 8, -1, 12, sizeof(TBBUTTON));
CHECK_IMAGELIST(16, 16, 8);
compare((int)SendMessage(hToolbar, TB_GETBUTTONSIZE, 0, 0), 0xe0017, "%x");
DestroyWindow(hToolbar);
}
START_TEST(toolbar) START_TEST(toolbar)
{ {
WNDCLASSA wc; WNDCLASSA wc;
...@@ -899,6 +938,7 @@ START_TEST(toolbar) ...@@ -899,6 +938,7 @@ START_TEST(toolbar)
test_add_string(); test_add_string();
test_hotitem(); test_hotitem();
test_sizes(); test_sizes();
test_createtoolbarex();
PostQuitMessage(0); PostQuitMessage(0);
while(GetMessageA(&msg,0,0,0)) { while(GetMessageA(&msg,0,0,0)) {
......
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