summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-12-19 20:48:02 -0500
committerPietro Gagliardi <[email protected]>2014-12-19 20:48:02 -0500
commit34d3771f77f8f6d695e0e0ff4bcf3d80695f461d (patch)
tree6c23ddda109e198d56f07c326713ee32c30069d6
parentee9b9581719f0748183d242eb509b130055fe8db (diff)
Added code for distinguishing column types to drawCell().
-rw-r--r--wintable/new/draw.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/wintable/new/draw.h b/wintable/new/draw.h
index 626f23f..3d20383 100644
--- a/wintable/new/draw.h
+++ b/wintable/new/draw.h
@@ -45,13 +45,17 @@ static void drawCell(struct table *t, HDC dc, struct drawCellParams *p)
r.left += p->xoff;
// TODO vertical center content too
- if (SetTextColor(dc, GetSysColor(textColor)) == CLR_INVALID)
- 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)
- panic("error drawing Table cell text");
+ switch (t->columnTypes[p->column]) {
+ case tableColumnText:
+ case tableColumnImage: // TODO
+ if (SetTextColor(dc, GetSysColor(textColor)) == CLR_INVALID)
+ 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)
+ panic("error drawing Table cell text");
+ }
}
static void draw(struct table *t, HDC dc, RECT cliprect, RECT client)