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.
Or more precisely, don't do append-record, if doing so would lose a channel - e.g. if there is only a mono track selected and recording is set to stereo.
Using v3.1.1 removes our custom fixes - of which the most important tis the rename-retry to deal with virus checkers. We'll bring that back in later with code in Audacity itself.
Use --recurse-submodules as wxWidgets now has png and other subprojects as submodules.
The commented out wxLogDebug statements in Theme.cpp give the
location of all the boxes in the theme. This is useful
for identifying what is in the theme cache for javascript code.
This #ifdeffed out TEST_CARD is useful for javascript code that shows how a
theme will look, when applied to Audacity. With the code enabled, each
pixel of audacity is painted with a colour that encodes the location in
the theme image map that was used.
Net result - in javascript you can change any colour in the theme cache
and instantly see how Audacity will look.
We want to use the fix ups that use NuGet. However, they break the windows build-bot. At the moment the windows build-bot is more important than the better locale code - hence reverting.
The main change in wx accessibility is this:
7dab555f71 (diff-04f5191d86f95b1c4d5d9c979da65878)
However wxWindowAccessible has not been updated to take into account of that change. In particular wxWindowAccessible::GetParent() was always wrong, but it was consistent with the rest of the framework. Now it's wrong and inconsistent. This function should return an object with role window, and which has the same name.
The fix is to introduce class WindowAccessible, which is effectively our own version of wxWindowAccessible. This class does not override GetParent(), and so just relies on a standard accessible object to to the right thing in wxIAccessible::get_accParent() (which is does). This class also allows us to have our own version of GetName(), which allows us to set the accessibility names of buttons.
These changes will break the accessibility of Audacity if it is built with wxWidgets 3.0.X. If this is a problem, then there could be some #if stuff in WindowAccessible.h to turn the WindowAccessible class into one which simply inherits from wxWindowAccessible, and doesn't override anything.
This was done on a Ubuntu 14.04 system with wxWidgets 3.1.1 installed.
The resulting buildfiles successfully build Audacity on Ubuntu 14.04 (with 3.1.1) and on Travis (with 3.0.0).
- Upped version number to Audacity 2.3.0 in configure.ac
- configure.ac now wants 3.1.1 but still accepts 3.0.0 (for top level, lib-widgets-extra and mod-nyq-bench)
- .travis.yml now apt-gets autopoint. This allows us to do an autoreconf -ivf on Travis, IF we want to, but i snot used yet.
- FileDialog MakeFile.am now has LDFLAGS to resolve libtools issue on Travis with missing --tags=CXX
Previously lib-src that we controlled had their cmake files with them. This is clearer.
Also added place holders for help and locale.
Also enabled libvorbis and soundtouch and disabled portburn.
https://github.com/sakra/cotire
Currently we only use it for precompiled headers for Audacity src.
There is a 'unity' build, but it needs work by us to fix it for duplicate
definition.
These now all appear in the MSVC project.
Currently only FileDialog, Nyquist, mod-script-pipe compile and link, and Audacity compiles.
Still to set include directories and flags for most of the libs.