diff options
| author | Pietro Gagliardi <[email protected]> | 2014-10-20 23:04:27 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-10-20 23:04:27 -0400 |
| commit | c9783c5b155177d4cc997dc6810599096a1394e9 (patch) | |
| tree | 034bb96ae9c6df02f2922877f894c29ff5624cde /wintable/main.c | |
| parent | 0dd4a07456557cdba067feb8284e433e7459d72b (diff) | |
Implemented text cell drawing.
Diffstat (limited to 'wintable/main.c')
| -rw-r--r-- | wintable/main.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/wintable/main.c b/wintable/main.c index 248cf17..fe5810e 100644 --- a/wintable/main.c +++ b/wintable/main.c @@ -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; } |
