From 9b3555f25714252f7739a5d941563c95d718dc73 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 8 Dec 2014 15:04:43 -0500 Subject: [PATCH] Readded api.h, for WM_GETFONT/WM_SETFONT. We'll need this to re-add rowHeight(). --- wintable/new/api.h | 22 ++++++++++++++++++++++ wintable/new/main.c | 3 +++ 2 files changed, 25 insertions(+) create mode 100644 wintable/new/api.h diff --git a/wintable/new/api.h b/wintable/new/api.h new file mode 100644 index 0000000..d29d3b2 --- /dev/null +++ b/wintable/new/api.h @@ -0,0 +1,22 @@ +// 8 december 2014 + +HANDLER(apiHandlers) +{ + switch (uMsg) { + case WM_SETFONT: + // TODO release old font? + t->font = (HFONT) wParam; + SendMessageW(t->header, WM_SETFONT, wParam, lParam); + // TODO reposition header? + // TODO how to properly handle LOWORD(lParam) != FALSE? + *lResult = 0; + return TRUE; + case WM_GETFONT: + *lResult = (LRESULT) (t->font); + return TRUE; + case tableAddColumn: + // TODO + return FALSE; + } + return FALSE; +} diff --git a/wintable/new/main.c b/wintable/new/main.c index 1c097fd..d296fc3 100644 --- a/wintable/new/main.c +++ b/wintable/new/main.c @@ -49,6 +49,7 @@ static void (*tablePanic)(const char *, DWORD) = NULL; struct table { HWND hwnd; HWND header; + HFONT font; }; #include "util.h" @@ -58,12 +59,14 @@ struct table { #include "children.h" #include "resize.h" #include "draw.h" +#include "api.h" static const handlerfunc handlers[] = { eventHandlers, childrenHandlers, resizeHandler, drawHandlers, + apiHandlers, NULL, };