Implemented text cell drawing.

This commit is contained in:
Pietro Gagliardi 2014-10-20 23:04:27 -04:00
parent 0dd4a07456
commit c9783c5b15
1 changed files with 8 additions and 1 deletions

View File

@ -311,6 +311,7 @@ static void drawItems(struct table *t, HDC dc, RECT cliprect)
HBRUSH background;
int textColor;
WCHAR msg[100];
RECT headeritem;
// TODO check errors
rsel.left = r.left;
@ -333,7 +334,13 @@ static void drawItems(struct table *t, HDC dc, RECT cliprect)
SetTextColor(dc, GetSysColor(textColor));
FillRect(dc, &rsel, background);
SetBkMode(dc, TRANSPARENT);
TextOutW(dc, r.left, y, msg, wsprintf(msg, L"Item %d", i));
if (SendMessageW(t->header, HDM_GETITEMRECT, 0, (LPARAM) (&headeritem)) == 0)
abort();
rsel.left = headeritem.left + SendMessageW(t->header, HDM_GETBITMAPMARGIN, 0, 0);
rsel.top = y;
rsel.right = headeritem.right;
rsel.bottom = y + tm.tmHeight;
DrawTextExW(dc, msg, wsprintf(msg, L"Item %d", i), &rsel, DT_END_ELLIPSIS | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE, NULL);
y += tm.tmHeight;
}