diff options
| author | Pietro Gagliardi <[email protected]> | 2015-01-06 17:27:41 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-01-06 17:27:41 -0500 |
| commit | 22123fb676d26d309d428a892c453e35e684e367 (patch) | |
| tree | 9552f1a91a8b8995065e74573e8f59f448f2b08c /wintable/vscroll.h | |
| parent | 720049bfd3c6d205859f3150dee33dee78dc3dc3 (diff) | |
Merged wintable/new/ into wintable/.
Diffstat (limited to 'wintable/vscroll.h')
| -rw-r--r-- | wintable/vscroll.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/wintable/vscroll.h b/wintable/vscroll.h new file mode 100644 index 0000000..20f0df7 --- /dev/null +++ b/wintable/vscroll.h @@ -0,0 +1,66 @@ +// 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; + p.wheelCarry = &(t->vwheelCarry); + 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); +} + +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) +{ + switch (uMsg) { + case WM_VSCROLL: + vscroll(t, wParam, lParam); + *lResult = 0; + return TRUE; + case WM_MOUSEWHEEL: + vwheelscroll(t, wParam, lParam); + *lResult = 0; + return TRUE; + } + return FALSE; +} |
