diff options
| -rw-r--r-- | wintable/accessibility.h | 2 | ||||
| -rw-r--r-- | wintable/api.h | 26 | ||||
| -rw-r--r-- | wintable/checkboxes.h | 2 | ||||
| -rw-r--r-- | wintable/scroll.h | 3 | ||||
| -rw-r--r-- | wintable/select.h | 4 |
5 files changed, 33 insertions, 4 deletions
diff --git a/wintable/accessibility.h b/wintable/accessibility.h index 662a6f5..ff7364b 100644 --- a/wintable/accessibility.h +++ b/wintable/accessibility.h @@ -975,6 +975,7 @@ static HRESULT STDMETHODCALLTYPE tableAccput_accValue(IAccessible *this, VARIANT return hr; // don't support setting values anyway; do return the above errors just to be safe // TODO defer ROW_SYSTEM_TABLE to the standard accessible object? + // TODO implement for checkboxes? return DISP_E_MEMBERNOTFOUND; } @@ -1053,6 +1054,7 @@ static void invalidateTableAccs(struct table *t) ta->std = NULL; } t->firstAcc = NULL; + NotifyWinEvent(EVENT_OBJECT_DESTROY, t->hwnd, OBJID_CLIENT, CHILDID_SELF); } HANDLER(accessibilityHandler) diff --git a/wintable/api.h b/wintable/api.h index d0399e4..04c7561 100644 --- a/wintable/api.h +++ b/wintable/api.h @@ -12,6 +12,27 @@ static void addColumn(struct table *t, WPARAM wParam, LPARAM 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) + + // TODO send a notification for all rows? +} + +static void setRowCount(struct table *t, intptr_t rc) +{ + intptr_t old, i; + + old = t->count; + t->count = rc; + // 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 + // TODO really send all these notifications? + if (old < t->count) // rows added + for (i = old; i < t->count; i++) + NotifyWinEvent(EVENT_OBJECT_CREATE, t->hwnd, OBJID_CLIENT, i); + else if (old > t->count) // rows removed + for (i = old; i > t->count; i++) + NotifyWinEvent(EVENT_OBJECT_DESTROY, t->hwnd, OBJID_CLIENT, i); + // TODO update existing rows? } HANDLER(apiHandlers) @@ -39,10 +60,7 @@ HANDLER(apiHandlers) return TRUE; case tableSetRowCount: rcp = (intptr_t *) lParam; - t->count = *rcp; - // 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 + setRowCount(t, *rcp); *lResult = 0; return TRUE; } diff --git a/wintable/checkboxes.h b/wintable/checkboxes.h index 75ad9f4..b44a0d0 100644 --- a/wintable/checkboxes.h +++ b/wintable/checkboxes.h @@ -226,6 +226,8 @@ HANDLER(checkboxMouseUpHandler) // TODO redraw the whole cell? if (InvalidateRect(t->hwnd, &r, TRUE) == 0) panic("error redrawing Table checkbox after mouse up"); + // TODO really only the row? no way to specify column too? + NotifyWinEvent(EVENT_OBJECT_STATECHANGE, t->hwnd, OBJID_CLIENT, rc.row); *lResult = 0; return TRUE; wrongUp: diff --git a/wintable/scroll.h b/wintable/scroll.h index 1f333a8..9da2565 100644 --- a/wintable/scroll.h +++ b/wintable/scroll.h @@ -54,6 +54,9 @@ static void scrollto(struct table *t, int which, struct scrollParams *p, intptr_ if (p->post != NULL) (*(p->post))(t); + + // EVENT_OBJECT_CONTENTSCROLLED is Vista and up only + // TODO send state changes for all affected rows/cells? } static void scrollby(struct table *t, int which, struct scrollParams *p, intptr_t delta) diff --git a/wintable/select.h b/wintable/select.h index 117dad5..bc7c0b1 100644 --- a/wintable/select.h +++ b/wintable/select.h @@ -99,6 +99,10 @@ noScroll: if (InvalidateRect(t->hwnd, &r, TRUE) == 0) panic("error queueing newly selected row for redraw in doselect()"); } + + // TODO notify on the old row too? + NotifyWinEvent(EVENT_OBJECT_SELECTION, t->hwnd, OBJID_CLIENT, t->selectedRow); + // TODO send EVENT_OBJECT_STATECHANGED too? } // TODO make this needless |
