1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 08:38:39 +02:00

108 Commits

Author SHA1 Message Date
Paul Licameli
7675d51044 Separate function TieIntegerTextBox...
... For the cases in which there is an associated preference variable which
should be a whole number
2019-11-28 13:18:33 -05:00
Paul Licameli
7fbe97c5ca Privatize, rename ShuttleGuiBase member fns (those using WrappedType) 2019-11-28 12:54:57 -05:00
Paul Licameli
9b41741074 Remove an overload of TieChoice; use more ChoiceSetting instead...
... this also corrects some mis-specifications of the default choice, formerly
by string instead of array position
2019-11-27 13:38:16 -05:00
Paul Licameli
087ac5e6c9 Change one overload of TieChoice to expect un-translated strings...
... 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.
2019-11-27 13:38:16 -05:00
Paul Licameli
5638d6844f Eliminate an overload of TieChoice...
... 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
2019-11-27 13:38:16 -05:00
Paul Licameli
dc3e872ca6 Reimplement TieNumberAsChoice and fix some comments...
... 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.
2019-11-27 13:38:06 -05:00
Paul Licameli
0493aaccee TieChoice needs only const reference to ChoiceSetting 2019-11-27 13:37:26 -05:00
Paul Licameli
e008a44022 Pass ChoiceSetting to StartRadioButtonGroup...
... and we don't need to pass strings to TieRadioButton.

This removes some repetition of string literals in import/export, which is
good too.
2019-11-27 13:37:25 -05:00
Paul Licameli
c5e21ead18 Rename, privatize, combine ShuttleGui members related to radios 2019-11-27 13:37:25 -05:00
Paul Licameli
89f3369556 Some WrappedType members just for radio buttons are no longer needed 2019-11-27 13:37:25 -05:00
Paul Licameli
c8a8c6a3fa Remove radio button function overloads made unused in previous commit 2019-11-27 13:37:24 -05:00
Paul Licameli
1236c5bfed class EnumValueSymbols lets you specify a table...
... of EnumValueSymbol either row-wise or column-wise
2019-11-27 13:37:23 -05:00
David Bailes
43145e0a49 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.
2019-07-22 11:12:15 +01:00
Paul Licameli
4da02d667f ShuttleGui.cpp and ShuttlePrefs.cpp have fewer dependencies...
... Freeing 13 files from cyclic dependencies
2019-05-18 20:29:25 -04:00
Paul Licameli
6c57948d8f Remove unnecessary #include-s from .cpp files...
... 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.
2019-05-16 17:21:00 -04:00
Paul Licameli
7ad6897598 Move class ShuttleGuiGetDefinition near its only point of use 2019-05-16 12:30:27 -04:00
Paul Licameli
ad26c35d3c Fix Tab key navigation on Mac in presence of static boxes 2019-05-01 07:50:34 +01:00
Paul Licameli
c8d95e1117 Bug2105: Enable TAB to sliders on Mac...
... 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
2019-04-30 21:50:22 +01:00
Paul Licameli
498507ddd3 Bug1848: Mac VoiceOver should read names of choice controls...
... 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.)
2019-04-26 11:55:08 -04:00
David Bailes
21a1260f91 Revert "Bug1848: Mac VoiceOver should read names of choice controls..."
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
2019-04-26 09:05:22 +01:00
Paul Licameli
d2c112600d Bug1848: Mac VoiceOver should read names of choice controls...
... 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?
2019-04-25 13:11:53 -04:00
Paul Licameli
1649e3669e Rename EnumSetting -> ChoiceSetting, EncodedEnumSetting -> EnumSetting 2019-04-07 16:42:11 -04:00
Paul Licameli
70e88782fe Remove wx/{grid,font,ffile,colour,button,bmpbuttn}.h from headers 2019-03-28 12:27:10 -04:00
Paul Licameli
b8aea73c91 Remove wx/stattext.h from headers 2019-03-27 14:33:46 -04:00
Paul Licameli
7766d9a192 AddCheckBox takes a bool for initial state, not string 2019-03-27 12:58:40 -04:00
Paul Licameli
75e44df43d Make windows inside wxStaticBox its children, not its siblings...
... as is recommended by wxWidgets documentation for version 2.9.1 and later:

http://docs.wxwidgets.org/3.0/classwx_static_box.html
2019-03-26 13:05:22 -04:00
Paul Licameli
a915a510bd include <wx/setup.h> in all files where wxUSE* macros are used...
... even if it's redundant; improving on what was done at b47e2f9
2019-03-23 14:56:02 -04:00
Paul Licameli
80ca1dc5fc Remove unused overloads of ShuttleGuiBase::TieNumericTextBox...
... 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.
2019-03-20 13:50:58 -04:00
Paul Licameli
393719bbdf Remove unused overload of ShuttleGuiBase::TieTextBox...
... No need to tie a double-default-valued checkbox that is NOT numeric.
2019-03-20 11:32:30 -04:00
Paul Licameli
d326220f0c fix typo in comment 2019-03-18 18:33:33 -04:00
Paul Licameli
5e7d41ec07 Each .cpp/.mm file includes corresponding header before any other...
... 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.
2019-03-17 22:54:52 -04:00
Paul Licameli
906e55f047 Experimental.h in all .h or .cpp files that directly use EXPERIMENTALs...
... 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.
2019-03-17 22:54:00 -04:00
Paul Licameli
173a300427 Include nothing before Audacity.h, as comments say we should...
... and remove some duplicated inclusions
2019-03-17 21:41:39 -04:00
Paul Licameli
dd86346156 ShuttlegGUI: const wxArrayStringEx & arguments, not wxArrayString *...
... for choice, combo, and listbox; reference allows passing temporaries,
eliminating need for some variables to hold the string arrays.
2019-03-16 07:17:21 -04:00
Paul Licameli
dcd82b8ef5 ShuttleGui::AddChoice takes int to specify selection, with a default...
... This makes things brief and where non-default avoids some repetition of
literal strings
2019-03-15 23:35:13 -04:00
Paul Licameli
dd8eb9e3d9 Less use of wxArrayString::Index() ...
... 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.
2019-03-10 14:45:06 -04:00
Paul Licameli
2db49dc1f0 Use standard library style members of wxArrayString (and wxString) ...
... 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
2019-03-10 14:43:57 -04:00
Paul Licameli
a5e0b66d1f WrappedType is immutable (though it points to something mutable) 2019-03-10 12:38:35 -04:00
James Crook
466e9c179e Create ComponentInterface
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.
2018-11-02 17:04:43 +00:00
David Bailes
42efe53884 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.
2018-09-18 16:33:26 +01:00
David Bailes
8e71ebca87 Fix accessibility of Help button in dialogs
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.
2018-04-12 08:56:14 +01:00
Steve Daulton
564e840d54 Fix background colour of Prefs
On Linux, it is not necessary to explicitly set the background colour
here, but left a comment in case it is required on other platforms.
2018-04-08 18:18:54 +01:00
David Bailes
f9ee3cdc45 Fix some of the accessibility names that disappeared with the move to WX 3.1.1
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.
2018-04-06 17:24:40 +01:00
Paul Licameli
0bc96c3831 Oops, Internal() was needed here, not Translation() 2018-03-26 01:06:24 -04:00
Paul Licameli
eb35d84092 GetInfo for Preferences lists internal enum names, not translated 2018-03-25 14:52:51 -04:00
Paul Licameli
17cc8a495f Define and use TieNumberAsChoice for Quality sample rate setting 2018-03-25 14:48:52 -04:00
Paul Licameli
872b4f430c New overload of TieChoice taking EnumSetting...
... and change misleading argument names
2018-03-25 14:05:05 -04:00
Paul Licameli
f7f721b52d Automatic setting size hints in all choice controls in ShuttleGui...
... excpet in a few places that populate the choice control late and then
do it explicitly
2018-03-20 14:42:36 -04:00
James Crook
2c57cd4344 Format dialogs more evenly. 2018-03-18 20:05:27 +00:00
James Crook
e978840044 Remove 'Set' from optional items.
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.
2018-03-18 20:05:10 +00:00