summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wintable/new/draw.h4
-rw-r--r--wintable/new/header.h2
2 files changed, 5 insertions, 1 deletions
diff --git a/wintable/new/draw.h b/wintable/new/draw.h
index 4f30036..e64b613 100644
--- a/wintable/new/draw.h
+++ b/wintable/new/draw.h
@@ -37,6 +37,8 @@ static void draw(struct table *t, HDC dc, RECT cliprect, RECT client)
for (i = 0; i < t->nColumns; i++) {
SendMessage(t->header, HDM_GETITEMRECT, (WPARAM) i, (LPARAM) (&r));
+ r.left -= t->hscrollpos;
+ r.right -= t->hscrollpos;
r.top = client.top;
r.bottom = client.bottom;
FillRect(dc, &r, GetSysColorBrush(x));
@@ -47,7 +49,7 @@ static void draw(struct table *t, HDC dc, RECT cliprect, RECT client)
ZeroMemory(&p, sizeof (struct drawCellParams));
p.row = 0;
p.column = 0;
- p.x = r.left;
+ p.x = r.left - t->hscrollpos;
p.y = 100;
p.width = r.right - r.left;
p.height = rowHeight(t, dc, FALSE);
diff --git a/wintable/new/header.h b/wintable/new/header.h
index ba2d4d4..f23c812 100644
--- a/wintable/new/header.h
+++ b/wintable/new/header.h
@@ -28,6 +28,8 @@ static void repositionHeader(struct table *t)
if (GetClientRect(t->hwnd, &r) == 0)
panic("error getting client rect for Table header repositioning");
+ // we fake horizontal scrolling here by extending the client rect to the left by the scroll position
+ r.left -= t->hscrollpos;
l.prc = &r;
l.pwpos = &wp;
if (SendMessageW(t->header, HDM_LAYOUT, 0, (LPARAM) (&l)) == FALSE)