From 6b2c295fdc6d71daca898dcf2c38aabf9f29db6a Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 1 Dec 2014 15:34:26 -0500 Subject: [PATCH] Isolated vertical scroll messages with the other vertical scroll code. --- wintable/main.c | 7 +------ wintable/vscroll.h | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/wintable/main.c b/wintable/main.c index 7d70446..aa92520 100644 --- a/wintable/main.c +++ b/wintable/main.c @@ -104,6 +104,7 @@ struct table { typedef BOOL (*handlerfunc)(struct table *, UINT, WPARAM, LPARAM, LRESULT *); const handlerfunc handlerfuncs[] = { + vscrollHandler, APIHandler, NULL, }; @@ -175,12 +176,6 @@ if (ImageList_GetIconSize(t->imagelist, &unused, &(t->imagelistHeight)) == 0)abo drawItems(t, dc, ps.rcPaint); EndPaint(hwnd, &ps); return 0; - case WM_VSCROLL: - vscroll(t, wParam); - return 0; - case WM_MOUSEWHEEL: - wheelscroll(t, wParam); - return 0; case WM_HSCROLL: hscroll(t, wParam); return 0; diff --git a/wintable/vscroll.h b/wintable/vscroll.h index 7f2d912..326d853 100644 --- a/wintable/vscroll.h +++ b/wintable/vscroll.h @@ -95,3 +95,18 @@ static void vscroll(struct table *t, WPARAM wParam) vscrollto(t, newpos); } + +HANDLER(vscroll) +{ + switch (uMsg) { + case WM_VSCROLL: + vscroll(t, wParam); + *lResult = 0; + return TRUE; + case WM_MOUSEWHEEL: + wheelscroll(t, wParam); + *lResult = 0; + return TRUE; + } + return FALSE; +}