Commit 970029bb authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/toolbar: Fix TB_SETDRAWTEXTFLAGS handler.

parent 03d22add
...@@ -2367,6 +2367,47 @@ static void test_save(void) ...@@ -2367,6 +2367,47 @@ static void test_save(void)
RegCloseKey( key ); RegCloseKey( key );
} }
static void test_drawtext_flags(void)
{
HWND hwnd = NULL;
UINT flags;
rebuild_toolbar(&hwnd);
flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, 0, 0);
todo_wine
ok(flags == 0, "Unexpected draw text flags %#x\n", flags);
/* zero mask, flags are retained */
flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, 0, DT_BOTTOM);
todo_wine
ok(flags == 0, "Unexpected draw text flags %#x\n", flags);
ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n");
flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, 0, 0);
todo_wine
ok(flags == 0, "Unexpected draw text flags %#x\n", flags);
ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n");
/* set/remove */
flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, DT_BOTTOM, DT_BOTTOM);
todo_wine
ok(flags == 0, "Unexpected draw text flags %#x\n", flags);
ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n");
flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, DT_BOTTOM, 0);
todo_wine
ok(flags == DT_BOTTOM, "Unexpected draw text flags %#x\n", flags);
ok(flags & DT_BOTTOM, "Expected DT_BOTTOM style, %#x\n", flags);
flags = SendMessageA(hwnd, TB_SETDRAWTEXTFLAGS, DT_BOTTOM, 0);
todo_wine
ok(flags == 0, "Unexpected draw text flags %#x\n", flags);
ok(!(flags & DT_BOTTOM), "Unexpected DT_BOTTOM style\n");
DestroyWindow(hwnd);
}
START_TEST(toolbar) START_TEST(toolbar)
{ {
WNDCLASSA wc; WNDCLASSA wc;
...@@ -2411,6 +2452,7 @@ START_TEST(toolbar) ...@@ -2411,6 +2452,7 @@ START_TEST(toolbar)
test_TB_GET_SET_EXTENDEDSTYLE(); test_TB_GET_SET_EXTENDEDSTYLE();
test_noresize(); test_noresize();
test_save(); test_save();
test_drawtext_flags();
PostQuitMessage(0); PostQuitMessage(0);
while(GetMessageA(&msg,0,0,0)) { while(GetMessageA(&msg,0,0,0)) {
......
...@@ -4546,17 +4546,16 @@ TOOLBAR_SetDisabledImageList (TOOLBAR_INFO *infoPtr, WPARAM wParam, HIMAGELIST h ...@@ -4546,17 +4546,16 @@ TOOLBAR_SetDisabledImageList (TOOLBAR_INFO *infoPtr, WPARAM wParam, HIMAGELIST h
static LRESULT static LRESULT
TOOLBAR_SetDrawTextFlags (TOOLBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam) TOOLBAR_SetDrawTextFlags (TOOLBAR_INFO *infoPtr, DWORD mask, DWORD flags)
{ {
DWORD dwTemp; DWORD old_flags;
TRACE("hwnd = %p, dwMask = 0x%08x, dwDTFlags = 0x%08x\n", infoPtr->hwndSelf, (DWORD)wParam, (DWORD)lParam); TRACE("hwnd = %p, mask = 0x%08x, flags = 0x%08x\n", infoPtr->hwndSelf, mask, flags);
dwTemp = infoPtr->dwDTFlags; old_flags = infoPtr->dwDTFlags;
infoPtr->dwDTFlags = infoPtr->dwDTFlags = (old_flags & ~mask) | (flags & mask);
(infoPtr->dwDTFlags & (DWORD)wParam) | (DWORD)lParam;
return (LRESULT)dwTemp; return (LRESULT)old_flags;
} }
/* This function differs a bit from what MSDN says it does: /* This function differs a bit from what MSDN says it does:
......
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