aboutsummaryrefslogtreecommitdiff
path: root/c/datalistview.cpp
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2022-07-17 18:07:40 +0200
committerJohn Ankarström <john@ankarstrom.se>2022-07-17 18:07:40 +0200
commite1906e8f45b732d83aca0935c59852c7aa64def9 (patch)
tree9456f5629d68c1bae7251cb44e2b01cd49532565 /c/datalistview.cpp
parentbb22bc506676fd268ded3b3d6c7b7acea5dc2db9 (diff)
downloadEpisodeBrowser-e1906e8f45b732d83aca0935c59852c7aa64def9.tar.gz
Make ListView hWnd public.
A getter offers encapsulation, but it is also less transparent in a sense. Thinking of ListView as a struct, it is natural to expose hWnd as a public member variable.
Diffstat (limited to 'c/datalistview.cpp')
-rw-r--r--c/datalistview.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/c/datalistview.cpp b/c/datalistview.cpp
index 6262c41..c83c65f 100644
--- a/c/datalistview.cpp
+++ b/c/datalistview.cpp
@@ -23,17 +23,17 @@ DataListView::DataListView(const HWND hWndParent)
lvc.pszText = TEXT("Key");
lvc.cx = Dpi(42);
- ListView_InsertColumn(m_hWnd, DLVSIKEY, &lvc);
+ ListView_InsertColumn(hWnd, DLVSIKEY, &lvc);
lvc.iSubItem = DLVSIVALUE;
lvc.pszText = TEXT("Value");
lvc.cx = 500;
- ListView_InsertColumn(m_hWnd, DLVSIVALUE, &lvc);
+ ListView_InsertColumn(hWnd, DLVSIVALUE, &lvc);
}
void DataListView::ShowEpisode(const int iEpisode)
{
- ListView_DeleteAllItems(m_hWnd);
+ ListView_DeleteAllItems(hWnd);
LVITEM lviKey, lviValue;
lviKey.mask = LVIF_TEXT;
@@ -55,12 +55,12 @@ void DataListView::ShowEpisode(const int iEpisode)
lviKey.iItem = i;
lviKey.iSubItem = 0;
lviKey.pszText = tszKey;
- ListView_InsertItem(m_hWnd, &lviKey);
+ ListView_InsertItem(hWnd, &lviKey);
lviValue.iItem = i;
lviValue.iSubItem = 1;
lviValue.pszText = tszValue;
- ListView_SetItem(m_hWnd, &lviValue);
+ ListView_SetItem(hWnd, &lviValue);
}
PL_cut_query(q);
@@ -69,7 +69,7 @@ void DataListView::ShowEpisode(const int iEpisode)
LVFINDINFO lvfi;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = iEpisode;
- int iItem = ListView_FindItem(g_pElv->Handle(), -1, &lvfi);
+ int iItem = ListView_FindItem(g_pElv->hWnd, -1, &lvfi);
if (iItem != -1)
- ListView_EnsureVisible(g_pElv->Handle(), iItem, TRUE);
+ ListView_EnsureVisible(g_pElv->hWnd, iItem, TRUE);
}