summaryrefslogtreecommitdiff
path: root/wintable/new/coord.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-12-20 21:09:01 -0500
committerPietro Gagliardi <[email protected]>2014-12-20 21:09:01 -0500
commit3cb96de1628495f176d9e7fe4104b8c6cca36635 (patch)
tree8d6ed07fd2d458e9fb8e3d9d7d0df2763b9d9356 /wintable/new/coord.h
parent7713c913875ebea0af7cfd21840981a94dab654d (diff)
Wrote up toItemContentRect() and used that in drawCell(). More TODOs.
Diffstat (limited to 'wintable/new/coord.h')
-rw-r--r--wintable/new/coord.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/wintable/new/coord.h b/wintable/new/coord.h
index 6de4f2b..39517d3 100644
--- a/wintable/new/coord.h
+++ b/wintable/new/coord.h
@@ -148,3 +148,17 @@ static BOOL rowColumnToClientRect(struct table *t, struct rowcol rc, RECT *r)
}
// TODO idealCoordToRowColumn/rowColumnToIdealCoord?
+
+static void toItemContentRect(struct table *t, RECT *r, LRESULT xoff, intptr_t width, intptr_t height)
+{
+ if (xoff == 0)
+ xoff = SendMessageW(t->header, HDM_GETBITMAPMARGIN, 0, 0);
+ r->left += xoff;
+ if (width != 0)
+ r->right = r->left + width;
+ if (height != 0)
+ // TODO vertical center
+ r->bottom = r->top + height;
+}
+
+#define toCheckboxRect(t, r) toItemContentRect(t, r, 0, t->checkboxWidth, t->checkboxHeight)