... as a preparation for splitting up class AudacityProject.
Use ProjectWindow as an alias for AudacityProject, and fetch it from the
project with a static member function, where certain of its services are used;
pretending they are not the same class.
Use global accessor functions to get wxFrame from the project where only
wxFrame's member functions are needed, so there will be less dependency on
ProjectWindow when it becomes a distinct class.
... 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.
Problem:
In the Macros window, the list of steps has a dummy empty column, which is a workaround for getting the Num column to be right aligned. Narrator reads the table/list as having 4 columns which is confusing. In addition, when arrowing down such a list, Narrator initially just reads the contents of the first column, which is unfortunately an empty string.
Fix:
After all the columns have been inserted, the dummy column can be deleted. This workaround was suggested in some Microsoft documentation.
Note:
I've made what I think is a correct change for some Mac specific code, but haven't tested this.
... 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
... This forces a better placement of state variables in the appropriate
classes.
In future perhaps, MenuManager should be splintered into several classes, one
for each of the main toolbar menus.
1. For both the macros list and the steps list, when focus first moves to the list, an item is selected but not the focus.
2. After editing a step, focus is not returned to that step in the list.
Fix for 1: in the calls of SetItemState(), include the wxLIST_STATE_FOCUSED flag.
Fix for 2: The fix for 1 fixed 2. Not sure why.
AudacityProject::Save() is now batch mode sensitive, and if in batch mode (and not overwriting) will save without prompting.
The loop for applying macros to multiple files now also clears down the project, using the new function ResetProjectToEmpty().
1. Set accessibility names for the buttons for applying a macro to the project or files. Note that although these names are not read by NVDA 2018.2, they will be read by NVDA 2018.3
2. Remove access keys from wxStaticText controls, as they do not work on this type of control.
Previously the ID for a macro was, e.g. Macro003. However this would
not work if macros were added or deleted, since chains containing the old
macro references would now refer to a different macro. So changed to using
names.
Done by giving Macros... dialog an Expand / Shrink button
so that we can use it as just an apply-to-projects dialog, if we want.
The dialog is modal, and can be kept open whilst we work. So for example
we could put useful presets into it as macros.