diff options
| author | Pietro Gagliardi <[email protected]> | 2014-12-14 16:23:32 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-12-14 16:23:32 -0500 |
| commit | 33f7ac1142c6670a3045f9dba02a5fb32738b8fa (patch) | |
| tree | fc9a1a475e3323132ca0152e840263015eb4de2d /wintable/new/util.h | |
| parent | f56ae488f0c9cf073f9b7ba2b4bde616ea702e59 (diff) | |
Unified all column width accesses to a columnWidth() function.
Diffstat (limited to 'wintable/new/util.h')
| -rw-r--r-- | wintable/new/util.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/wintable/new/util.h b/wintable/new/util.h index 470cef5..fd6166a 100644 --- a/wintable/new/util.h +++ b/wintable/new/util.h @@ -78,3 +78,14 @@ static void deselectFont(HDC dc, HFONT prevfont, HFONT newfont) panic("error deselecting Table font from Table DC"); // doin't delete newfont here, even if it is the system font (see http://msdn.microsoft.com/en-us/library/windows/desktop/dd144925%28v=vs.85%29.aspx) } + +// and back to other functions + +static LONG columnWidth(struct table *t, intptr_t n) +{ + RECT r; + + if (SendMessageW(t->header, HDM_GETITEMRECT, (WPARAM) n, (LPARAM) (&r)) == 0) + panic("error getting Table column width"); + return r.right - r.left; +} |
