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:
parent
cb199cca77
commit
a8fed6c28d
|
@ -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)
|
||||
|
|
|
@ -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()?
|
||||
|
|
|
@ -14,7 +14,7 @@ HANDLER(resizeHandler)
|
|||
if ((wp->flags & SWP_NOSIZE) != 0)
|
||||
return FALSE;
|
||||
repositionHeader(t);
|
||||
recomputeHScroll(t);
|
||||
updateTableWidth(t);
|
||||
*lResult = 0;
|
||||
return TRUE;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue