Commit Graph

47 Commits

Author SHA1 Message Date
Paul Licameli 64d7ca7403 New utility library 2021-06-02 07:08:19 -04:00
Paul Licameli e6e96de0fd Replace most inclusions of MemoryX.h with <memory> ...
... Most often it was needed for a custom definition of std::make_unique, but
we build C++14 now.
2021-06-02 07:08:19 -04:00
Paul Licameli c5ebc396eb Audacity.h has shrunk to nothing, now remove it! 2021-05-10 00:05:23 -05:00
James Crook d47264accf Fix compilation with llvm 11.0.1 2021-04-19 12:59:36 +01:00
David Bailes 6c44b4fdc0 Bug 2648: Grid accessibility: location can be incorrect.
The focus location provided to assistive technology by GridAx::GetLocation() does not take into account horizontal or vertical scrolling. So if there is any scrolling in either the Metadata or Labels editor, the focus location provided to assistive technology is not the same as the focus location shown by wxWidgets.
2021-01-29 16:25:26 +00:00
Leland Lucius 3e8e5aa1f5 Ensure selected cell in visible 2021-01-27 10:03:33 -06:00
Leland Lucius e5bb95d6f2 Bug 2083 - Labels Editor has confusing selection interface - can cause wrong labels to be deleted 2021-01-26 12:18:51 -06:00
Leland Lucius 3d632d397d Ensure row selection mode is used in grids 2021-01-25 12:57:33 -06:00
Leland Lucius 0fcf9ffb52 Bug 2083 - Labels Editor has confusing selection interface - can cause wrong labels to be deleted 2021-01-25 01:13:02 -06:00
Leland Lucius 4b07fbaa8a Bug 2642 - Metadata Editor: Cut and paste does not work 2021-01-23 17:27:31 -06:00
Henric Jungheim 639a82a4a0
Be more careful when handling grid keyboard navigation. (#589)
If the grid is empty or does not have a selected cell, the current
row and column must still maintain these class invariants:
   -1 <= current_row < rows
   -1 <= current_column < columns
    if either current_row or current_column is -1, then the other
       shall also be -1

wxGrid uses wxGridNoCellCoords to test for current_row == -1 &&
current_column == -1.  We treat the case where only one
of the coordinates is -1 as if both are -1.
2020-06-29 16:34:50 +01:00
Leland Lucius e7e27aa7e9 Bug 2478 - Windows: with an empty rules list in "Extended Import" prefs - Tab or Home crashes Audacity 2020-06-15 08:55:38 -05:00
David Bailes ca13f08ff8 Grid accessibility: incorrect focus can be read
Problem: this affects NVDA and Narrator, but not Jaws. If a user moves to the Delete button and presses it to delete a label, a label is incorrectly read as the new focus - the focus remains on the Delete button.
GridAx::SetCurrentCell() can be called when the Grid is not the focus, and send a focus event.

Fix: In GridAx::SetCurrentCell() only send an focus event if the Grid is the focus.
2019-05-17 11:06:49 +01: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 ed29ab89f8 Many WindowAccessible subclasses moved out of header files 2019-03-31 13:27:18 -04:00
David Bailes 8c10682145 Accessibility: make Grid accessible using Narrator
Problem:
Using the Narrator screen reader on Windows 10:
1. Narrator does not read the uneditable cells in the tag column of the Metadata editor.
2. In one or more versions of Windows 10 prior to 1809, Narrator's focus was incorrect after editing a cell.

Fixes:
1. Fixed by adding wxACC_STATE_SYSTEM_FOCUSED to the state.
2. Corrected GridAx::GetFocus().
2019-03-25 11:54:12 +00: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 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 dfeb7e18aa Type aliases for some uses of ComponentInterfaceSymbol...
... to be replaced later with distinct types

Also changing FamilyId => Family in function names

Also NumericFormatId => NumericFormatSymbol
2019-03-14 17:26:20 -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
David Bailes f027708fe1 Fix an issue caused by the accessibility changes in wxWidgets 3.1.1
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.
2018-04-03 14:57:59 +01:00
Paul Licameli 0fb02a8024 IdentInterfaceSymbol in NumericTextCtrl; don't persist translated 2018-03-28 14:00:17 -04:00
Paul Licameli 5724780be9 NumericTextControl ctor arguments...
... follow wxWidgets conventions for first two arguments; add Options
2018-02-21 19:21:02 -05:00
Paul Licameli c6696f1b49 Move definition of _ and related into Internat.h 2018-01-06 21:03:32 -05:00
Paul Licameli 71efb13161 Remove some naked new amd delete in: widgets 2016-08-08 07:51:26 -04:00
David Bailes 176a977617 In Grid fix accessibility names of cells to handle frequencies.
In commit 9c687f0, TimeEditors etc were generalized to handle both times and frequencies.

This fixes the accessibility names of cells to handle frequencies.
2016-06-28 15:02:40 +01:00
Paul Licameli 9c687f055c Generalize TimeRenderer and TimeEditor to handle frequencies in grid 2016-06-27 18:41:42 -04:00
Paul Licameli 8943f682f2 some safenew, override, remove an unused function, better comment 2016-06-27 18:40:58 -04:00
Paul Licameli db137ddf76 wxWindow takes ownership of its wxAccessible, so we can use safenew. 2016-05-06 21:03:37 -04:00
Paul Licameli 83e9e7de97 Clone functions required by wxWidgets base classes can use safenew 2016-04-06 14:08:43 -04:00
Paul Licameli df6a7c5464 More uses of safenew for classes we derive from wxWindow classes...
... Also removed some unnecessary deletes of widgets that are managed by parent
windows
2016-02-14 20:39:28 -05:00
Paul Licameli 3f237daddc Use macro safenew for many allocations of wxWindow subclasses 2016-02-14 20:20:19 -05:00
Paul Licameli 7c4c45a0d5 "new"->"NEW" in comments, easier to find remaining naked operator new 2016-02-14 18:52:41 -05:00
lllucius 431166561e Getting rid of some warnings...mostly unused parms 2014-12-15 21:51:02 +00:00
james.k.crook@gmail.com 649315c644 From: martin@steghoefer.eu [patches 0017 and 0018] Fix compilation problem with wxWidgets 3.0:
0017: Encapsulation of reference type returned by wxString::operator[]
0018: Interface change for classes deriving from wxGridTableBase


0017
----
The NumericTextCtrl relies on the fact that the value returned by
wxString::operator[] is a "wxChar&". However, in wxWidgets 3.0 it is a
wxUniCharRef (encapsulation of a reference to characters, to improve unicode
handling).

wxString::reference provides the correct type in both wx2.8 and wx3.0 and can be
used as writable reference in both cases. However, for the case of an update of
the reference itself (instead of the value), there is no common syntax. In this
case the character position within the string has to be used as reference.

0018
----
With wx3.0, different methods have to be implemented (EndEdit with new signature
and ApplyEdit) than with wx2.8 (only EndEdit with old signature). Now both
versions are implemented in parallel in the classes TimeEditor and ChoiceEditor
(one version essentially being a wrapper of the other one).

Note: Superseding the previous solution of the issue (committed in r13403) by one
that avoids code duplication. This should avoid problems with missed changes in
code that isn't used with the wxWidgets version that the developer tests with
(like just happened in r13557).
2014-11-10 19:28:17 +00:00
james.k.crook@gmail.com 67d2b274e2 Frequency Selection toolbar from Paul Licameli.
Linux/Mac will need new files adding to project, SpectralSelectionBar.cpp, NumericTextCtrl.cpp.
2014-11-08 15:18:43 +00:00
lllucius bdcefb4850 Preliminary changes for wxWidgets 3.0.1
We can't go to 3.0.1 yet as there are still build issues on
Linux and OSX.  You can get Windows to build, but there's
still some display issues.

These changes should work with wxWidgets 2.8.12 as well, so
we can take our time to get things working properly before
switching over.
2014-10-06 08:10:50 +00:00
benjamin.drung@gmail.com 277932dccb Remove trailing spaces. 2014-06-03 20:30:19 +00:00
v.audacity 8408eaf52a Get rid of some compiler warnings. 2013-10-31 22:28:21 +00:00
lllucius 71fde85bfe Bug 115 - Snap-to causes spurious 'toolbar' to appear momentarily at start of dragging.
Completes James' TimeConverter work

This completes the work that James started.  It moves most of the non-GUI
related processing from TimeTextCtrl to James' TimeConverter class.

Other changes include:

1)  TimeTextCtrl now expects the format name instead of the format string to be
passed when creating a new instance.  I found that almost all cases created the
instance with a blank format string and then set the string after creation.

2)  To simplify maintenance and prevent a possible discrepancy between the two,
Increase() and Decrease() were merged into a single routine.

As a result:

1)  All cases where a TimeTextCtrl was being used to extract information and
not actually display a control have been changed to use TimeConverter instead.

2)  All cases where TimeTextCtrl was being created with an empty format and
then immediately followed by something like this:

    tt.SetFormatString(tt.GetBuiltinFormat(c->GetFormat()))

    have been changed to pass the format name instead of the format string when
creating the TimeTextCtrl instance.
2013-10-23 21:01:52 +00:00
martynshaw99 4f5de6d5e3 Quiet a bunch of 'unreferenced formal parameter' warnings on Windows.
The remaining ones are 'formal parameter's referenced by other platforms.
2013-09-25 22:57:54 +00:00
lllucius 5c4ac939db Allow blanks labels to be retained when leaving the Label Editor. 2013-09-24 05:29:37 +00:00
martynshaw99 4ce2643d5f Remove the
// Indentation settings for Vim and Emacs
etc. lines from all files, as Campbell's patch (except for other changes to Languages.cpp)
2013-09-24 00:14:37 +00:00
james.k.crook@gmail.com dba81b3f1c Cleanup: Fixed lots of trivial MSVC warnings. 2013-08-25 21:51:26 +00:00
lllucius 5f1ef8f8fa Adding wxMac accessibility. Should resolve:
http://bugzilla.audacityteam.org/show_bug.cgi?id=139
2012-03-21 03:09:06 +00:00
ra e74978ba77 Locate and position the current Audacity source code, and clear a variety of old junk out of the way into junk-branches 2010-01-23 19:44:49 +00:00