1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-15 15:49:36 +02:00

114 Commits

Author SHA1 Message Date
Paul Licameli
82663892dc Accessors to get the project window...
... 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.
2019-05-28 23:18:13 -04:00
Paul Licameli
ac65d817ac Remove an #include 2019-05-25 05:59:50 -04:00
Paul Licameli
15dd230ee1 static ToolManager::Get()...
... not member functions of AudacityProject
2019-05-23 15:24:28 -04:00
Paul Licameli
62899a32f4 All things with an UpdatePrefs() message listen for an event...
... Still to do, improve the handling of updates of only subsets of the prefs
2019-05-20 21:38:13 -04:00
Paul Licameli
4c3729040f comments 2019-05-20 19:46:14 -04:00
Paul Licameli
236c8ed51e Move version keys from AudacityApp to AudacityPrefs 2019-05-17 16:29:04 -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
08c16b6eb7 Remove wx/{html/htmlwin,fileconf,dragimag,debug,dcclient}.h from *.h 2019-03-30 10:53:22 -04:00
Paul Licameli
bcc2e0d13b Remove wx/frame.h, wx/sizer.h, wx/access.h from headers 2019-03-28 11:21:15 -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
James Crook
f07e40a4c0 Bug 1983 - Preference updates do not preserve toolbar widths 2018-09-20 13:16:09 +01:00
Paul Licameli
a90c6c45f3 Remove redundant calls to update toolbars 2018-09-15 18:24:16 -04:00
Paul Licameli
01634938cc Fix: Undock Tools toolbar; then reset toolbars Mac...
... Used to need two resets to get the correct result, now only one.
2018-09-15 18:23:51 -04:00
James Crook
bf6b47dbb4 Bug 1918 - Left to right (LTR) language selection reverses elements that should not be reversed
This does not entirely fix LTR language support, but dramatically ameliorates the problems originally reported in bug 1918.
2018-08-08 16:33:00 +01:00
Paul Licameli
0dddcf44cb Some uses of wxWindowRef, a weak pointer that won't become dangling 2018-08-01 22:49:37 -04:00
Paul Licameli
8be1e8fdad Remove wxArray(Int|Long|Double) except where wxWidgets fns need it 2018-02-21 19:33:31 -05:00
Paul Licameli
2f3604bdea Rewrite many calls to Connect() with Bind()...
... it's the more modern way, and does better type checking, without the
dubious casts of pointers-to-member-functions.
2018-02-21 19:28:11 -05:00
Paul Licameli
bf5228267a Calls to Disconnect or Unbind in destructors are not needed, if...
... it's either the source of the connection that is being destroyed, or other
object (such as an ancestor window) transitively owning it and so causing it to
be destroyed too;

or, the sink is being destroyed, and that sink is a wxEvtHandler (which is
always so for Disconnect, though not for Unbind in case Bind was passed a
member function of a non-wxEvtHandler).

wxWidgets takes care of erasing the connection in such cases.

This removes most calls to Disconnect and Unbind.  Many destructors shrank to
nothing.

Notably, in case of popup menu handling, the call to Disconnect is not removable
because the object being destroyed is neither the source nor the sink.
2018-02-21 19:28:06 -05:00
Paul Licameli
57ce726a25 Rename Meter as MeterPanel, and some DOxygen 2018-02-21 17:50:28 -05:00
Paul Licameli
89d3d6e6e6 Comments and name changes to clarify code for toolbar configurations 2018-01-22 12:13:40 -05:00
Paul Licameli
58b44baf05 Some NULL checks... somehow I crashed on Mac but can't repeat now 2018-01-22 12:11:43 -05:00
Paul Licameli
2ee3ba5761 Bug1828: ESC from dragging of a docked toolbar...
... Now restores state again properly and does not cause undocking of other
bars when you restart.

Redoes commit 2d56c8ec3286aa0a4a22e5be9148a2a1e01b8e17 better
2018-01-21 05:42:49 -05:00
David Bailes
cfdb7950f1 Update fix for #1554
This is an update to commit 516af71. The Dock key is now retained in the config file, so that if a user goes back to a version before the fix, the toolbar layout remains unchanged.

Note that when ToolManager::ReadConfig() is called, InitPreferences has already been called which has set the version keys to the current version of Audacity. Therefore the initial values of these keys are stored in AudacityApp.
2018-01-10 11:33:05 +00:00
David Bailes
516af71782 Fix for #1554: toolbars open undocked if previously hidden
Problem:
1. If a toolbar is docked and hidden, when config is written, dock is set to 0 (undocked).
2. When config is read, if a toolbar is docked, then the show field is ignored, and the toolbar is always shown.

Summary of fix:
1. Introduce a new version of the dock field (DockV2) to minimise the problems when running previous versions of Audacity, having run a version with this patch(as suggested by Paul).
2. In ToolManage::WriteConfig, for a docked toolbar which is hidden, DockV2 is set to the dock number, and not 0.
3. In ToolManager::ReadConfig, for a hidden docked toolbar in the config, the toolbar is docked, but is not included in the configuration.

Note, that if a version of Audacity without this fix is run after running a version with this fix:
1. The dock of each toolbar is reset to its default value.
2. In addition, for 2.1.3, 2.2.0 and 2.2.1 whether a toolbar is shown or hidden is reset to its default value.
2017-12-12 14:39:02 +00:00
James Crook
f463eda36c Clean up some dead code and MSVC warnings.
- Dead code from experiments in SelectionBar removed.
- Many warnings about unused parameters fixed with WXUNUSED()
- Many warnings about signed / unsigned comparisons cleaned up.
- Several 'local variable declared but not used' warnings fixed.
2017-12-08 15:20:39 +00:00
Paul Licameli
ecd149edad Revert "Fix for #1554: toolbars open undocked if previously hidden"
This reverts commit 048c1b8c5a92e68ca9de67d25098400ab32ab68c.

I observed that it was not all right if you switch between Audacity versions, as
some cautious upgraders might do:

Delete audacity.cfg.
Open 2.2.0 and quit.
Open 2.1.3 -- and observe that the scrubbing and combined meter toolbars appear,
one over the other, at top left.  Combined and separate meter toolbars are not
meant to appear at the same time.
Quit 2.1.3 and open 2.2.0.  Now those two toolbars appear at some other random
seeming positions.
2017-09-16 11:53:57 -04:00
David Bailes
048c1b8c5a Fix for #1554: toolbars open undocked if previously hidden
Summary of fix:
1. In ToolManger::WriteConfig, for a docked toolbar which is hidden, the dock number is not set to the dock number rather than 0 (undocked)
2. In ToolManger::ReadConfig, for a hidden docked toolbar in the config, the toolbar is docked, but is not included in the dock's configuration.
2017-09-13 12:53:32 +01:00
Paul Licameli
2d56c8ec32 Fix misbehavior of toolbars after click without drag on a grabber...
... only lately introduced at b3c8f5db3dc386989fb03506b6f2f032319929e1
2017-07-24 12:35:24 -04:00
Paul Licameli
3b0a113525 The new event filter works more safely with Destroy, not Close events 2017-07-23 16:01:10 -04:00
Paul Licameli
503f3548a1 Bug1432 partial, keep correct focus in more cases, not all...
Works by using the newer and better logic of ToolManager for remembering which
window to focus.

It seems, at least on Windows, that when the toolbar with the focused control
is docked after the end of a docking (of itself or another bar), then focus
remains.

If the bar with the focus is undocked and another bar docks or undocks, focus
is still lost.
2017-07-23 14:57:19 -04:00
Paul Licameli
b3c8f5db3d Bug1432 partial: Dragging toolbar should't change focus...
... Only the case that you click the grabber and release, or you drag the
toolbar ending in a docked position.

Doesn't work yet when drag ends un-docked.
2017-07-23 13:49:03 -04:00
Paul Licameli
d88371b4b7 Revert stuff 2017-07-23 12:40:29 -04:00
Paul Licameli
e9576bf198 work 2017-07-23 11:51:26 -04:00
Paul Licameli
1a9dd310cd Bug1432, more: Restore focused control after drag of toolbar 2017-07-23 10:48:33 -04:00
Paul Licameli
ace1ac08e7 Bug1432, partial: Click on toolbar grabber, without drag, does nothing. 2017-07-23 09:49:58 -04:00
David Bailes
69ab49c3a4 Fix for Audacity crashing when running Jaws on Windows 10 1703
Problem: On Windows 10 1703, with the Jaws screen reader running, additional paint messages are sent to Audacity compared with when Jaws is not running. My assumption is this is probably a Jaws bug. In particular, when a project is closed, ToolDock::OnPaint, and AdornedRulerPanel::OnPaint are called.

Fix: changes ensure that these OnPaint functions can be called without causing a crash.
2017-06-28 10:42:13 +01:00
James Crook
a2ba221554 Bug 1640 - Reset Toolbars reduces Selection Toolbar to a stub 2017-05-04 16:49:02 +01:00
James Crook
43ff84ba48 Preserve toolbar size when theming.
Particularly relevant for resizable toolbars which may be bigger or smaller than their standard initial size.
2017-05-01 22:28:16 +01:00
James Crook
7661d179ba Send size event after repopulating MeterToolbar buttons.
If we don't do this, it does not regain its former size, if it is floating.
2017-04-27 09:51:34 +01:00
James Crook
621f01abb0 Draw diagonal grabber and background in themed colours. 2017-04-24 22:35:41 +01:00
James Crook
c17a7f535e Improve repainting after a theme change.
Now most things repaint properly after a theme change.  The sliders on the tracks don't yet.
2017-04-04 14:43:47 +01:00
James Crook
028ed19d90 Sync with DarkAudacity 2017-04-02 23:07:13 +01:00
James Crook
74887abb70 Device ToolBar back to customary place (by default) 2016-09-30 09:13:30 +01:00
James Crook
22726dc41d Bug 1495 - Scrub Toolbar is default-enabled for upgraders 2016-09-08 21:38:29 +01:00
James Crook
45606fa1f4 Fix default positions of toolbars.
Device toolbar had jumped to the top with a recent change of toolbar visibility.
2016-08-15 09:42:29 +01:00
James Crook
d0a32f27eb Hide Scrubbing Toolbar by default. 2016-08-14 15:59:07 +01:00
Paul Licameli
32f24eabb2 Review uses of safenew...
... add comments and assertions, and use make_unique instead where possible
2016-08-13 23:16:05 -04:00
Paul Licameli
c438925a22 Use Destroy_ptr for the toolbars 2016-08-10 11:05:51 -04:00
Paul Licameli
fec4069d9d Some uses of Destroy_ptr let us remove some naked news 2016-08-10 11:05:51 -04:00