diff options
| author | Pietro Gagliardi <[email protected]> | 2015-01-07 19:00:56 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-01-07 19:00:56 -0500 |
| commit | b3c0a7acaf5bb779d6ccfc165399fe9415b7d203 (patch) | |
| tree | babd70c7e96da601681ead0ea499b47fb615e8f0 /wintable/draw.h | |
| parent | f263d9ced8e0fcbe9116456254eda0156dae40e1 (diff) | |
Implemented tableNotificationGetCellData et al for text columns.
Diffstat (limited to 'wintable/draw.h')
| -rw-r--r-- | wintable/draw.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/wintable/draw.h b/wintable/draw.h index a325d93..19b136a 100644 --- a/wintable/draw.h +++ b/wintable/draw.h @@ -13,8 +13,7 @@ struct drawCellParams { static void drawCell(struct table *t, HDC dc, struct drawCellParams *p) { RECT r; - WCHAR msg[200]; - int n; + WCHAR *text; HBRUSH background; int textColor; POINT pt; @@ -54,9 +53,10 @@ static void drawCell(struct table *t, HDC dc, struct drawCellParams *p) panic("error setting Table cell text color"); if (SetBkMode(dc, TRANSPARENT) == 0) panic("error setting transparent text drawing mode for Table cell"); - n = wsprintf(msg, L"(%d,%d)", p->row, p->column); - if (DrawTextExW(dc, msg, n, &r, DT_END_ELLIPSIS | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE, NULL) == 0) + text = (WCHAR *) notify(t, tableNotificationGetCellData, p->row, p->column, 0); + if (DrawTextExW(dc, text, -1, &r, DT_END_ELLIPSIS | DT_LEFT | DT_NOPREFIX | DT_SINGLELINE, NULL) == 0) panic("error drawing Table cell text"); + notify(t, tableNotificationFinishedWithCellData, p->row, p->column, (uintptr_t) text); break; case tableColumnImage: toCellContentRect(t, &r, p->xoff, tableImageWidth(), tableImageHeight()); |
