Changed from recomputeHScroll() to updateTableWidth() as we will store the table width separately and just use one call to SetScrollInfo() for everything to avoid weirdness.

This commit is contained in:
Pietro Gagliardi 2014-12-10 10:01:16 -05:00
parent cb199cca77
commit a8fed6c28d
3 changed files with 8 additions and 4 deletions

View File

@ -9,7 +9,7 @@ static void addColumn(struct table *t, WPARAM wParam, LPARAM lParam)
if (t->columnTypes[t->nColumns - 1] >= nTableColumnTypes)
panic("invalid column type passed to tableAddColumn");
headerAddColumn(t, (WCHAR *) lParam);
recomputeHScroll(t);
updateTableWidth(t);
}
HANDLER(apiHandlers)

View File

@ -53,6 +53,11 @@ static void headerAddColumn(struct table *t, WCHAR *name)
panic("error adding column to Table header");
}
static void updateTableWidth(struct table *t)
{
recomputeHScroll(t);
}
HANDLER(headerNotifyHandler)
{
NMHDR *nmhdr = (NMHDR *) lParam;
@ -61,8 +66,7 @@ HANDLER(headerNotifyHandler)
return FALSE;
if (nmhdr->code != HDN_ITEMCHANGED)
return FALSE;
// TODO should this be last?
recomputeHScroll(t);
updateTableWidth(t);
// TODO make more intelligent
InvalidateRect(t->hwnd, NULL, TRUE);
// TODO UpdateWindow()?

View File

@ -14,7 +14,7 @@ HANDLER(resizeHandler)
if ((wp->flags & SWP_NOSIZE) != 0)
return FALSE;
repositionHeader(t);
recomputeHScroll(t);
updateTableWidth(t);
*lResult = 0;
return TRUE;
}