1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-19 17:40:51 +02:00

Bug 1980: NVDA 2018.3 and check boxes with empty accessibility names

Problem. NVDA 2018.3 does not read buttons, check boxes or radio buttons which have empty accessibility names. In fact for Scriptable dialogs which start with a check box with an empty accessibility name, none of the controls in the dialog are read.

This problem is connected with the new Audacity appModule in NVDA 2018.3 which was supplied by Robert and myself. For reasons which aren't immediately obvious, it has a problem when the accessibility name of the object is empty.

Fix: for check boxes which have an empty label, set the accessibility name to "\a", which is non-empty, but not read by screen readers.

Note: If someone ever wanted to have buttons or radio buttons with empty labels, there could be a similar fix. But there is unlikely to be a demand for such controls.
This commit is contained in:
David Bailes 2018-09-18 15:48:56 +01:00 committed by James Crook
parent d3d969944c
commit 42efe53884

View File

@ -313,7 +313,15 @@ wxCheckBox * ShuttleGuiBase::AddCheckBox( const wxString &Prompt, const wxString
mpWind = pCheckBox = safenew wxCheckBox(GetParent(), miId, realPrompt, wxDefaultPosition, wxDefaultSize,
Style( 0 ));
pCheckBox->SetValue(Selected == wxT("true"));
pCheckBox->SetName(wxStripMenuCodes(Prompt));
if (realPrompt.IsEmpty()) {
// NVDA 2018.3 does not read controls which are buttons, check boxes or radio buttons which have
// an accessibility name which is empty. Bug 1980.
#if wxUSE_ACCESSIBILITY
// so that name can be set on a standard control
pCheckBox->SetAccessible(safenew WindowAccessible(pCheckBox));
#endif
pCheckBox->SetName(wxT("\a")); // non-empty string which screen readers do not read
}
UpdateSizers();
return pCheckBox;
}