Implemented some accessibility events. More TODOs.
This commit is contained in:
parent
903d8bf838
commit
803e8b1fd6
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue