summaryrefslogtreecommitdiff
path: root/wintable/api.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-11-30 21:27:32 -0500
committerPietro Gagliardi <[email protected]>2014-11-30 21:27:32 -0500
commit84d66b6b50a3956015cc8bf0e78d6373ebdb4ba4 (patch)
tree548058f746a1819d2d023d3a3c06e50084c31d77 /wintable/api.h
parentc41b9b16fffb000700e64c0d652e2db58242d98d (diff)
Started splitting message handlers for the new Windows Table into their respective files.
Diffstat (limited to 'wintable/api.h')
-rw-r--r--wintable/api.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/wintable/api.h b/wintable/api.h
index a933df7..5fdf599 100644
--- a/wintable/api.h
+++ b/wintable/api.h
@@ -23,3 +23,32 @@ static void addColumn(struct table *t, WPARAM wParam, LPARAM lParam)
// TODO resize(t)?
redrawAll(t);
}
+
+HANDLER(API)
+{
+ switch (uMsg) {
+ case WM_SETFONT:
+ t->font = (HFONT) wParam;
+ if (t->font == NULL)
+ t->font = t->defaultFont;
+ // also set the header font
+ SendMessageW(t->header, WM_SETFONT, wParam, lParam);
+ if (LOWORD(lParam) != FALSE) {
+ // the scrollbar page size will change so redraw that too
+ // also recalculate the header height
+ // TODO do that when this is FALSE too somehow
+ resize(t);
+ redrawAll(t);
+ }
+ *lResult = 0;
+ return TRUE;
+ case WM_GETFONT:
+ *lResult = (LRESULT) t->font;
+ return TRUE;
+ case tableAddColumn:
+ addColumn(t, wParam, lParam);
+ *lResult = 0;
+ return TRUE;
+ }
+ return FALSE;
+}