From 2da55f35a61285d4476208b583ae310042c63b04 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 12 Dec 2014 15:20:34 -0500 Subject: Added vertical scroll. The drawing code will now need updating... --- wintable/new/vscroll.h | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 wintable/new/vscroll.h (limited to 'wintable/new/vscroll.h') diff --git a/wintable/new/vscroll.h b/wintable/new/vscroll.h new file mode 100644 index 0000000..bcab488 --- /dev/null +++ b/wintable/new/vscroll.h @@ -0,0 +1,51 @@ +// 9 december 2014 + +// forward declaration needed here +static void repositionHeader(struct table *); + +static struct scrollParams vscrollParams(struct table *t) +{ + struct scrollParams p; + + ZeroMemory(&p, sizeof (struct scrollParams)); + p.pos = &(t->vscrollpos); + p.pagesize = t->vpagesize; + p.length = t->count; + p.scale = rowht(t); + p.post = NULL; + return p; +} + +static void vscrollto(struct table *t, intptr_t pos) +{ + struct scrollParams p; + + p = vscrollParams(t); + scrollto(t, SB_VERT, &p, pos); +} + +static void vscrollby(struct table *t, intptr_t delta) +{ + struct scrollParams p; + + p = vscrollParams(t); + scrollby(t, SB_VERT, &p, delta); +} + +static void vscroll(struct table *t, WPARAM wParam, LPARAM lParam) +{ + struct scrollParams p; + + p = vscrollParams(t); + scroll(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; +} -- cgit v1.2.3