From 01efbd750f7dfeb8c27afc92f3403fa07f1bc1c4 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 8 Dec 2014 12:57:54 -0500 Subject: [PATCH] Added tracking of header column sizes. --- wintable/new/children.h | 1 + wintable/new/header.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/wintable/new/children.h b/wintable/new/children.h index ba58939..6a3aff3 100644 --- a/wintable/new/children.h +++ b/wintable/new/children.h @@ -5,6 +5,7 @@ static const handlerfunc commandHandlers[] = { }; static const handlerfunc notifyHandlers[] = { + headerNotifyHandler, NULL, }; diff --git a/wintable/new/header.h b/wintable/new/header.h index 14281ef..16b33f7 100644 --- a/wintable/new/header.h +++ b/wintable/new/header.h @@ -52,3 +52,17 @@ static void headerAddColumn(struct table *t, WCHAR *name) if (SendMessage(t->header, HDM_INSERTITEM, (WPARAM) (100), (LPARAM) (&item)) == (LRESULT) (-1)) panic("error adding column to Table header"); } + +HANDLER(headerNotifyHandler) +{ + NMHDR *nmhdr = (NMHDR *) lParam; + + if (nmhdr->hwndFrom != t->header) + return FALSE; + if (nmhdr->code != HDN_ITEMCHANGED) + return FALSE; + // TODO + InvalidateRect(t->hwnd, NULL, TRUE); + *lResult = 0; + return TRUE; +}