aboutsummaryrefslogtreecommitdiff
path: root/c/episodelistview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'c/episodelistview.cpp')
-rw-r--r--c/episodelistview.cpp60
1 files changed, 35 insertions, 25 deletions
diff --git a/c/episodelistview.cpp b/c/episodelistview.cpp
index 8fb3ec7..7c79043 100644
--- a/c/episodelistview.cpp
+++ b/c/episodelistview.cpp
@@ -155,6 +155,16 @@ EpisodeListView::Redraw()
}
void
+EpisodeListView::SaveFocus()
+{
+ LVITEM lvi;
+ lvi.mask = LVIF_PARAM;
+ if ((lvi.iItem = ListView_GetNextItem(m_hWnd, -1, LVNI_FOCUSED)) != -1
+ && ListView_GetItem(m_hWnd, &lvi))
+ Pl("cfg","set_focus","I",lvi.lParam);
+}
+
+void
EpisodeListView::SetTop(int iItem)
{
int iLast;
@@ -165,7 +175,7 @@ EpisodeListView::SetTop(int iItem)
/* Select previously focused episode. */
void
-EpisodeListView::SelectFocus()
+EpisodeListView::RestoreFocus()
{
int i, iEpisode, iItem;
LVFINDINFO lvfi;
@@ -388,6 +398,30 @@ r: if (!Pl("episode_data","episode_rating","Ii",lpLvi->lParam,&iRating)) {
f: if (tszName) free(tszName);
}
+LRESULT CALLBACK
+EpisodeListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
+{
+ switch (uMsg) {
+ case WM_GETDLGCODE:
+ {
+ LRESULT lResult;
+
+ /* For the episode list view, the Enter key should not
+ * be handled by the dialog manager, but instead be sent
+ * along to the main window procedure, so that it may be
+ * handled by the NM_RETURN case in ElvHandleNotify. */
+
+ lResult = CallWindowProc(m_prevProc, hWnd, uMsg, wParam, lParam);
+ if (lParam && ((MSG *)lParam)->message == WM_KEYDOWN
+ && ((MSG *)lParam)->wParam == VK_RETURN)
+ return DLGC_WANTMESSAGE;
+ return lResult;
+ }
+ }
+
+ return ListView::WndProc(hWnd, uMsg, wParam, lParam);
+}
+
/* Sort list view items, iSort being the 1-based index of the column
* to sort by. If iSort is negative, the order is descending. */
int CALLBACK
@@ -434,27 +468,3 @@ ElvSort(LPARAM iItem1, LPARAM iItem2, LPARAM iSort)
return 0;
}
}
-
-LRESULT CALLBACK
-EpisodeListView::WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
-{
- switch (uMsg) {
- case WM_GETDLGCODE:
- {
- LRESULT lResult;
-
- /* For the episode list view, the Enter key should not
- * be handled by the dialog manager, but instead be sent
- * along to the main window procedure, so that it may be
- * handled by the NM_RETURN case in ElvHandleNotify. */
-
- lResult = CallWindowProc(m_prevProc, hWnd, uMsg, wParam, lParam);
- if (lParam && ((MSG *)lParam)->message == WM_KEYDOWN
- && ((MSG *)lParam)->wParam == VK_RETURN)
- return DLGC_WANTMESSAGE;
- return lResult;
- }
- }
-
- return ListView::WndProc(hWnd, uMsg, wParam, lParam);
-}