From bc4cef92d8efbf97a9215122abc2d7247c287f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Fri, 2 Sep 2022 20:16:04 +0200 Subject: Improve Window object. --- c/episodelistview.cpp | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'c/episodelistview.cpp') diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp index ea4849f..29c015b 100644 --- a/c/episodelistview.cpp +++ b/c/episodelistview.cpp @@ -3,15 +3,15 @@ #include #include -#include "resource.h" #include "data.h" #include "datalistview.h" #include "episodelistview.h" #include "ext.h" #include "listview.h" -#include "main.h" +#include "resource.h" #include "util.h" -#include "win.h" +#include "win32.h" +#include "window.h" EpisodeListView::EpisodeListView(Window& parent) : ListView(parent, reinterpret_cast(IDC_EPISODELISTVIEW), 0) @@ -66,12 +66,12 @@ void EpisodeListView::HandleContextMenu(const WORD command) /* Process other commands. */ switch (command) { case IDM_WATCH_LOCALLY: - if(!OpenLocally(lvi.lParam)) + if(!OpenLocally(parent.cfg, parent.fvElv.At(lvi.lParam-1))) cNotFound++; break; case IDM_WATCH_ONLINE: - OpenOnline(lvi.lParam); + OpenOnline(parent.cfg, lvi.lParam); break; case IDM_TOGGLE: @@ -79,7 +79,7 @@ void EpisodeListView::HandleContextMenu(const WORD command) break; case IDM_WIKI: - OpenWiki(lvi.lParam); + OpenWiki(parent.fvDlv.At(lvi.lParam-1)); break; } } @@ -176,15 +176,14 @@ LRESULT EpisodeListView::HandleNotify(const LPARAM lParam) { LVITEM lvi = {LVIF_PARAM, -1}; while (FindNextItem(&lvi, LVNI_SELECTED)) - OpenLocally(lvi.lParam) || OpenOnline(lvi.lParam); + OpenLocally(parent.cfg, parent.fvElv.At(lvi.lParam-1)) || OpenOnline(parent.cfg, lvi.lParam); return 0; } case NM_RCLICK: { - extern HMENU g_hMenuPopup; const DWORD pos = GetMessagePos(); - Require(TrackPopupMenu(g_hMenuPopup, TPM_RIGHTBUTTON, + Require(TrackPopupMenu(parent.hMenuPopup, TPM_RIGHTBUTTON, LOWORD(pos), HIWORD(pos), 0, parent.hWnd, nullptr)); return 0; } @@ -415,7 +414,7 @@ void EpisodeListView::Update() /* Show number of displayed items in status bar. */ wchar_t disp[16]; Swprintf(disp, L"%d", cItem); - Status(disp, 1); + parent.Status(disp, 1); } Sort(); -- cgit v1.2.3