Commit Graph

31 Commits

Author SHA1 Message Date
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