Commit 9618aae3 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

comctl32/tooltips: Fix TTM_GETMARGIN/TTM_SETMARGIN handling.

parent 887db340
......@@ -1010,6 +1010,43 @@ static void test_setinfo(void)
DestroyWindow(parent2);
}
static void test_margin(void)
{
RECT r, r1;
HWND hwnd;
DWORD ret;
hwnd = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, 0,
10, 10, 300, 100,
NULL, NULL, NULL, 0);
ok(hwnd != NULL, "failed to create tooltip wnd\n");
ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);
ok(!ret, "got %d\n", ret);
SetRect(&r, -1, -1, 1, 1);
ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, (LPARAM)&r);
ok(!ret, "got %d\n", ret);
SetRect(&r1, 0, 0, 0, 0);
ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);
ok(!ret, "got %d\n", ret);
ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
ret = SendMessageA(hwnd, TTM_SETMARGIN, 0, 0);
ok(!ret, "got %d\n", ret);
SetRect(&r1, 0, 0, 0, 0);
ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, (LPARAM)&r1);
ok(!ret, "got %d\n", ret);
ok(EqualRect(&r, &r1), "got %s, was %s\n", wine_dbgstr_rect(&r1), wine_dbgstr_rect(&r));
ret = SendMessageA(hwnd, TTM_GETMARGIN, 0, 0);
ok(!ret, "got %d\n", ret);
DestroyWindow(hwnd);
}
START_TEST(tooltips)
{
InitCommonControls();
......@@ -1022,4 +1059,5 @@ START_TEST(tooltips)
test_longtextW();
test_track();
test_setinfo();
test_margin();
}
......@@ -1323,12 +1323,10 @@ TOOLTIPS_GetDelayTime (const TOOLTIPS_INFO *infoPtr, DWORD duration)
static LRESULT
TOOLTIPS_GetMargin (const TOOLTIPS_INFO *infoPtr, LPRECT lpRect)
TOOLTIPS_GetMargin (const TOOLTIPS_INFO *infoPtr, RECT *rect)
{
lpRect->left = infoPtr->rcMargin.left;
lpRect->right = infoPtr->rcMargin.right;
lpRect->bottom = infoPtr->rcMargin.bottom;
lpRect->top = infoPtr->rcMargin.top;
if (rect)
*rect = infoPtr->rcMargin;
return 0;
}
......@@ -1600,12 +1598,10 @@ TOOLTIPS_SetDelayTime (TOOLTIPS_INFO *infoPtr, DWORD duration, INT nTime)
static LRESULT
TOOLTIPS_SetMargin (TOOLTIPS_INFO *infoPtr, const RECT *lpRect)
TOOLTIPS_SetMargin (TOOLTIPS_INFO *infoPtr, const RECT *rect)
{
infoPtr->rcMargin.left = lpRect->left;
infoPtr->rcMargin.right = lpRect->right;
infoPtr->rcMargin.bottom = lpRect->bottom;
infoPtr->rcMargin.top = lpRect->top;
if (rect)
infoPtr->rcMargin = *rect;
return 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