diff options
| author | Pietro Gagliardi <[email protected]> | 2014-12-18 19:46:56 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-12-18 19:46:56 -0500 |
| commit | 422b2f183ae643a8bcdaa1ba76f8f2ff34b42d1b (patch) | |
| tree | a89f3a8a47c6911dd3873d36df20cae46a5fdeed | |
| parent | 22d82f6bd0c8680dcee05caab18da4b9c3f435f0 (diff) | |
Added images and checkboxes to rowHeight(). Split out the text part into textHeight(); we'll be needing it later (when implementing vertical centering).
| -rw-r--r-- | wintable/new/coord.h | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/wintable/new/coord.h b/wintable/new/coord.h index be0dbd7..5810cb9 100644 --- a/wintable/new/coord.h +++ b/wintable/new/coord.h @@ -1,7 +1,7 @@ // 4 december 2014 -// TODO find a better place for this -static LONG rowHeight(struct table *t, HDC dc, BOOL select) +// TODO find a better place for these +static LONG textHeight(struct table *t, HDC dc, BOOL select) { BOOL release; HFONT prevfont, newfont; @@ -26,6 +26,23 @@ static LONG rowHeight(struct table *t, HDC dc, BOOL select) return tm.tmHeight; } +#define tableImageWidth() GetSystemMetrics(SM_CXSMICON) +#define tableImageHeight() GetSystemMetrics(SM_CYSMICON) + +static LONG rowHeight(struct table *t, HDC dc, BOOL select) +{ + LONG height; + LONG tmHeight; + + height = tableImageHeight(); // start with this to avoid two function calls + tmHeight = textHeight(t, dc, select); + if (height < tmHeight) + height = tmHeight; + if (height < t->checkboxHeight) + height = t->checkboxHeight; + return height; +} + #define rowht(t) rowHeight(t, NULL, TRUE) struct rowcol { |
