From 43145e0a49fd38b8d7aac9269c1e6c27becf1562 Mon Sep 17 00:00:00 2001 From: David Bailes Date: Mon, 22 Jul 2019 11:12:15 +0100 Subject: [PATCH] Bug 2169 - Modules page of preferences is not read by NVDA This is caused by the same problem that caused bug 1980. This was fixed for check boxes by commit 42efe53. Note that the bug in NVDA's audacity appmodule affects controls with the class button: button, check boxes, radio buttons and group boxes. The fix is similar to the fix for bug 1980: For group boxes which have an empty label, set the accessibility name to "\a", which is non-empty, but not read by screen readers. --- src/ShuttleGui.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index ddeab28ac..08d597c09 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -793,7 +793,15 @@ wxStaticBox * ShuttleGuiBase::StartStatic(const wxString &Str, int iProp) wxStaticBox * pBox = safenew wxStaticBoxWrapper(GetParent(), miId, Str ); pBox->SetLabel( Str ); - pBox->SetName(wxStripMenuCodes(Str)); + if (Str.empty()) { + // NVDA 2018.3 or later does not read the controls in a group box which has + // an accessibility name which is empty. Bug 2169. +#if wxUSE_ACCESSIBILITY + // so that name can be set on a standard control + pBox->SetAccessible(safenew WindowAccessible(pBox)); +#endif + pBox->SetName(wxT("\a")); // non-empty string which screen readers do not read + } mpSubSizer = std::make_unique( pBox, wxVERTICAL );