summaryrefslogtreecommitdiff
path: root/wintable/resize.h
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2015-01-08 01:45:06 -0500
committerPietro Gagliardi <[email protected]>2015-01-08 01:45:06 -0500
commit1dcdcd522cf1e63fd61f4ca376d4108a775a1565 (patch)
tree5133c81d0638edc99f5af6f9e57716d8c3ddcdba /wintable/resize.h
parent224bdb40874ff65880f21bda2b85ceebb4a69312 (diff)
Collected all of the metric updating stuff into a single update() function. Far from optimal, but much better.
Diffstat (limited to 'wintable/resize.h')
-rw-r--r--wintable/resize.h23
1 files changed, 2 insertions, 21 deletions
diff --git a/wintable/resize.h b/wintable/resize.h
index 2ffaad7..ae669e3 100644
--- a/wintable/resize.h
+++ b/wintable/resize.h
@@ -3,37 +3,18 @@
// TODO why doesn't this trigger on first show?
// TODO see if there's anything not metaphor related in the last bits of the scrollbar series
// TODO rename this to boot
+// TODO merge with update.h?
HANDLER(resizeHandler)
{
WINDOWPOS *wp;
- RECT client;
- intptr_t height;
if (uMsg != WM_WINDOWPOSCHANGED)
return FALSE;
wp = (WINDOWPOS *) lParam;
if ((wp->flags & SWP_NOSIZE) != 0)
return FALSE;
-
- // TODO does wp store the window rect or the client rect?
- if (GetClientRect(t->hwnd, &client) == 0)
- panic("error getting Table client rect in resizeHandler()");
- // TODO do this after calling updateTableWidth() (which calls repositionHeader()?)?
- client.top += t->headerHeight;
-
- // update the width...
- // this will call repositionHeader(); there's a good reason... (see comments)
- // TODO when I clean that mess up, remove this comment
- updateTableWidth(t);
-
- // ...and the height
- // TODO find out if order matters
- height = client.bottom - client.top;
- t->vpagesize = height / rowht(t);
- // do a dummy scroll to reflect those changes
- vscrollby(t, 0);
-
+ update(t, TRUE);
*lResult = 0;
return TRUE;
}