Handled horizontal scrolling in drawing. Now to fix the header...

This commit is contained in:
Pietro Gagliardi 2014-11-07 18:13:59 -05:00
parent 3cb5017b35
commit 85fd26a3e3
1 changed files with 5 additions and 0 deletions

View File

@ -388,6 +388,8 @@ static void resize(struct table *t)
recomputeHScroll(t);
}
// TODO alter this so that only the visible columns are redrawn
// TODO this means rename controlSize to clientRect
static void drawItem(struct table *t, HDC dc, intptr_t i, LONG y, LONG height, RECT controlSize)
{
RECT rsel;
@ -413,6 +415,7 @@ static void drawItem(struct table *t, HDC dc, intptr_t i, LONG y, LONG height, R
}
// first fill the selection rect
// note that this already only draws the visible area
rsel.left = controlSize.left;
rsel.top = y;
rsel.right = controlSize.right - controlSize.left;
@ -421,6 +424,8 @@ static void drawItem(struct table *t, HDC dc, intptr_t i, LONG y, LONG height, R
abort();
xoff = SendMessageW(t->header, HDM_GETBITMAPMARGIN, 0, 0);
// now adjust for horizontal scrolling
xoff -= t->hpos;
// now draw the cells
// TODO check error from GetSysColor()?