Added images and checkboxes to rowHeight(). Split out the text part into textHeight(); we'll be needing it later (when implementing vertical centering).

This commit is contained in:
Pietro Gagliardi 2014-12-18 19:46:56 -05:00
parent 22d82f6bd0
commit 422b2f183a
1 changed files with 19 additions and 2 deletions

View File

@ -1,7 +1,7 @@
// 4 december 2014 // 4 december 2014
// TODO find a better place for this // TODO find a better place for these
static LONG rowHeight(struct table *t, HDC dc, BOOL select) static LONG textHeight(struct table *t, HDC dc, BOOL select)
{ {
BOOL release; BOOL release;
HFONT prevfont, newfont; HFONT prevfont, newfont;
@ -26,6 +26,23 @@ static LONG rowHeight(struct table *t, HDC dc, BOOL select)
return tm.tmHeight; 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) #define rowht(t) rowHeight(t, NULL, TRUE)
struct rowcol { struct rowcol {