Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGrid support #16008

Closed
Closed

Conversation

DietmarSchwertberger
Copy link

Summary of the issue:

I'm currently working on accessibility support for wxGrid.
This is a generic widget in wxWidgets and therefore does not inherit accessibility support from a native Windows widget.

I'm using a structure as described here: https://learn.microsoft.com/en-us/previous-versions/windows/desktop/dnacc/exposing-data-tables-through-microsoft-active-accessibility

So accessibility support is done via a hierarchy of IAccessible:

ROLE_SYSTEM_TABLE
  |- ROLE_SYSTEM_ROW
  |  |- ROLE_SYSTEM_ROWHEADER
  |  |- ROLE_SYSTEM_COLUMNHEADER
  |  |- ROLE_SYSTEM_COLUMNHEADER
  |     '- ..
  |- ROLE_SYSTEM_ROW
  |  |- ROLE_SYSTEM_ROWHEADER
  |  |- ROLE_SYSTEM_CELL
  |  |- ROLE_SYSTEM_CELL
  |   '- ..
  |- ROLE_SYSTEM_ROW
  |  |- ROLE_SYSTEM_ROWHEADER
  |  |- ROLE_SYSTEM_CELL
  |  |- ROLE_SYSTEM_CELL
  |   '- ..
   '- ..

I'm using two levels of IAccessible. One for the wxGrid itself and one for grid table rows. The cells just have childIds>0 within the table rows.
(I have also tried three levels, but the problems are the same.)

I have a basic structure running.
E.g. when moving the mouse, NVDA will recognize cells from the results provided by HitTest. It will display Name, Value, Description for the cell, as queried from the row via childId representing the column number.

There are problems, though, when the user is navigating through the grid using the arrow keys.
When the focus is moving to a new cell, I'm sending out EVENT_OBJECT_FOCUS like this:
wxAccessible::NotifyEvent(wxACC_EVENT_OBJECT_FOCUS, this, wxOBJID_CLIENT, objectId);

One problem is that objectId refers to the row number. So, if the user moves from one column to the next, NVDA will just discard the new focus event as it looks identical to the previous one.
This problem could be worked around by a change to processFocusNVDAEvent. See my commit.

The other problem is that NVDA will act as if the row is focused, not a cell. So it will just display Name, Value, Description for the row, not for the column.
I have experimented a bit, but could not see how to work around this. The row does not return a status STATE_SYSTEM_FOCUSED.
I looked around and added a method event_gainFocus to IAccessible.
Inside this, the focused column would be available as self.IAccessibleObject.accFocus, but I don't know how to make NVDA actually use this information.

An alternative implementation on the wxWidgets side would be to use only one level of IAccessible with childIds representing cells instead of rows. This seems odd, though.

@AppVeyorBot
Copy link

See test results for failed build of commit 845554cf2d

@DietmarSchwertberger
Copy link
Author

JAWS also does not support hierarchical tables. I have contacted their support whether they plan to support it.

@seanbudd
Copy link
Member

seanbudd commented Jan 7, 2024

Please update your pull request to use our pull request template.
If you intend to discuss a proposed fix or strategy more thoroughly I would encourage an issue or discussion first rather than jumping to a solution

@DietmarSchwertberger
Copy link
Author

DietmarSchwertberger commented Jan 7, 2024

I would encourage an issue or discussion first rather than jumping to a solution

I thought about this, but PRs have built-in support for code diffs while for the alternatives, these need to be created manually...

@seanbudd seanbudd added blocked/needs-info The issue can not be progressed until more information is provided. blocked/needs-product-decision A product decision needs to be made. Decisions about NVDA UX or supported use-cases. blocked/needs-technical-investigation Issue is blocked. A technical investigation is required to progress the issue. labels Jan 8, 2024
@DietmarSchwertberger
Copy link
Author

I did not yet get feedback about JAWS support for the hierarchical tables/rows/cells.
The hierarchical implementation of wxGrid accessibilty would only make sense if both major screen readers would support it.

I do not use screen readers myself, except for debugging wxGlade and wxWidgets.
Is there a difference in usability between the two possible variants?

  • grid -> M rows -> N cells per row
  • grid -> M*N cells

I would imagine that most navigation would be done via keyboard.

I would like to get some best practice examples.
Does anyone know some freeware programs with grids that work well with NVDA?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/needs-info The issue can not be progressed until more information is provided. blocked/needs-product-decision A product decision needs to be made. Decisions about NVDA UX or supported use-cases. blocked/needs-technical-investigation Issue is blocked. A technical investigation is required to progress the issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants