summaryrefslogtreecommitdiff
path: root/wintable/new/vscroll.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-12-12 22:17:20 -0500
committerPietro Gagliardi <[email protected]>2014-12-12 22:17:20 -0500
commit5080e843983b6aedbb2c1bee9aa6976deb681472 (patch)
tree3069ceeee865e777b8117bd423f40a2075e0e461 /wintable/new/vscroll.h
parentd5b4d06cb4f572bea310f20e91ae4a73b49cc1de (diff)
Added wheel scrolling.
Diffstat (limited to 'wintable/new/vscroll.h')
-rw-r--r--wintable/new/vscroll.h24
1 files changed, 19 insertions, 5 deletions
diff --git a/wintable/new/vscroll.h b/wintable/new/vscroll.h
index bcab488..a1dc4c4 100644
--- a/wintable/new/vscroll.h
+++ b/wintable/new/vscroll.h
@@ -13,6 +13,7 @@ static struct scrollParams vscrollParams(struct table *t)
p.length = t->count;
p.scale = rowht(t);
p.post = NULL;
+ p.wheelCarry = &(t->vwheelCarry);
return p;
}
@@ -40,12 +41,25 @@ static void vscroll(struct table *t, WPARAM wParam, LPARAM lParam)
scroll(t, SB_VERT, &p, wParam, lParam);
}
+static void vwheelscroll(struct table *t, WPARAM wParam, LPARAM lParam)
+{
+ struct scrollParams p;
+
+ p = vscrollParams(t);
+ wheelscroll(t, SB_VERT, &p, wParam, lParam);
+}
+
// TODO WM_MOUSEWHEEL
HANDLER(vscrollHandler)
{
- if (uMsg != WM_VSCROLL)
- return FALSE;
- vscroll(t, wParam, lParam);
- *lResult = 0;
- return TRUE;
+ switch (uMsg) {
+ case WM_VSCROLL:
+ vscroll(t, wParam, lParam);
+ *lResult = 0;
+ return TRUE;
+ case WM_MOUSEWHEEL:
+ vwheelscroll(t, wParam, lParam);
+ // TODO what to return?
+ }
+ return FALSE;
}