diff options
| author | Pietro Gagliardi <[email protected]> | 2014-11-18 13:52:54 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-11-18 13:53:53 -0500 |
| commit | cb2642765a4058c4cfabf844bda50dbf60d1264e (patch) | |
| tree | 4e255f8a3598752223f7c832ebc98b62df1219d0 /wintable/main.c | |
| parent | 8175bd411ace416bab17725ef800ec1c6859930c (diff) | |
Started the work to handle checkboxes. For now, we draw just a red rectangle; when we do events this will change color dynamically. When I hook up the control to its parent, I will move from these rectangles to the actual checkbox images. In the meantime, fix some pointer bugs in imagelist_windows.c as well.
Diffstat (limited to 'wintable/main.c')
| -rw-r--r-- | wintable/main.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/wintable/main.c b/wintable/main.c index 5f45610..1de3a3f 100644 --- a/wintable/main.c +++ b/wintable/main.c @@ -44,6 +44,7 @@ enum { // - space to toggle (TODO); + or = to set; - to clear (see http://msdn.microsoft.com/en-us/library/windows/desktop/bb775941%28v=vs.85%29.aspx) // - TODO figure out which notification is needed // - http://blogs.msdn.com/b/oldnewthing/archive/2006/01/03/508694.aspx +// - free all allocated resources on WM_DESTROY #define tableWindowClass L"gouitable" @@ -623,7 +624,16 @@ static void drawItem(struct table *t, HDC dc, intptr_t i, LONG y, LONG height, R abort(); break; case tableColumnCheckbox: - ;// TODO + // TODO replace all this + rsel.left = headeritem.left + xoff; + rsel.top = y; + rsel.right = rsel.left + t->checkboxWidth; + rsel.bottom = rsel.top + t->checkboxHeight; + if (SetDCBrushColor(dc, RGB(255, 0, 0)) == CLR_INVALID) + abort(); + if (FillRect(dc, &rsel, GetStockObject(DC_BRUSH)) == 0) + abort(); + break; } if (t->selected == i && t->focusedColumn == j) { rsel.left = headeritem.left; |
