summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-12-08 10:40:51 -0500
committerPietro Gagliardi <[email protected]>2014-12-08 10:40:51 -0500
commit7cfda3ad616affbb062c3dc5f5c79f8710b382fb (patch)
treeda92bfed19236fec76ad1425244ab6957583f143
parent2f95837155e84240b508d561372ff54ef2b836bc (diff)
Filled in the draw() function for testing header resizes (when that is implemented).
-rw-r--r--wintable/new/draw.h13
1 files changed, 12 insertions, 1 deletions
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?