From 2ac7d06a503b256b290678f5bba158bf7d219bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Thu, 4 Aug 2022 16:26:27 +0200 Subject: Add comments. --- c/listview.cpp | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'c/listview.cpp') diff --git a/c/listview.cpp b/c/listview.cpp index bd92246..82c6df6 100644 --- a/c/listview.cpp +++ b/c/listview.cpp @@ -5,11 +5,14 @@ #include "layout.h" #include "win.h" -extern HFONT g_hfNormal; +/* Actual window procedure for all list views, which calls the + * appropriate WndProc member function. */ static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle) { + extern HFONT g_hfNormal; + m_hWndParent = hWndParent; hWnd = Require(CreateWindowEx( WS_EX_CLIENTEDGE, @@ -25,15 +28,6 @@ ListView::ListView(const HWND hWndParent, const HMENU hMenu, const DWORD dwStyle SendMessage(hWnd, WM_SETFONT, (WPARAM)g_hfNormal, MAKELPARAM(FALSE, 0)); } -/* Retrieve next matching list view item. */ -bool ListView::FindNextItem(LVITEM* const lvi, const LPARAM lParam) -{ - if ((lvi->iItem = ListView_GetNextItem(hWnd, lvi->iItem, lParam)) == -1) - return false; - return ListView_GetItem(hWnd, lvi); -} - -/* Naively calculate height of list view. */ int ListView::Height() { const int cItem = ListView_GetItemCount(hWnd); -- cgit v1.2.3