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.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'c/listview.h') diff --git a/c/listview.h b/c/listview.h index 1de6cc1..008f995 100644 --- a/c/listview.h +++ b/c/listview.h @@ -9,9 +9,14 @@ struct ListView HWND hWnd; ListView(HWND hWndParent, HMENU hMenu, DWORD dwStyle); + /* Retrieve next matching list view item. */ bool FindNextItem(LVITEM* lvi, LPARAM lParam); + /* Naively calculate height appropriate for number of items. */ virtual int Height(); + /* Update column widths on window size change (unimplemented + * by default). */ virtual void ResizeColumns(int w); + /* Enable/disable "modern" theme. */ virtual void UpdateTheme(BOOL bThemeActive); virtual LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); protected: @@ -19,4 +24,11 @@ protected: HWND m_hWndParent; }; +inline 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); +} + #endif -- cgit v1.2.3