From 84d66b6b50a3956015cc8bf0e78d6373ebdb4ba4 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 30 Nov 2014 21:27:32 -0500 Subject: Started splitting message handlers for the new Windows Table into their respective files. --- wintable/api.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) (limited to 'wintable/api.h') 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; +} -- cgit v1.2.3