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

dotnet 7, winforms, _get_columnCount is not implemented #15283

Closed
beqabeqa473 opened this issue Aug 11, 2023 · 6 comments · Fixed by #15295 or #15799
Closed

dotnet 7, winforms, _get_columnCount is not implemented #15283

beqabeqa473 opened this issue Aug 11, 2023 · 6 comments · Fixed by #15295 or #15799
Assignees
Labels
p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Milestone

Comments

@beqabeqa473
Copy link
Contributor

Steps to reproduce:

  • create a new winforms project;
  • add a listview to a form;
    *Add multiple columns to a listview;
  • Create a new item and add subItems.

Actual behavior:

NVDA cannot get information about existing columns

Expected behavior:

NVDA should be able to fetch information about columns. Narrator and jaws can do it.

NVDA logs, crash dumps and other attachments:

Traceback (most recent call last):
File "scriptHandler.pyc", line 295, in executeScript
File "globalCommands.pyc", line 1415, in script_navigatorObject_firstChild
File "baseObject.pyc", line 62, in get
File "baseObject.pyc", line 168, in _getPropertyViaCache
File "NVDAObjects\behaviors.pyc", line 825, in _get_firstChild
File "NVDAObjects\behaviors.pyc", line 820, in _makeCell
File "baseObject.pyc", line 62, in get
File "baseObject.pyc", line 168, in _getPropertyViaCache
File "NVDAObjects\behaviors.pyc", line 791, in _get_childCount
File "baseObject.pyc", line 62, in get
File "baseObject.pyc", line 168, in getPropertyViaCache
File "NVDAObjects\UIA_init
.pyc", line 1917, in _get_columnCount
NotImplementedError

System configuration

NVDA installed/portable/running from source:

Installed

NVDA version:

alpha-28868,a198c9b5 (2023.3.0.28868)

Windows version:

Windows 10 22H2 (AMD64) build 19045.3208

Name and version of other software in use when reproducing the issue:

An app created using windows forms.

Other information about your system:

Other questions

Does the issue still occur after restarting your computer?

Yes

Have you tried any other versions of NVDA? If so, please report their behaviors.

No

If NVDA add-ons are disabled, is your problem still occurring?

Yes

Does the issue still occur after you run the COM Registration Fixing Tool in NVDA's tools menu?

Yes

Additional information

I am attaching a sample project with prebuilt binaries
WinFormsApp1.zip

@ABuffEr
Copy link
Contributor

ABuffEr commented Aug 12, 2023

Hi @beqabeqa473,
I tried for curiosity, as author of ColumnsReview.
Are you sure to have created the list correctly?
Because, investigating from NVDA console, I cannot see a list object, just listitems, and this sounds quite strange...

@beqabeqa473
Copy link
Contributor Author

beqabeqa473 commented Aug 12, 2023 via email

@beqabeqa473
Copy link
Contributor Author

Further investigation showed that winforms incorrectly exposes listview for IAccessible, however i am not sure this is a bug from winforms team side.
The problem is that UIA implementation of ListItem in NVDA is incomplete and earlier it was simpler to include syslistview32 as a badUIA window and however WindowsForms.syslistview32 is beeing normalizedand passed as syslistview32 to the badUIA window comparison this is also beeing excluded.

The correct way to fix this should be to complement UIA ListItem and make it to behave like IAccessible one and remove definition from badUIA window list.
What do you think would be a correct solution?
CC @michaelDCurran @LeonarddeR I think you better know internals of UIA things of NVDA.

@LeonarddeR
Copy link
Collaborator

I'm pretty sure the Winforms listview has a native UIA implementation nowadays. I will look into this later this week.

@LeonarddeR LeonarddeR self-assigned this Aug 14, 2023
@beqabeqa473
Copy link
Contributor Author

beqabeqa473 commented Aug 14, 2023 via email

@seanbudd seanbudd added p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation. labels Aug 15, 2023
seanbudd pushed a commit that referenced this issue Aug 21, 2023
…on (#15295)

Fixes #15283

Summary of the issue:
.NET 7 Win Forms has a native implementation for SysListView32 controls. This conflicts with us listing SysListView32 as a bad UIA Class name.

Description of user facing changes
Win forms project in #15283 now works as expected for the most part.

Description of development approach
Implemented SysListView32 in a new UIA module. Note that UIA seems to expose the following tree by default:

A list object
Children for the list items having the ListItem control type, but neither GridItem nor TableItem patterns
Sub items containing both GridItem and TableItem patterns.
I did the following:

Introduced fetching of children text and column headers, mostly based on the Outlook app module
Implement position info based on row number of the first child and total row count of parent
@nvaccessAuto nvaccessAuto added this to the 2023.3 milestone Aug 21, 2023
seanbudd added a commit that referenced this issue Sep 28, 2023
Fixes #15541
Reverts #15295
Reopens #15283

See also #15503, #15333

Summary of the issue:
There are several known cases where UIA is not correctly supported for SysListView32.
Reliability History is the most recently raised, with task manager and management console being raised earlier.
As this is close to a beta, it is safer to just declare SysListView32 as bad for UIA for all applications.

Description of user facing changes
Reopens issues with SysListView32 and windows forms applications
Fixes issue with reading Reliability History, and potentially also resource monitor.

Description of development approach
declare SysListView32 as bad for UIA for all applications.
@seanbudd seanbudd reopened this Sep 28, 2023
@seanbudd
Copy link
Member

Reopened by #15542

@seanbudd seanbudd removed this from the 2023.3 milestone Sep 28, 2023
@nvaccessAuto nvaccessAuto added this to the 2024.1 milestone Nov 22, 2023
seanbudd pushed a commit that referenced this issue Nov 22, 2023
Fixes #15283

Summary of the issue:
In Windows Forms applications, errors occur in list view controls.

Description of user facing changes
Win forms project in #15283 now works as expected for the most part.

Description of development approach
Rather than the previous approach where we removed the listing of SysListView32 from the list of bad UIA class names, this adds a specific utility function to checks for a Framework Id of WinForm. If that's the case, we use UIA for SysListView32, as it seems these implementations are mature enough.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p4 https://github.com/nvaccess/nvda/blob/master/projectDocs/issues/triage.md#priority triaged Has been triaged, issue is waiting for implementation.
Projects
None yet
5 participants