aboutsummaryrefslogtreecommitdiff
path: root/c
diff options
context:
space:
mode:
Diffstat (limited to 'c')
-rw-r--r--c/defs.h1
-rw-r--r--c/episodelistview.c24
-rw-r--r--c/listview.c15
3 files changed, 20 insertions, 20 deletions
diff --git a/c/defs.h b/c/defs.h
index 01e896d..f5feb3e 100644
--- a/c/defs.h
+++ b/c/defs.h
@@ -16,7 +16,6 @@ void LvSetTheme(HWND, int);
/* episodelistview.c */
HWND ElvCreate();
-void ElvEnter(LPLVITEM);
LRESULT ElvHandleNotify(LPARAM);
void ElvRedraw(void);
void ElvSetTop(int);
diff --git a/c/episodelistview.c b/c/episodelistview.c
index cf6f392..ea1d627 100644
--- a/c/episodelistview.c
+++ b/c/episodelistview.c
@@ -36,18 +36,6 @@ ElvCreate()
return HElv;
}
-void
-ElvEnter(LPLVITEM lpLvi)
-{
- fid_t f;
- term_t t;
- F(f);
- t = T(1);
- PI(t+0, lpLvi->lParam) goto b;
- P("local_episodes","open_episode",1,t);
-b: Fd(f);
-}
-
LRESULT
ElvHandleNotify(LPARAM lParam)
{
@@ -82,8 +70,17 @@ ElvHandleNotify(LPARAM lParam)
break;
}
case NM_DBLCLK:
- ElvEnter(LpLviElvSelection);
+ case NM_RETURN:
+ {
+ fid_t f;
+ term_t t;
+ F(f);
+ t = T(1);
+ PI(t+0, LpLviElvSelection->lParam) goto b;
+ P("local_episodes","open_episode",1,t);
+b: Fd(f);
break;
+ }
case NM_RCLICK:
{
DWORD dwPos;
@@ -98,7 +95,6 @@ ElvHandleNotify(LPARAM lParam)
return 0;
}
-
void
ElvRedraw()
{
diff --git a/c/listview.c b/c/listview.c
index 3025297..2c24048 100644
--- a/c/listview.c
+++ b/c/listview.c
@@ -47,18 +47,23 @@ LvProc(HWND hLv, UINT uMsg, WPARAM wParam, LPARAM lParam)
return TRUE;
}
break;
- case WM_GETDLGCODE: /* Open episode on Enter. */
+ case WM_GETDLGCODE:
{
LRESULT lResult;
extern HWND HElv;
extern LPLVITEM LpLviElvSelection;
+
+ /* 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.
+ */
+
if (hLv != HElv) break;
lResult = CallWindowProc(LvPrevProc, hLv, uMsg, wParam, lParam);
if (lParam && ((MSG *)lParam)->message == WM_KEYDOWN
- && ((MSG *)lParam)->wParam == VK_RETURN) {
- lResult &= ~DLGC_WANTMESSAGE;
- ElvEnter(LpLviElvSelection);
- }
+ && ((MSG *)lParam)->wParam == VK_RETURN)
+ return DLGC_WANTMESSAGE;
return lResult;
}
}