summaryrefslogtreecommitdiff
path: root/wintable/main.c
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-11-06 20:28:34 -0500
committerPietro Gagliardi <[email protected]>2014-11-06 20:29:16 -0500
commit0c1e4bedb1a2a29320f9497e7d27d98797e581b3 (patch)
tree9958fe366a608a51630593f42549010e495e70fa /wintable/main.c
parent80679f3d35a316b6a1c253d77389c74b6a0e471d (diff)
Added some prerequisite bookkeeping needed for Windows Table horizontal scrolling.
Diffstat (limited to 'wintable/main.c')
-rw-r--r--wintable/main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/wintable/main.c b/wintable/main.c
index 1e3caab..474348e 100644
--- a/wintable/main.c
+++ b/wintable/main.c
@@ -45,6 +45,9 @@ struct table {
intptr_t nColumns;
HIMAGELIST imagelist;
int imagelistHeight;
+ intptr_t width;
+ intptr_t hpageSize;
+ intptr_t hpos;
};
static LONG rowHeight(struct table *t)
@@ -107,15 +110,18 @@ static void recomputeHScroll(struct table *t)
abort();
width += item.cxy;
}
+ t->width = (intptr_t) width;
if (GetClientRect(t->hwnd, &r) == 0)
abort();
+ t->hpageSize = r.right - r.left;
+
ZeroMemory(&si, sizeof (SCROLLINFO));
si.cbSize = sizeof (SCROLLINFO);
si.fMask = SIF_PAGE | SIF_RANGE;
- si.nPage = r.right - r.left;
+ si.nPage = t->hpageSize;
si.nMin = 0;
- si.nMax = width - 1; // - 1 because endpoints inclusive
+ si.nMax = t->width - 1; // - 1 because endpoints inclusive
SetScrollInfo(t->hwnd, SB_HORZ, &si, TRUE);
}