diff options
| -rw-r--r-- | wintable/api.h | 7 | ||||
| -rw-r--r-- | wintable/header.h | 4 | ||||
| -rw-r--r-- | wintable/resize.h | 1 |
3 files changed, 9 insertions, 3 deletions
diff --git a/wintable/api.h b/wintable/api.h index f6895e5..d0399e4 100644 --- a/wintable/api.h +++ b/wintable/api.h @@ -10,6 +10,8 @@ static void addColumn(struct table *t, WPARAM wParam, LPARAM lParam) panic("invalid column type passed to tableAddColumn"); headerAddColumn(t, (WCHAR *) lParam); update(t, TRUE); + // TODO only redraw the part of the client area where the new client went, if any + // (TODO when — if — adding autoresize, figure this one out) } HANDLER(apiHandlers) @@ -38,8 +40,9 @@ HANDLER(apiHandlers) case tableSetRowCount: rcp = (intptr_t *) lParam; t->count = *rcp; - // TODO shouldn't we just redraw everything? - update(t, TRUE); + // we DO redraw everything because we don't want any rows that should no longer be there to remain on screen! + updateAll(t); // DONE + // TODO reset checkbox and selection logic if the current row for both no longer exists *lResult = 0; return TRUE; } diff --git a/wintable/header.h b/wintable/header.h index 863d3d0..b87f7c6 100644 --- a/wintable/header.h +++ b/wintable/header.h @@ -61,6 +61,7 @@ static void headerAddColumn(struct table *t, WCHAR *name) panic("error adding column to Table header"); } +// TODO is this triggered if we programmatically move headers (for autosizing)? HANDLER(headerNotifyHandler) { NMHDR *nmhdr = (NMHDR *) lParam; @@ -71,7 +72,8 @@ HANDLER(headerNotifyHandler) return FALSE; update(t, TRUE); // TODO make more intelligent - // (TODO is it actually needed?) + // to do this, we have to redraw the column to the left of the divider that was dragged and scroll everything to the right normally (leaving the hole that was scrolled invalidated as well) + // of course, this implies that dragging a divider only resizes the column of which it is the right side of and moves all others InvalidateRect(t->hwnd, NULL, TRUE); *lResult = 0; return TRUE; diff --git a/wintable/resize.h b/wintable/resize.h index ae669e3..7805bd9 100644 --- a/wintable/resize.h +++ b/wintable/resize.h @@ -14,6 +14,7 @@ HANDLER(resizeHandler) wp = (WINDOWPOS *) lParam; if ((wp->flags & SWP_NOSIZE) != 0) return FALSE; + // TODO redraw everything? update(t, TRUE); *lResult = 0; return TRUE; |
