Windows 11 Notepad: announce status bar if shown#13690
Merged
seanbudd merged 6 commits intonvaccess:masterfrom May 17, 2022
Merged
Windows 11 Notepad: announce status bar if shown#13690seanbudd merged 6 commits intonvaccess:masterfrom
seanbudd merged 6 commits intonvaccess:masterfrom
Conversation
… 11 that allows NVDA to announce status bar text if shown. Re nvaccess#13688. Introduce a new Windows 11 Notepad app module (notepad.exe). With the new UI design, status bar cannot be obtained as in prior Notepad releases. Thankfully it is possible to traverse the UIA tree to obtain the status bar object from a specific child element positiion (this is because child elements have the same UIA class name). Also, statsu bar is shown if focused on the document window (rich edit) and enabled from view menu.
seanbudd
reviewed
May 16, 2022
seanbudd
reviewed
May 16, 2022
…ccess#13688. Advised by Sean Budd (NV Access): add an explanation and a variable about Notepad 11 status bar (look for a specific UIA element (child of the foreground window) that hosts status bar text if visible).
…13688. Advised by Sean Budd (NV Access): add a docstring for status bar retrieval method to highlight: * The need for this routine * Needing to check status bar child position whenver Notepad is updated (Windows 11 NOtepad is updated through Microsoft Store as opposed to being tied to a specific Windows release).
…access#13688. Advised by Sean Budd (NV Access): should the app module method fail (and raise NotImplementedError), api.getStatusBar will resort to position lookup, therefore document this aspect.
Contributor
Author
|
Hi, done.
|
seanbudd
approved these changes
May 17, 2022
Contributor
Author
|
Hi, will add a note about that (a combination of manual object navigation and Python Console was used to determine the index; the older version of Notepad 11 placed the status bar somewhere different in the UIA tree, so I used the same approach then). Thanks.
From: Sean Budd ***@***.***>
Sent: Sunday, May 15, 2022 9:39 PM
To: nvaccess/nvda ***@***.***>
Cc: Joseph Lee ***@***.***>; Author ***@***.***>
Subject: Re: [nvaccess/nvda] Windows 11 Notepad: announce status bar if shown (PR #13690)
@seanbudd commented on this pull request.
_____
In source/appModules/notepad.py <#13690 (comment)> :
+ # Look for a specific child as some children report the same UIA properties such as class name.
+ statusBar = api.getForegroundObject().children[7].firstChild
Could you add a brief note on how you determined that this is the index? Is there any MS documentation for this?
⬇️ Suggested change
- # Look for a specific child as some children report the same UIA properties such as class name.
- statusBar = api.getForegroundObject().children[7].firstChild
+ # Look for a specific child as some children report the same UIA properties such as class name.
+ notepadStatusBarIndex = 7
+ statusBar = api.getForegroundObject().children[notepadStatusBarIndex].firstChild
—
Reply to this email directly, view it on GitHub <#13690 (review)> , or unsubscribe <https://github.com/notifications/unsubscribe-auth/AB4AXEDPL5FOFNPWRKBU6CTVKHGMRANCNFSM5VYK6ACQ> .
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #13688
Summary of the issue:
With the redesigned Windows 11 Notepad, users cannot obtain statsu bar information.
Description of how this pull request fixes the issue:
Introduce a new Windows 11 Notepad app module (notepad.exe). With the new UI design, status bar cannot be obtained as in prior Notepad releases. Thankfully it is possible to traverse the UIA tree to obtain the status bar object from a specific child element position (this is because child elements have the same UIA class name). Also, status bar is shown if focused on the document window (rich edit) and enabled from view menu.
Testing strategy:
Manual testing:
Known issues with pull request:
None, although status bar position may need to be changed if Microsoft updates Notepad interface in future releases.
Change log entries:
Bug fixes:
NVDA will announce status bar content in Windows 11 Notepad. (#13386
Code Review Checklist: