From 7cfda3ad616affbb062c3dc5f5c79f8710b382fb Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 8 Dec 2014 10:40:51 -0500 Subject: [PATCH] Filled in the draw() function for testing header resizes (when that is implemented). --- wintable/new/draw.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/wintable/new/draw.h b/wintable/new/draw.h index 7cd978c..9996092 100644 --- a/wintable/new/draw.h +++ b/wintable/new/draw.h @@ -2,7 +2,18 @@ static void draw(struct table *t, HDC dc, RECT cliprect, RECT client) { - Rectangle(dc, 20, 20, 200, 200); + LRESULT i, n; + RECT r; + int x = 0; + + n = SendMessageW(t->header, HDM_GETITEMCOUNT, 0, 0); + for (i = 0; i < n; i++) { + SendMessage(t->header, HDM_GETITEMRECT, (WPARAM) i, (LPARAM) (&r)); + r.top = client.top; + r.bottom = client.bottom; + FillRect(dc, &r, GetSysColorBrush(x)); + x++; + } } // TODO handle WM_PRINTCLIENT flags?