summaryrefslogtreecommitdiff
path: root/wintable/api.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-01-08 01:45:06 -0500
committerPietro Gagliardi <[email protected]>2015-01-08 01:45:06 -0500
commit1dcdcd522cf1e63fd61f4ca376d4108a775a1565 (patch)
tree5133c81d0638edc99f5af6f9e57716d8c3ddcdba /wintable/api.h
parent224bdb40874ff65880f21bda2b85ceebb4a69312 (diff)
Collected all of the metric updating stuff into a single update() function. Far from optimal, but much better.
Diffstat (limited to 'wintable/api.h')
-rw-r--r--wintable/api.h13
1 files changed, 8 insertions, 5 deletions
diff --git a/wintable/api.h b/wintable/api.h
index bf259ad..260202e 100644
--- a/wintable/api.h
+++ b/wintable/api.h
@@ -9,7 +9,7 @@ static void addColumn(struct table *t, WPARAM wParam, LPARAM lParam)
if (t->columnTypes[t->nColumns - 1] >= nTableColumnTypes)
panic("invalid column type passed to tableAddColumn");
headerAddColumn(t, (WCHAR *) lParam);
- updateTableWidth(t);
+ update(t, TRUE);
}
HANDLER(apiHandlers)
@@ -21,8 +21,11 @@ HANDLER(apiHandlers)
// don't free the old font; see http://blogs.msdn.com/b/oldnewthing/archive/2008/09/12/8945692.aspx
t->font = (HFONT) wParam;
SendMessageW(t->header, WM_SETFONT, wParam, lParam);
- // TODO how to properly handle LOWORD(lParam) != FALSE?
- // TODO depending on the result of the above, update table width to refresh t->headerHeight?
+ update(t, LOWORD(lParam) != FALSE);
+ // TODO is this needed?
+ if (LOWORD(lParam) != FALSE)
+ // TODO check error
+ InvalidateRect(t->hwnd, NULL, TRUE);
*lResult = 0;
return TRUE;
case WM_GETFONT:
@@ -35,8 +38,8 @@ HANDLER(apiHandlers)
case tableSetRowCount:
rcp = (intptr_t *) lParam;
t->count = *rcp;
- // TODO refresh table in this way?
- updateTableWidth(t);
+ // TODO shouldn't we just redraw everything?
+ update(t, TRUE);
*lResult = 0;
return TRUE;
}