comctl32/listview: Fix a regression caused by 59148d0bb5
.
This commit is contained in:
parent
9c1a0e468f
commit
e014484a43
|
@ -1398,6 +1398,8 @@ static INT LISTVIEW_CreateHeader(LISTVIEW_INFO *infoPtr)
|
||||||
/* set header font */
|
/* set header font */
|
||||||
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE);
|
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, (LPARAM)TRUE);
|
||||||
|
|
||||||
|
LISTVIEW_UpdateSize(infoPtr);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1673,6 +1675,8 @@ static void LISTVIEW_UpdateHeaderSize(const LISTVIEW_INFO *infoPtr, INT nNewScro
|
||||||
|
|
||||||
TRACE("nNewScrollPos=%d\n", nNewScrollPos);
|
TRACE("nNewScrollPos=%d\n", nNewScrollPos);
|
||||||
|
|
||||||
|
if (!infoPtr->hwndHeader) return;
|
||||||
|
|
||||||
GetWindowRect(infoPtr->hwndHeader, &winRect);
|
GetWindowRect(infoPtr->hwndHeader, &winRect);
|
||||||
point[0].x = winRect.left;
|
point[0].x = winRect.left;
|
||||||
point[0].y = winRect.top;
|
point[0].y = winRect.top;
|
||||||
|
@ -8143,7 +8147,6 @@ static LRESULT LISTVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
|
||||||
{
|
{
|
||||||
ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL);
|
ShowWindow(infoPtr->hwndHeader, SW_SHOWNORMAL);
|
||||||
}
|
}
|
||||||
LISTVIEW_UpdateSize(infoPtr);
|
|
||||||
LISTVIEW_UpdateScroll(infoPtr);
|
LISTVIEW_UpdateScroll(infoPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9127,7 +9130,7 @@ static LRESULT LISTVIEW_Paint(LISTVIEW_INFO *infoPtr, HDC hdc)
|
||||||
LISTVIEW_UpdateScroll(infoPtr);
|
LISTVIEW_UpdateScroll(infoPtr);
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateWindow(infoPtr->hwndHeader);
|
if (infoPtr->hwndHeader) UpdateWindow(infoPtr->hwndHeader);
|
||||||
|
|
||||||
if (hdc)
|
if (hdc)
|
||||||
LISTVIEW_Refresh(infoPtr, hdc, NULL);
|
LISTVIEW_Refresh(infoPtr, hdc, NULL);
|
||||||
|
|
|
@ -903,14 +903,14 @@ static void test_create(void)
|
||||||
(GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_LIST) | LVS_REPORT);
|
(GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_LIST) | LVS_REPORT);
|
||||||
ok(((ret & WS_VISIBLE) && (ret & LVS_LIST)), "Style wrong, should have WS_VISIBLE|LVS_LIST\n");
|
ok(((ret & WS_VISIBLE) && (ret & LVS_LIST)), "Style wrong, should have WS_VISIBLE|LVS_LIST\n");
|
||||||
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
|
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
|
||||||
ok(IsWindow(hHeader), "Header shouldn't be created\n");
|
ok(IsWindow(hHeader), "Header should be created\n");
|
||||||
ok(hHeader == GetDlgItem(hList, 0), "NULL dialog item expected\n");
|
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
|
||||||
ret = SetWindowLongPtr(hList, GWL_STYLE,
|
ret = SetWindowLongPtr(hList, GWL_STYLE,
|
||||||
(GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_REPORT) | LVS_LIST);
|
(GetWindowLongPtr(hList, GWL_STYLE) & ~LVS_REPORT) | LVS_LIST);
|
||||||
ok(((ret & WS_VISIBLE) && (ret & LVS_REPORT)), "Style wrong, should have WS_VISIBLE|LVS_REPORT\n");
|
ok(((ret & WS_VISIBLE) && (ret & LVS_REPORT)), "Style wrong, should have WS_VISIBLE|LVS_REPORT\n");
|
||||||
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
|
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
|
||||||
ok(IsWindow(hHeader), "Header shouldn't be created\n");
|
ok(IsWindow(hHeader), "Header should be created\n");
|
||||||
ok(hHeader == GetDlgItem(hList, 0), "NULL dialog item expected\n");
|
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
|
||||||
DestroyWindow(hList);
|
DestroyWindow(hList);
|
||||||
|
|
||||||
/* LVS_REPORT without WS_VISIBLE */
|
/* LVS_REPORT without WS_VISIBLE */
|
||||||
|
@ -941,6 +941,16 @@ static void test_create(void)
|
||||||
ok(IsWindow(hHeader), "Header should be created\n");
|
ok(IsWindow(hHeader), "Header should be created\n");
|
||||||
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
|
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
|
||||||
DestroyWindow(hList);
|
DestroyWindow(hList);
|
||||||
|
|
||||||
|
/* LVS_REPORT with LVS_NOCOLUMNHEADER */
|
||||||
|
hList = CreateWindow("SysListView32", "Test", LVS_REPORT|LVS_NOCOLUMNHEADER|WS_VISIBLE,
|
||||||
|
0, 0, 100, 100, NULL, NULL, GetModuleHandle(NULL), 0);
|
||||||
|
hHeader = (HWND)SendMessage(hList, LVM_GETHEADER, 0, 0);
|
||||||
|
ok(IsWindow(hHeader), "Header should be created\n");
|
||||||
|
ok(hHeader == GetDlgItem(hList, 0), "Expected header as dialog item\n");
|
||||||
|
/* HDS_DRAGDROP set by default */
|
||||||
|
ok(GetWindowLongPtr(hHeader, GWL_STYLE) & HDS_DRAGDROP, "Expected header to have HDS_DRAGDROP\n");
|
||||||
|
DestroyWindow(hList);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void test_redraw(void)
|
static void test_redraw(void)
|
||||||
|
|
Loading…
Reference in New Issue