... preparatory to removing that overload.
This overload is used in exactly these files:
DevicePrefs.cpp (displaying host names retrieved by portaudio, which are not
defined in Audacity source)
EffectsPrefs.cpp
ExportFLAC.cpp (twice)
ExportMultiple.cpp (displaying the descriptions defined in the several export
plugin classes)
GUIPrefs.cpp (four times: languages, manual location, theme, and meter DB
range; the language names themselves don't have localizations!)
MidiIOPrefs.cpp (displaying host names retrieved by portmidi)
TracksBehaviorsPrefs.cpp (for solo button choices)
There is also TieNumberAsChoice, used in QualityPrefs and elsewhere, which
calls through to that overload.
... with one exception (/FileFormats/FFmpegAACProfile),
the calls are replaced with TieNumberAsChoice.
Some unfortunately repetitious string tables are a small price in exchange for
reduced confusion in ShuttleGui.cpp
Untranslated strings are passed to TieNumberAsChoice, which is wrong, but that
will be made right in the next commit when we change the implementation of that
function
... Make the array of integer choices optional, and call through to the
non-deprecated overload of TieChoice, which uses strings.
In 2.3.3 this function is only used in the Quality preferences dialog.
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.
... Unnecessary because transitively included.
But each .cpp file still includes its own .h file near the top to ensure
that it compiles indenendently, even if it is reincluded transitively later.
... I think this is a defect in wxWidgets, but one we can work around with a
simple wrapper class around wxSlider overriding one method.
To make the fix complete, change all occurrences of "safenew wxSlider"
but the one in ShuttleGui.cpp covers most cases
... This should cover most of the neglected cases, where a choice was added
by ShuttleGui.
There are some places where choices are added directly: scan the soure for
"safenew wxChoice"
I think there are still uncovered cases then in Grid.cpp, LV2 Effects, and in
commented-out parts of Transcription toolbar.
Are these important?
(This reinstates commit d2c112600d38f0894fe783f8dfd8861b5e604fce, which had
been reverted at 21a1260f912a9cb0ac8bff4f6e0fd7f8132f01ca, but making the
changes conditionally compiled on Mac only.)
This reverts commit d2c112600d38f0894fe783f8dfd8861b5e604fce.
On Windows, it is intentional that SetAccessible is not called for wxChoice in ShuttleGui.
See the commit message of f9ee3cd for background.
Changing this during code freeze and close to creating release candidates would have the danger of introducing bugs.
Fixing this bug needs further discussion. Hopefully the Mac accessibility code can be changed to bring it into line with the changes in the wxWidets accessibility code when we moved to 3.1.1
... This should cover most of the neglected cases, where a choice was added
by ShuttleGui.
There are some places where choices are added directly: scan the soure for
"safenew wxChoice"
I think there are still uncovered cases then in Grid.cpp, LV2 Effects, and in
commented-out parts of Transcription toolbar.
Are these important?
... those taking wxString as default value, or reference to wxString as the
target variable.
There remain one that takes reference to int as target, and one taking
reference to double; and one taking a config path and a double default value,
passed by const reference. Some of the calls to the last pass an int default
value which was, and still is, implicitly converted to double.
... except Audacity.h
This forces us to make each header contain all forward declarations or nested
headers that it requires, rather than depend on context.
... except Audacity.h; and in no others.
Do so even if Experimental.h gets multiply included, as in both the .h and
.cpp files.
This makes it easier to do a text scan to be sure there are no unintended quiet
changes of meaning because of omission of Experimental.h when the flag is
an enabled one.
Also move inclusions of Experimental.h earlier.
Also don't require Experimental.h to be preceded by Audacity.h to define
EXPERIMENTAL_MIDI_OUT correctly.
... instead use the utility make_iterator_range and its index() or contains()
method. This generic utility works with any container defining begin() and
end().
This further lessens dependency on wxWidgets container idioms.
... which will make it easier to change the types of those containers to
std::vectors of other string-like classes
for wxString,
IsEmpty => empty
Clear => clear
Alloc => reserve
for wxArrayString,
Count => size
GetCount => size
IsEmpty => empty
Add => push_back
Clear => clear
Empty => clear
Sort => std::sort (only with default comparator)
SetCount => resize
Last => back
Item => operator []
Alloc => reserve
It combines the old IdentInterface with the ParamsInterface, providing an identifier and parameters (if needed).
The main purpose of the change is to make the class hierarchy (as viewed via doxygen) much easier to follow.
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.
The name of the button was not being read as "help" by NVDA due to its built in appmodule for audacity. This meant that the empty label was being read rather than the accessibility name.
Fix: Call SetLabel. In addition, with the label being set, an accessible does not need to be set, because we can just let windows set the accessibility name from the label.
The main change in wxWidgets for the setting of accessibility names is:
7dab555f71 (diff-04f5191d86f95b1c4d5d9c979da65878)
Before this change, with wxUSE_ACCESSIBILITY set to 1, for wxWindow and all the classes derived from it, wxWidgets automatically created accessible objects to handle accessibility itself. Because the way wxWindowAccessible::GetName() was written, the accessibility names of lots of windows and controls had to be set using SetName().
After the change, by default, the accessibility of instances of these classes is handled by Windows. Where the accessibility of a control is handled by Windows, then the accessibility name is automatically set to so the appropriate value. However, an accessible can still be set using SetAccessible() then wxWidgets handles the accessibility for this object.
So for many controls we can just leave Windows to set the accessibility name. However, for controls which don't have any visible labels, or where we want to accessibility name to different from the visible text, then we have to set an accessible object for that control, and then call SetName(). The Class WindowAccessible can be used for this purpose. And for custom widgets, like the TrackPanel, and the NumericTextCtrl, SetAccessible() still has to be called, since they need bespoke accessible objects
So in the cases where we want the accessible name to be different from normal, we now need to explicitly set an accessible object. (Before, this wasn't needed, as accessible objects were automatically created.).
Some notes of the fixes included in this commit:
1. The fixes cover the main window, preferences, and built-in effects. Other fixes will follow.
2. In ShuttleGui, I've set accessible objects for wxTextCtrls and wxSliders. So all of these widgets still need the name set. This was done because there are a lot of instances where these controls need non standard accessibility names, and so it saves having to put lots of SetAccessibles throughout the code.
3. For wxPanel, Windows picks up the accessibility name from the label, and so SetLabel() can be used instead of SetName(). This is just as well, since for windows that contain other windows or controls, setting WindowAccessible as the accessibility object breaks the accessibility tree.
Note that at some stage a lot of calls to SetName() can be removed from the code as they are no longer needed, but it might be better to leave them there for the moment, just in case they are unexpectedly needed.
This removes the text saying 'Set' beside an optional item.
It's a more far reaching change, as it allows the optional items to be
aware they are optional, paving the way for future nicer presentation.