aboutsummaryrefslogtreecommitdiff
path: root/c/listview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-08-03 19:11:15 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-08-03 19:11:15 +0200
commit5fb8df682831045c4619b65403c4a24d7583d2e9 (patch)
treed84973aa41a6e7f5230a9510c467321e0dd88433 /c/listview.cpp
parentdf88618efb32274e7b21493c48483d4761d2f9a3 (diff)
downloadEpisodeBrowser-5fb8df682831045c4619b65403c4a24d7583d2e9.tar.gz
Remove m_bHeader from ListView.
If it is relevant to add height for a header for a given list view, it is better to override Height and do it there.
Diffstat (limited to 'c/listview.cpp')
-rw-r--r--c/listview.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/c/listview.cpp b/c/listview.cpp
index c2f5593..e5d22b2 100644
--- a/c/listview.cpp
+++ b/c/listview.cpp
@@ -11,19 +11,16 @@ static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle)
{
m_hWndParent = hWndParent;
- m_bHeader = !(dwStyle & LVS_NOCOLUMNHEADER);
hWnd = require(CreateWindowEx(
WS_EX_CLIENTEDGE,
WC_LISTVIEW,
L"",
dwStyle|WS_CHILD|WS_VISIBLE|WS_VSCROLL|WS_TABSTOP|LVS_REPORT|LVS_SHOWSELALWAYS,
0, 0, 0, 0,
- m_hWndParent, hMenu, GetModuleHandle(NULL), this));
-
- if (require(SetProp(hWnd, L"this", (HANDLE)this)))
- m_proc0 = (WNDPROC)SetWindowLongPtr(hWnd,
- GWLP_WNDPROC, (LONG_PTR)::WndProc);
+ hWndParent, hMenu, GetModuleHandle(NULL), this));
+ m_proc0 = (WNDPROC)SetWindowLongPtr(hWnd, GWLP_WNDPROC, (LONG_PTR)::WndProc);
+ require(SetProp(hWnd, L"this", (HANDLE)this));
ListView_SetExtendedListViewStyle(hWnd, LVS_EX_FULLROWSELECT|LVS_EX_DOUBLEBUFFER);
SendMessage(hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0));
}
@@ -37,12 +34,10 @@ bool ListView::FindNextItem(LVITEM* const lvi, const LPARAM lParam)
}
/* Naively calculate height of list view. */
-int ListView::Height(int bHeader)
+int ListView::Height()
{
- if (bHeader == -1)
- bHeader = m_bHeader;
const int cItem = ListView_GetItemCount(hWnd);
- return cItem? Dpi(bHeader? 27: 4)+cItem*Dpi(19): 0;
+ return Dpi(4)+cItem*Dpi(19);
}
void ListView::ResizeColumns(int) {}