Added vscroll to the drawing code. Now to figure out why it stops early...

This commit is contained in:
Pietro Gagliardi 2014-12-12 16:37:48 -05:00
parent 2da55f35a6
commit 7f7ea0044e
1 changed files with 3 additions and 3 deletions

View File

@ -27,11 +27,11 @@ static void drawCell(struct table *t, HDC dc, struct drawCellParams *p)
// TODO then vertical center content // TODO then vertical center content
n = wsprintf(msg, L"(%d,%d)", p->row, p->column); n = wsprintf(msg, L"(%d,%d)", p->row, p->column);
FillRect(dc, &r, (HBRUSH) (current + 1)); /* FillRect(dc, &r, (HBRUSH) (current + 1));
current++; current++;
if (current >= 31) if (current >= 31)
current = 0; current = 0;
*/
r.left += p->xoff; r.left += p->xoff;
if (DrawTextExW(dc, msg, n, &r, DT_END_ELLIPSIS | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE, NULL) == 0) if (DrawTextExW(dc, msg, n, &r, DT_END_ELLIPSIS | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE, NULL) == 0)
panic("error drawing Table cell text"); panic("error drawing Table cell text");
@ -56,7 +56,7 @@ current = 0;
p.xoff = SendMessageW(t->header, HDM_GETBITMAPMARGIN, 0, 0); p.xoff = SendMessageW(t->header, HDM_GETBITMAPMARGIN, 0, 0);
p.y = client.top; p.y = client.top;
for (i = 0; i < t->count; i++) { for (i = t->vscrollpos; i < t->count; i++) {
p.row = i; p.row = i;
p.x = client.left - t->hscrollpos; p.x = client.left - t->hscrollpos;
for (j = 0; j < t->nColumns; j++) { for (j = 0; j < t->nColumns; j++) {