From 7f7ea0044eff2933627e16d657635a8c1fcdce3e Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 12 Dec 2014 16:37:48 -0500 Subject: [PATCH] Added vscroll to the drawing code. Now to figure out why it stops early... --- wintable/new/draw.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wintable/new/draw.h b/wintable/new/draw.h index 2624b6c..dce90a7 100644 --- a/wintable/new/draw.h +++ b/wintable/new/draw.h @@ -27,11 +27,11 @@ static void drawCell(struct table *t, HDC dc, struct drawCellParams *p) // TODO then vertical center content n = wsprintf(msg, L"(%d,%d)", p->row, p->column); - FillRect(dc, &r, (HBRUSH) (current + 1)); +/* FillRect(dc, &r, (HBRUSH) (current + 1)); current++; if (current >= 31) current = 0; - +*/ r.left += p->xoff; if (DrawTextExW(dc, msg, n, &r, DT_END_ELLIPSIS | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE, NULL) == 0) panic("error drawing Table cell text"); @@ -56,7 +56,7 @@ current = 0; p.xoff = SendMessageW(t->header, HDM_GETBITMAPMARGIN, 0, 0); p.y = client.top; - for (i = 0; i < t->count; i++) { + for (i = t->vscrollpos; i < t->count; i++) { p.row = i; p.x = client.left - t->hscrollpos; for (j = 0; j < t->nColumns; j++) {