From 2a2990f19cb966e4b26803b25aa2b7fa6d8957c4 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 10 Jun 2018 19:07:34 -0400 Subject: [PATCH] I have no clue anymore. Tempted to undo checkbox stuff entirely for now. --- windows/table.cpp | 15 +++++++++++++++ windows/tableimages.cpp | 2 ++ 2 files changed, 17 insertions(+) diff --git a/windows/table.cpp b/windows/table.cpp index d66f9170..12deab16 100644 --- a/windows/table.cpp +++ b/windows/table.cpp @@ -163,6 +163,7 @@ static LRESULT onNM_CUSTOMDRAW(uiTable *t, NMLVCUSTOMDRAW *nm) break; case CDDS_SUBITEM | CDDS_ITEMPREPAINT: p = (*(t->columns))[nm->iSubItem]; + // TODO none of this runs on the first item // we need this as previous subitems will persist their colors nm->clrText = t->clrItemText; if (p->textParams.ColorModelColumn != -1) { @@ -173,6 +174,20 @@ static LRESULT onNM_CUSTOMDRAW(uiTable *t, NMLVCUSTOMDRAW *nm) nm->clrText = blend(nm->clrTextBk, r, g, b, a); } } +if (nm->iSubItem != 0) { +HWND header; +LRESULT margin; +header = (HWND) SendMessageW(t->hwnd, LVM_GETHEADER, NULL, NULL); +margin = SendMessageW(header, HDM_GETBITMAPMARGIN, 0, 0); +//nm->rcText.left -= margin; +printf("%d %d %d %d\n", +(int)(nm->nmcd.rc.left), +(int)(nm->nmcd.rc.top), +(int)(nm->nmcd.rc.right), +(int)(nm->nmcd.rc.bottom)); +FillRect(nm->nmcd.hdc, &(nm->nmcd.rc), GetSysColorBrush(COLOR_ACTIVECAPTION)); +return CDRF_SKIPDEFAULT; +} // TODO draw background on image columns if needed ret = CDRF_NEWFONT; break; diff --git a/windows/tableimages.cpp b/windows/tableimages.cpp index 2544e1e7..b8db37af 100644 --- a/windows/tableimages.cpp +++ b/windows/tableimages.cpp @@ -15,6 +15,8 @@ We'll use the small image list. For this, the first few items will be reserved f // checkboxes TODOs: // - see if we need to get rid of the extra margin in subitems +// - get rid of the extra bitmap margin space before text +// - get rid of extra whitespace before text on subitems #define nCheckboxImages 4