mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-30 05:31:39 +00:00
comctl32/listview: Ignore the lParam to WM_PRINTCLIENT and add tests.
Based on simliar patch for comctl32/treeview: 231199bc46
WM_PRINTCLIENT paints the items of a listview, including the item
backgrounds, but never the listview background.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=54878
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=55005
Co-authored-by: Bernhard Übelacker <bernhardu@mailbox.org>
This commit is contained in:
parent
af45d28625
commit
4e95553a2d
|
@ -10832,17 +10832,9 @@ static inline LRESULT LISTVIEW_WMPaint(LISTVIEW_INFO *infoPtr, HDC hdc)
|
|||
*/
|
||||
static LRESULT LISTVIEW_PrintClient(LISTVIEW_INFO *infoPtr, HDC hdc, DWORD options)
|
||||
{
|
||||
if ((options & PRF_CHECKVISIBLE) && !IsWindowVisible(infoPtr->hwndSelf))
|
||||
return 0;
|
||||
FIXME("(hdc=%p options=%#lx) partial stub\n", hdc, options);
|
||||
|
||||
if (options & ~(PRF_ERASEBKGND|PRF_CLIENT))
|
||||
FIXME("(hdc=%p options %#lx) partial stub\n", hdc, options);
|
||||
|
||||
if (options & PRF_ERASEBKGND)
|
||||
LISTVIEW_EraseBkgnd(infoPtr, hdc);
|
||||
|
||||
if (options & PRF_CLIENT)
|
||||
LISTVIEW_Paint(infoPtr, hdc);
|
||||
LISTVIEW_Paint(infoPtr, hdc);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -5978,6 +5978,60 @@ static void test_LVM_REDRAWITEMS(void)
|
|||
DestroyWindow(list);
|
||||
}
|
||||
|
||||
static void test_WM_PRINTCLIENT(void)
|
||||
{
|
||||
static const int states[] = {SW_HIDE, SW_SHOW};
|
||||
static const LPARAM params[] = {0, PRF_CHECKVISIBLE, PRF_NONCLIENT, PRF_CLIENT, PRF_ERASEBKGND,
|
||||
PRF_CHILDREN, PRF_OWNED};
|
||||
const DWORD list_background = RGB(255, 0, 0);
|
||||
const DWORD text_background = RGB(0, 0, 255);
|
||||
HWND hList;
|
||||
COLORREF clr;
|
||||
LONG ret;
|
||||
RECT rc;
|
||||
HDC hdc;
|
||||
int i, j;
|
||||
|
||||
hList = create_listview_control(LVS_LIST);
|
||||
insert_item(hList, 0);
|
||||
|
||||
ret = SendMessageA(hList, LVM_SETBKCOLOR, 0, list_background);
|
||||
ok(ret == TRUE, "got 0x%lx, expected 0x%x\n", ret, TRUE);
|
||||
|
||||
ret = SendMessageA(hList, LVM_SETTEXTBKCOLOR, 0, text_background);
|
||||
ok(ret == TRUE, "got 0x%lx, expected 0x%x\n", ret, TRUE);
|
||||
|
||||
hdc = GetDC(hwndparent);
|
||||
GetClientRect(hwndparent, &rc);
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(states); i++)
|
||||
{
|
||||
ShowWindow(hList, states[i]);
|
||||
|
||||
for (j = 0; j < ARRAY_SIZE(params); j++)
|
||||
{
|
||||
winetest_push_context("state=%d lParam=0x%Ix", states[i], params[j]);
|
||||
|
||||
FillRect(hdc, &rc, GetStockObject(BLACK_BRUSH));
|
||||
clr = GetPixel(hdc, 1, 1);
|
||||
ok(clr == RGB(0, 0, 0), "got 0x%lx\n", clr);
|
||||
clr = GetPixel(hdc, 50, 1);
|
||||
ok(clr == RGB(0, 0, 0), "got 0x%lx\n", clr);
|
||||
ret = SendMessageA(hList, WM_PRINTCLIENT, (WPARAM)hdc, params[j]);
|
||||
ok(ret == 0, "got %ld\n", ret);
|
||||
clr = GetPixel(hdc, 1, 1);
|
||||
ok(clr == text_background, "got 0x%lx\n", clr);
|
||||
clr = GetPixel(hdc, 50, 1);
|
||||
ok(clr == RGB(0, 0, 0), "got 0x%lx\n", clr);
|
||||
|
||||
winetest_pop_context();
|
||||
}
|
||||
}
|
||||
|
||||
ReleaseDC(hwndparent, hdc);
|
||||
DestroyWindow(hList);
|
||||
}
|
||||
|
||||
static void test_imagelists(void)
|
||||
{
|
||||
HWND hwnd, header;
|
||||
|
@ -7153,6 +7207,7 @@ START_TEST(listview)
|
|||
test_dispinfo();
|
||||
test_LVM_SETITEMTEXT();
|
||||
test_LVM_REDRAWITEMS();
|
||||
test_WM_PRINTCLIENT();
|
||||
test_imagelists();
|
||||
test_deleteitem();
|
||||
test_insertitem();
|
||||
|
@ -7205,6 +7260,7 @@ START_TEST(listview)
|
|||
test_dispinfo();
|
||||
test_LVM_SETITEMTEXT();
|
||||
test_LVM_REDRAWITEMS();
|
||||
test_WM_PRINTCLIENT();
|
||||
test_oneclickactivate();
|
||||
test_state_image();
|
||||
test_LVSCW_AUTOSIZE();
|
||||
|
|
Loading…
Reference in a new issue