aboutsummaryrefslogtreecommitdiff
path: root/c/listview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-29 21:20:44 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-29 21:20:44 +0200
commit2b8b6ac284dca2bd22514d293519cb877a1079d8 (patch)
treecf1a212a5be583d52d4965508218be358f6879e4 /c/listview.cpp
parentc883d9cf5673fe0af8d69120b048d642e122bdbb (diff)
downloadEpisodeBrowser-2b8b6ac284dca2bd22514d293519cb877a1079d8.tar.gz
Add ListView::FindNextItem.
This makes it much more ergonomic and less error-prone to look up list view items.
Diffstat (limited to 'c/listview.cpp')
-rw-r--r--c/listview.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/c/listview.cpp b/c/listview.cpp
index 62dfba8..b4a61b4 100644
--- a/c/listview.cpp
+++ b/c/listview.cpp
@@ -29,6 +29,14 @@ 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(int bHeader)
{