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/hscroll.h | |
| parent | 720049bfd3c6d205859f3150dee33dee78dc3dc3 (diff) | |
Merged wintable/new/ into wintable/.
Diffstat (limited to 'wintable/hscroll.h')
| -rw-r--r-- | wintable/hscroll.h | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/wintable/hscroll.h b/wintable/hscroll.h new file mode 100644 index 0000000..1560490 --- /dev/null +++ b/wintable/hscroll.h @@ -0,0 +1,52 @@ +// 9 december 2014 + +// forward declaration needed here +static void repositionHeader(struct table *); + +static struct scrollParams hscrollParams(struct table *t) +{ + struct scrollParams p; + + ZeroMemory(&p, sizeof (struct scrollParams)); + p.pos = &(t->hscrollpos); + p.pagesize = t->hpagesize; + p.length = t->width; + p.scale = 1; + p.post = repositionHeader; + p.wheelCarry = &(t->hwheelCarry); + return p; +} + +static void hscrollto(struct table *t, intptr_t pos) +{ + struct scrollParams p; + + p = hscrollParams(t); + scrollto(t, SB_HORZ, &p, pos); +} + +static void hscrollby(struct table *t, intptr_t delta) +{ + struct scrollParams p; + + p = hscrollParams(t); + scrollby(t, SB_HORZ, &p, delta); +} + +static void hscroll(struct table *t, WPARAM wParam, LPARAM lParam) +{ + struct scrollParams p; + + p = hscrollParams(t); + scroll(t, SB_HORZ, &p, wParam, lParam); +} + +// TODO find out if we can indicriminately check for WM_WHEELHSCROLL +HANDLER(hscrollHandler) +{ + if (uMsg != WM_HSCROLL) + return FALSE; + hscroll(t, wParam, lParam); + *lResult = 0; + return TRUE; +} |
