Commit Graph

1174 Commits

Author SHA1 Message Date
Paul Licameli 68281fe0ee Split up Ruler::Updater::Update 2020-01-23 13:53:54 -05:00
Paul Licameli 580ad8221e Mutable cache for ruler updates, so Draw functions can be const 2020-01-23 13:51:12 -05:00
Paul Licameli a2babc646f Use the correct font to find lead size for custom fonts 2020-01-23 13:39:22 -05:00
Paul Licameli 99064d6dd5 Mutable cache for Ruler's chosen fonts 2020-01-23 13:35:32 -05:00
Paul Licameli 21306d6186 Remove indirection storing number scale in Ruler 2020-01-23 13:27:05 -05:00
Paul Licameli fec3b11674 Demote more of the ruler updating procedure into Updater 2020-01-23 13:18:47 -05:00
Paul Licameli fe4db0dd8e Nix Ruler member vars used only for grid drawing; more const methods 2020-01-23 12:56:11 -05:00
Paul Licameli 537ace493e Don't draw 0 at top of spectrogram scale (bug in 8cf7d0b) 2020-01-22 19:58:53 -05:00
Paul Licameli ec723466ba Invalidate Ruler, whenever anything the Updater uses is reassigned 2020-01-22 13:38:37 -05:00
Paul Licameli edba1b5b28 Avoid unnecessary update before drawing ruler grid...
... which matters for some displays such as in Equalization, though not for
track vertical rulers
2020-01-22 13:38:36 -05:00
Paul Licameli b0154f89e0 Move Tick and TickCustom methods to temporary worker structure...
... which forces us to be more explicit about just what parts of the Ruler
state are used in it (when we construct it) and be sure they don't modify it
2020-01-22 13:38:34 -05:00
Paul Licameli 8cf7d0b8e9 Make Ruler::Tick and TickCustom const member functions...
... on the way to making them not (direct) member functions of Ruler.

Hoist the choice of font and destination label array out of them, and
group other outputs into an argument.
2020-01-22 12:51:08 -05:00
Paul Licameli 2c0afdd77a TickSizes::LabelString takes one less argument...
... so that Ruler::Tick uses major in one less place
2020-01-22 12:09:52 -05:00
Paul Licameli 80dd2fbec9 Further factoring of font size setting...
... and fix uninitialized lead size in case of user-supplied fonts (though
this capability isn't yet used anywhere)
2020-01-22 12:09:52 -05:00
Paul Licameli e08543650b Factor function to choose ruler fonts 2020-01-22 12:09:52 -05:00
Paul Licameli 3876031669 Group ruler fonts and lead into a structure 2020-01-22 12:09:52 -05:00
Paul Licameli 80f884b0b7 Don't need extra indirection handling wxFont, see documentation of it 2020-01-22 12:09:52 -05:00
Paul Licameli 05c80cfb4f narrow scopes of loop indices 2020-01-22 12:09:52 -05:00
Paul Licameli 605a4056c9 Fix bug in 3a64b17...
... which make, for instance, excessive tick marks when in Mel spectrogram
scale
2020-01-22 12:08:37 -05:00
Paul Licameli a14d5c348a Eliminate Ruler::mDC 2020-01-21 19:58:05 -05:00
Paul Licameli 3a64b172c8 Demote duplicated code in Ruler into a static function 2020-01-21 19:36:02 -05:00
Paul Licameli 8729f3fb8e Simplify Ruler with std::vector members 2020-01-21 16:07:27 -05:00
Paul Licameli 7682961f53 Remove unused members of Ruler 2020-01-21 15:17:51 -05:00
Paul Licameli a84391b4a2 Eliminate some members from Ruler...
... Move some fields used only during formatting into a temporary structure.

(And fixing a minor problem with uninitialized variables in case of logarithmic
scale, which made it unpredictable how Plot Spectrum with logarithmic
frequencely axis formatted numbers.)
2020-01-21 12:53:33 -05:00
Paul Licameli 9cd7a5eaf3 Bug2277 partial: in dB ruler, always draw midline value if in range...
... and also draw the zeroes if in range, taking precedence over the extreme
values (which might be positive dB values when zoomed out or scrolled).

See comments 10 and 11 in the bug report.
2020-01-20 12:29:28 -05:00
Paul Licameli 2570b56176 Rename Maybe and its members more like std::optional of C++17 2020-01-19 11:38:12 -05:00
Paul Licameli 32d2d2390f Eliminate GetActiveProject from MixerBoard, Snap, Meter 2020-01-07 17:06:23 -05:00
Paul Licameli 275797bbb4 Fewer uses of ::GetActiveProject()...
... where we have a window, ascend the chain of parent pointers instead to
find the project window.
2020-01-04 12:59:37 -05:00
Paul Licameli 12bbafe013 Separate storing of user data from initialization of popup items 2020-01-01 21:54:45 -05:00
Loss e787694f07 Implementation of Timer Toolbar
PRL:  Rebased onto recent master, fixed compilation and indentation, added new
files to the XCode project, added an EXPERIMENTAL flag
2019-12-31 17:42:54 -05:00
Paul Licameli 093ffbd2f1 MultiDialog uses ShuttleGui, and TranslatableString for title 2019-12-29 16:17:04 -05:00
Paul Licameli c64b3cb31f Rewrite FileDialogWrapper using FileNames::FileTypes...
... also removing some repeated code and using the config keys /DefaultOpenType
and /LastOpenType only in Import.cpp
2019-12-29 15:35:03 -05:00
James Crook e6c370023c Fix broken Windows build. 2019-12-29 17:38:44 +00:00
Paul Licameli 7bdb3491c7 Fix usage comment for PopupMenuTable 2019-12-29 00:08:31 -05:00
Paul Licameli 6e14d2e56c RulerPanel uses TranslatableString for units string...
... also fixing missed translation of "k" in spectrum vertical ruler
2019-12-28 23:49:18 -05:00
Paul Licameli 956e0813c4 SliderAx uses TranslatableString 2019-12-28 23:49:17 -05:00
Paul Licameli ccefe8da5f Remove unused default arguments for FileDialogWrapper 2019-12-26 22:13:36 -05:00
Paul Licameli 747c35645a TranslatableString for checkbox captions 2019-12-23 19:15:34 -05:00
Paul Licameli c23451af9d TranslatableString for prompts of radio buttons 2019-12-23 19:02:21 -05:00
Paul Licameli 13417b6d5b ShuttleGui::AddFixedText takes TranslatableString 2019-12-23 19:02:19 -05:00
Paul Licameli acd1158e1b TranslatableString for titles, and spin control and combo prompts 2019-12-23 18:53:00 -05:00
Paul Licameli 5168d62e3d TranslatableString for captions of text entry boxes 2019-12-23 18:53:00 -05:00
Paul Licameli b404eb7800 TranslatableString for static text box captions 2019-12-23 18:52:37 -05:00
Paul Licameli 1944ac2040 TranslatableString for labels of ShuttleGui buttons 2019-12-23 15:35:48 -05:00
Paul Licameli c682718ee4 TranslatableString for toolbar button labels 2019-12-23 15:35:47 -05:00
Paul Licameli 66097c34dc MultiDialog uses TranslatableString for button labels & 2nd message 2019-12-23 15:35:47 -05:00
Paul Licameli 89a3771730 TranslatableString for AudacityTextEntryDialog message and caption 2019-12-21 11:23:32 -05:00
Paul Licameli 49cab86fc1 TranslatableString for tooltips and status bar messages 2019-12-20 21:54:49 -05:00
Paul Licameli 2007346551 Pass TranslatableString to help, warning, and error dialogs 2019-12-20 21:48:21 -05:00
Paul Licameli 5909f67fdb NumericTextCtrl::SetName takes TranslatableString 2019-12-20 21:38:05 -05:00
Paul Licameli dc39f22442 AudacityMessageBox takes TranslatableString message and caption 2019-12-20 21:32:50 -05:00
Paul Licameli 71e9e38083 AudacityMessageDialog takes TranslatableString message and caption 2019-12-20 13:40:20 -05:00
Paul Licameli 1b726f4f09 More TranslatableString in dialog wrapper classes...
... All of the dialog names, and the messages for File and directory dialog
wrappers
2019-12-20 13:40:20 -05:00
Paul Licameli a70524446e TranslatableString for title prefix in PrefsDialog...
... and the title strings do not include a trailing space
2019-12-19 22:37:21 -05:00
Paul Licameli 5e26ef1eba Define and use non-mutating TranslatableString::Stripped 2019-12-19 16:41:45 -05:00
Paul Licameli 6b812791a6 TranslatableString in popup menu tables 2019-12-16 15:10:35 -05:00
Paul Licameli 503ccabdd8 TranslatableString caption & message in MessageBoxException 2019-12-16 10:58:05 -05:00
Paul Licameli e875adaa6f AButton::SetToolTip takes TranslatableString 2019-12-16 10:58:05 -05:00
Paul Licameli 681950fc61 TranslatableString for names, labels, tooltips of wxPanelWrapper...
... and Grabber too
2019-12-16 10:58:05 -05:00
Paul Licameli 53ee9c9800 TranslatableString for titles, names, labels of wxDialogWrappers...
... Found one missed translation in CommandTargets.cpp
2019-12-16 10:58:05 -05:00
Paul Licameli 5639f834c8 CommandManager stores labels as TranslatableString 2019-12-16 10:58:05 -05:00
Paul Licameli 0021a98091 Remove another unnecessary stripping of accelerators from labels 2019-12-16 07:09:04 -05:00
Paul Licameli 9a609fe1fe TranslatableString in ProgressDialog 2019-12-14 01:48:15 -05:00
Paul Licameli a8de4d9e50 Construct MenuItem with untranslated label, so it can be static...
... and other storage of TranslatableString instead of naked wxString, for
management of menu items, in CommandManager
2019-12-12 15:49:00 -05:00
Paul Licameli 0cf90d65e6 S.GetParent() for all windows passed to ShuttleGui::AddWindow()...
... Verified that this makes no real change.
2019-12-10 09:58:38 -05:00
Paul Licameli d49ac8bad3 Remove obsolete code 2019-12-10 09:58:38 -05:00
James Crook 5a3e9cd063 Fix dialog naming
For nicer Doxygen results, we need consistency in naming of classes.
Dialag classes are now called SomethingDialog.
2019-12-06 10:39:07 +00:00
Paul Licameli 15260c2c95 TranslatableString can store a context and format arguments...
... Format arguments are substituted into the translation of the msgid, which
may not be known at the time the format arguments are captured (because locale
may change).  This allows TranslatableString with arguments to be constructed
at static initialization time.

There is also a special "verbatim" or null context which makes no translations
of msgids.

There is not yet any use of other contexts besides default or null.
2019-12-05 11:34:06 -05:00
Paul Licameli 96291c5476 Remove second argument of AddWindow(), use Position() instead 2019-12-02 22:01:22 -05:00
Paul Licameli d98e41aad1 Define and use ShuttleGui::Disable; remove EnableCtrl 2019-12-02 17:54:07 -05:00
Paul Licameli c72dbf5b51 Define and use ShuttleGui::Focus 2019-12-02 17:26:40 -05:00
Paul Licameli 1bfbfb9640 ShuttleGui::Style analogous to other functions 2019-12-02 17:23:34 -05:00
Paul Licameli 9eeef4713d Define and use ShuttleGui::Name and NameSuffix...
... For radio buttons, the name will default to the same as the prompt if not
otherwise specified
2019-12-02 16:55:46 -05:00
Paul Licameli 3ea0209e5c Define and use ShuttleGui::ToolTip 2019-12-02 11:41:51 -05:00
Paul Licameli 1d32824e02 Define and use ShuttleGui::Validator 2019-12-02 11:21:40 -05:00
Paul Licameli 0b6618e491 Use TranslatableString in NumericTextCtrl...
... Fixing a minor error in TimerRecordDialog, where translation of format was
done too soon
2019-12-01 18:08:56 -05:00
Paul Licameli 089b46ab64 Specify initial radio button state in ShuttleGui method arguments 2019-11-28 14:24:44 -05:00
Paul Licameli bca0afd52e ShuttleGui lets you specify whether a button is default. Use that. 2019-11-28 14:24:43 -05:00
Paul Licameli 7ccd35d219 wxWidgets docs recommend: don't SetSizeHints on non-top-level windows 2019-11-28 14:24:43 -05:00
Paul Licameli 87a9e7ccbb Use global ChoiceSettings variables, not coincidental string literals 2019-11-27 13:38:17 -05:00
James Crook 80ef424338 Bug 169 - Welcome Message: Local links to "Quick Help" and "Manual" do nothing if help is not installed. 2019-08-20 22:29:18 +01:00
James Crook aee4e5deaa Bug 1411 - Multiple non-modal "Help from the Internet" windows 2019-07-30 12:30:57 +01:00
David Bailes 5b277dc9f8 Bug 1723 - Keyboard Preferences: Closing subtrees.
Closing sub trees can leave the wrong item selected.
If a node near the bottom of the tree is closed, the node may move
down, and no longer be under the mouse pointer. If further processing
is allowed, then the line at the mouse position is incorrectly selected.

Fix: Don't allow further processing and call SetFocus() ourselves.
2019-07-30 11:35:46 +01:00
Paul Licameli c98ab0aec9 Make RecordingPrefs.cpp independent of Warning 2019-07-13 19:54:41 -04:00
Paul Licameli 908228b431 ProgressDialog does not depend on ErrorDialog 2019-07-13 18:10:11 -04:00
Paul Licameli 3a1456bf53 Make OverlayPanel independent of AColor 2019-07-13 16:08:29 -04:00
Paul Licameli fb713a5339 ASlider wasn't using Ruler 2019-07-12 22:52:34 -04:00
Paul Licameli d6317ae6af Merge LinkingHtmlWindow into HelpSystem...
... they cooperated closely in a cycle of two not worth breaking
2019-07-10 10:34:04 -04:00
Paul Licameli 7e1c469d7f Remove some unnecessary #include directives 2019-07-09 12:45:50 -04:00
Paul Licameli 8c59f66583 ScrubbingToolBar eats less idle time after commit 192530d 2019-07-05 13:30:11 -04:00
David Bailes f327fef80b Bug 2146: Keyboard preferences: mouse can select wrong item
My previous fix for this bug, commit 4b437b8, did not work on Mac.
This bug was introduced by my commit b62ed73. This commit was to ensure that when the keyview was the focus, there was always one item selected. This ensures that the focus is indicated visually, and that the Narrator screen reader reads the keyview.

The failed fix, selected an item if necessary when the keyview became the focus.

The current fix reverts b62ed73 and 4b437b8, and ensures that an item is selected each time the items are updated.
2019-07-05 12:16:04 +01:00
Paul Licameli e2362bc25a Move project status string management to new attached object class 2019-07-02 21:01:34 -04:00
Paul Licameli 2a06b10884 Make objects attached to AudacityProject non-copyable...
... except for Tags; also some uses of final and explicit

This caught a mistake in Scrubbing.cpp
2019-07-02 19:51:24 -04:00
Paul Licameli 6adb2abc98 Keep EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT compilable...
... while not reintroducing bad dependencies, which explains the movement
of the definition of some constants
2019-07-02 12:35:40 -04:00
David Bailes 4b437b8cb9 Bug 2146: Keyboard preferences: mouse can select wrong item
Steps to reproduce:
1. Open preferences
2. Select the keyboard category
3. Scroll down the list by any amount
4. Select an item using the mouse. The list scrolls to the top and the wrong item is selected.

The problem occurs because if the list of shortcuts is currently not the focus, then after a left mouse click, KeyView::OnSetFocus() is called, and setting the selection in that function interferes with the mouse selection.

Fix: In KeyView::OnSetFocus(), if there has been a left down event, don't select anything.
2019-07-01 11:48:56 +01:00
Paul Licameli 0b897c81b0 ToolManager.cpp does not depend on Meter 2019-06-16 01:24:29 -04:00
David Bailes 2c2cf587b4 Bug 496 - NumericTextCtrls shouldn't accept numbers when any modifier keys are pressed
Problem:
NumericTextCtrls act on numeric keys, even when modifier keys are pressed.
This shouldn't be the case, and has the knock on effect that shortcuts like ctrl + 1, don't work when a NumericTextCtrl is the focus.

Fix:
Check that there are no modifier keys pressed.
2019-06-11 14:38:34 +01:00
Paul Licameli 758e9813f1 Move MeterPanelBase to new files...
... which frees AudioIOBase, QualityPrefs, and ProjectAudioIO from cycles
2019-06-10 20:48:39 -04:00
Paul Licameli 17c04d1749 Separate an abstract base class from MeterPanel...
... to break its cycle with AudioIO
2019-06-10 20:48:38 -04:00
Paul Licameli 42a4f55ffe Prepare to split AudioIOBase from AudioIO...
... New files, but (almost) empty; don't use the global variable gAudioIO,
but use one of two accessor function names (which are the same function for
now).

AudioIOBase will have fewer dependencies than AudioIO -- in particular, no
dependency on tracks.

It won't include StartStream.  It will contain functions to query the
present state of streams, and device capabilities.
2019-06-10 20:48:38 -04:00
Paul Licameli 46bf5a82fc Don't pass whole TimeTrack to Ruler or Mixer...
... they need only the information in a (Bounded)Envelope.
2019-06-10 20:48:38 -04:00
Paul Licameli d979a8959b New files for ProjectAudioManager...
... This eliminates some inclusions of ProjectManager, helping to free it from
cycles into a higher level
2019-06-09 12:10:47 -04:00
Paul Licameli 4f940c855d New files for ProjectWindow 2019-06-03 01:43:26 -04:00
Paul Licameli fee5582826 New files for ProjectManager 2019-06-03 01:21:12 -04:00
Paul Licameli 850628275b AudioIO.cpp does not depend on ProjectAudioIO.h and GetActiveProject 2019-06-03 01:18:11 -04:00
Paul Licameli 05efeeb5bd New files for ProjectSettings 2019-06-03 01:13:13 -04:00
Paul Licameli dd10e00a2d New attached structure ProjectSettings stores rate, snap-to, et al. 2019-06-02 14:42:00 -04:00
Paul Licameli ac04a34d42 Move #include of Experimental.h upward in two files 2019-06-02 14:03:32 -04:00
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 02afcbca8c Redo TP_UpdateStatusMessage...
... Rename it as SetStatus; make it part of AudacityProject not
TrackPanelListener; and use a roundabout event signalling to cause the timer
restart.

Because SetStatus will be one of very few things left in AudacityProject, but
the timer handling will be part of another class decoupled from it.

And TrackPanelListener won't really be needed: TrackPanel will not need to
pretend it doesn't know what an AudacityProject is.
2019-05-28 19:36:47 -04:00
Paul Licameli 35892fc869 Rearrange setting time & freq formats for numeric controls...
... Just one low-level function for each that simply sets; just one high-level
function for each that also pushes notifications; and to make that work,
toolbars need some rewriting to avoid recursion when the notifications they
post come back to them.
2019-05-28 19:23:42 -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 227fb315ea Drawing sequence for overlays independent of insertion call sequence 2019-05-20 21:38:08 -04:00
Paul Licameli f86403378b Move AudacityMessageBox to its own files...
... breaking cycles among low-level files introduced by 273ba9f
2019-05-20 14:48:36 -04:00
Paul Licameli d68db39b5c HelpSystem.cpp has fewer dependencies...
... There was no reason to store the help location preferences as per-project
state.  Also move the dialog for quick fixes near its only use in
HelpMenus.cpp.

This takes 22 files out of the big strongly connected component, notably
the much used lower level utilities, ErrorDialog and AudacityException.

HelpSystem itself is still in a small cycle with LinkingHtmlWindow.
2019-05-18 20:29:25 -04:00
Paul Licameli db8c4c5e5a Global keyboard capture handling into new files, better comments...
... and break its compile dependency on CommandManager.h by letting it install
callbacks.

This also removes Objective-C mixed code from CommmandManager.

This also eliminates four inclusions of Project.h!

Capture handler state is also global, not per project, though the
CommandManager's callbacks still do depend on the active project.
2019-05-18 15:14:18 -04:00
Paul Licameli 8da6529329 Remove AudacityApp::GetLogger() & HelpActions::DoShowLog() 2019-05-17 16:29:04 -04:00
Paul Licameli a047fa6e7a Missing alias file tracking out of AudacityApp, into new files...
... which reduces the need for including AudacityApp.h
2019-05-17 16:28:50 -04:00
Paul Licameli 0ab29d21e9 Some naming consistency...
Prefer "MissingAliasFiles" not other permutations of the words
2019-05-17 06:47:53 -04:00
Paul Licameli 2d8c287384 Do not require AudacityApp.h when using global file history 2019-05-17 06:47:53 -04: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
David Bailes 6da84b0adc Keyboard prefs accessibility: Narrator can misread the radio buttons.
Problem. If an item in the list is selected, then if a different view by radio button is selected, Narrator reads the selected item rather than the radio button.
KeyViewAx::SetCurrentLine(int line) can be called when the KeyView is not the focus, and send a focus event.

Fix: In KeyViewAx::SetCurrentLine(int line), only send focus event if the KeyView is the focus.
2019-05-17 08:33:33 +01:00
Paul Licameli ddaadfb7e7 Remove NumericTextCtrl.h from other headers or comment why you can't 2019-05-16 19:01:00 -04:00
Paul Licameli ced9be588b Remove ImageRoll.h from other headers or comment why you can't 2019-05-16 18:30:22 -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 548192fcf3 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:58:34 -04:00
Paul Licameli 56f51d8176 Revert "Remove redundant #include-s from .h files..."
This reverts commit b7fe62d170.
2019-05-16 14:33:55 -04:00
Paul Licameli b7fe62d170 Remove redundant #include-s from .h files...
Redundant, because transitively implied.  But don't do this for inclusions of
Audacity.h or Experimental.h.
2019-05-16 14:15:05 -04:00
Paul Licameli 9bf29f5582 CommandManager keys by CommandId, not plain wxString 2019-05-16 12:30:29 -04:00
Paul Licameli 11c8377460 NormalizedKeyString redefined as TaggedIdentifier 2019-05-16 12:30:29 -04:00
Paul Licameli f6adeed47b Remove some unnecessary #include directives 2019-05-15 14:14:18 -04:00
Paul Licameli 2b32884596 Remove some unnecessary toolbar related declarations, fix comments 2019-04-23 17:02:04 -04:00
Steve Daulton aad117051a Fix bug 1534
On Linux, width and height of TipPanel must not be reset in SetPos().
2019-04-23 19:31:55 +01:00
David Bailes 78cb554883 2092: Linux: first typed char lost when using dialog for label name
Fix: Move the insertion point to the end of the text after the dialog is shown.
2019-04-13 12:38:41 +01:00
Paul Licameli ba467b3632 some override 2019-04-04 12:35:17 -04:00
Paul Licameli 0c39c1292e Remove wx/dc.h from ImageRoll.h ...
... I wish I could just forward-declare the enumeration wxRasterOperationMode,
but it's not defined as a sized enum
2019-04-04 11:00:43 -04:00
Paul Licameli 5f218a4ab4 Revert "Remove wx/dc.h from ImageRoll.h ..."
This reverts commit 8078aa8547.
2019-04-04 10:52:31 -04:00
Paul Licameli 8078aa8547 Remove wx/dc.h from ImageRoll.h ...
... I wish I could just forward-declare the enumeration wxRasterOperationMode,
but it's not defined as a sized enum
2019-04-04 10:40:02 -04:00
David Bailes c531fde6b8 ASlider.cpp: correction to event table
Fix error in ASlider's event table spotted by Paul. The error wasn't causing any known problems.
2019-04-04 15:19:07 +01:00
Paul Licameli 2e1fe80601 Remove or comment wxPanelWrapper.h in headers 2019-04-04 10:13:23 -04:00
David Bailes 95e2264d24 Bug 1248: Tab does not navigate out of ASlider if clicked
Problem:
If an ASlider in the main window is clicked, then you can't TAB away from the control.

Fix:
Keyboard shortcuts are handled using key down events. However, ASlider was handling char events for reasons unknown. I'm unsure why this was causing a problem, but changing ASlider to handle key down events fixes the bug.
2019-04-03 13:25:04 +01:00
David Bailes ecdb6d0a07 Fix previous commit: 4e37d93
Reinstated .h file, with corrected path. Without this include, there were numerous intellisense errors in the .cpp file.
2019-04-03 12:54:52 +01:00
David Bailes 4e37d93cd9 ASlider.h removed unnecessary .h file with incorrect path 2019-04-03 12:23:45 +01:00
Paul Licameli 0f3723e221 comment BackedPanel.h, HtmlWindow.h, ASlider.h in .h files 2019-03-31 15:25:34 -04:00
Paul Licameli 2d8abe6b74 Remove FileHistory.h, KeyView.h from .h files 2019-03-31 15:21:02 -04:00
Paul Licameli a10196eb91 Fix some comments 2019-03-31 15:14:26 -04:00
Paul Licameli e2c5444c1d Move class HtmlTextHelpDialog out of header 2019-03-31 14:58:33 -04:00
Paul Licameli b83ed90cfb Remove or comment Ruler.h, Overlay.h, OverlayPanel.h in other headers 2019-03-31 14:44:24 -04:00
Paul Licameli ed29ab89f8 Many WindowAccessible subclasses moved out of header files 2019-03-31 13:27:18 -04:00
Paul Licameli 10568f8a46 Move class SliderAx into WindowAccessible.* ...
... so ScienFilter.cpp doesn't depend on Equalization.h
2019-03-31 13:27:18 -04:00
Paul Licameli 4714d72b3f Can't remove remaining wx headers from other headers, comment that 2019-03-31 01:41:16 -04:00
Paul Licameli ef98cfd74f Remove wx/{docview,datetime,datectrl,cursor}.h from *.h 2019-03-30 13:32:44 -04:00
Paul Licameli 77f747daeb Remove wx/{checklst,wfstream,version,variant,types}.h from *.h 2019-03-30 12:59:21 -04:00
Paul Licameli 34f318cd41 Remove wx/{imaglist,generic/dragimgg,gauge,dynarray}.h from *.h 2019-03-30 12:51:12 -04:00
Paul Licameli 2587a4adba Remove wx/panel.h from headers 2019-03-30 12:26:59 -04:00
Paul Licameli 2e05d2d884 Remove wx/{radiobut,ownerdrw,menuitem,menu,listbox}.h from *.h 2019-03-30 12:15:53 -04:00
Paul Licameli d28ae40399 Remove wx/dialog.h from headers 2019-03-30 12:01:39 -04:00
Paul Licameli 4d29686116 Remove wx/gdicmn.h from headers 2019-03-30 11:52:48 -04:00
Paul Licameli c982cf6a41 Remove wx/intl.h, wx/brush.h, wx/bitmap.h from headers 2019-03-30 11:45:20 -04:00
Paul Licameli 870c08ac06 Remove wx/{log.h, image.h, listctrl.h, utils.h} from headers 2019-03-30 11:21:51 -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 ec2f26e48c Remove wx/pen.h, wx/thread.h from headers 2019-03-30 10:17:18 -04:00
Paul Licameli 3a7324984c wx/hashmap.h no longer used anywhere 2019-03-30 10:06:52 -04:00
Paul Licameli de60edc62f Remove wx/{app,statbmp,spinctrl,scrolbar,dynlib,dcmemory}.h from *.h 2019-03-30 07:57:37 -04:00
Paul Licameli 3760db9dff Remove wx/wxchar.h from headers 2019-03-29 15:56:54 -04:00
James Crook d994860311 Bug 2087 - Mixer Board gain control dialog is ridiculously over-long vertically 2019-03-29 19:24:25 +00:00
David Bailes 62f1711cdd KeyView: fix focus issue
Problem: A user can tab to the list, and none of the items is the focus. The list itself is still the focus. As a result, there is no visual indication of the focus, and an additional keystroke is needed to make any item the focus.

Fix: When the list gains focus, if no items are selected, select the first item, if there is one.
2019-03-29 11:10:14 +00:00
Paul Licameli 4e9c3cfb5f Remove wx/{dc,tokenzr,tglbtn,statusbr,simplebook}.h from *.h 2019-03-29 06:29:35 -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 bcc2e0d13b Remove wx/frame.h, wx/sizer.h, wx/access.h from headers 2019-03-28 11:21:15 -04:00
Paul Licameli 803d8b9559 Remove wx/filename.h, wx/choice.h, wxFileNameWrapper.h from headers 2019-03-28 03:12:42 -04:00
Paul Licameli 8cf6874555 Remove wx/textctrl.h from headers 2019-03-28 01:43:53 -04:00
Paul Licameli b1ce24c087 Remove wx/window.h from headers 2019-03-27 14:43:06 -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 c3aad2e026 Remove wx/event.h from headers 2019-03-27 04:36:51 -04:00
Paul Licameli 40b4361732 Remove wx/arrstr.h from headers 2019-03-26 12:41:44 -04:00
Paul Licameli 1d0247607a Remove wx/string.h from headers 2019-03-26 11:33:55 -04:00
Paul Licameli 51f0362e9f Remove wx/wx.h from headers 2019-03-26 11:17:41 -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 f2e2d35ad7 Make numeric validators work with ComboBoxes too...
... as was the intention in the wxWidgets code from which these files were
adapted

More importantly this removes the mischievous #define (added at 08c94d5) from
valnum.h, which made it impossible to #include that header before
<wx/combobox.h>.

Note that (the real type) wxTextEntry is not a kind of wxWindow, but a class
from which wxTextCtrl and wxComboBox both inherit, while they inherit wxWindow
too along other paths.

So in some places, use the protected variable m_ValidatorWindow instead to
access the validator's window.
2019-03-23 20:52:37 -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 1af342ff64 one function can return reference instead of value 2019-03-23 11:51:00 -04:00
Paul Licameli 0dd0a5cb5a Remove <wx/menu.h> from CommandManager.h, moving inline functions out 2019-03-23 10:56:43 -04:00
Paul Licameli a0d9e31c42 Consistently use <> not "" in inclusions of wx headers 2019-03-23 10:27:25 -04:00
Paul Licameli f45300f032 This is only comments, in files where USE_ macros are tested...
... following the comment convention used in the preceding commit.
2019-03-22 12:38:30 -04:00
Paul Licameli 8dcf725e4c Fix leaks. wxEvtHandler::SetClientData() doesn't take ownership! 2019-03-21 10:46:48 -04:00
David Bailes 069e34df77 Accessibility: make NumericTextCtrl accessible using Narrator
Problem:
Using the Narrator screen reader on Windows 10, there are a couple of problems:
1. When using the left/right arrow keys, Narrator reads the current field, rather than the digit which is now the focus.
2. Using up/down arrow keys, Narrator is silent.

Fixes:
1. The existing code assumes that NumericTextCtrlAx::GetName() is called only once after left/right arrow is pressed. However, Narrator causes this function to be called more than once. Solution: handle the case where the function is called, and neither the focus or the digits have changed, and use a cached value of the name.

2. If the focus has not changed, then after a focus event, Narrator does not read the name, even if the name has changed. Solution: add a name change event. (The focus event has been retained to keep Window-Eyes happy until we stop supporting it.)

Note:
One of the focus events has been removed from NumericTextCtrl::SetFieldFocus(), as it no longer appears to be necessary.
2019-03-21 13:48:23 +00:00
Paul Licameli b47e2f91e2 Make header dependencies for wxUSE_ACCESSIBILITY explicit 2019-03-18 12:14:16 -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 f7162d3326 OverlayPanel uses weak_ptr to Overlay, which simplifies other dtors 2019-03-16 08:21:03 -04:00
Paul Licameli a73970d864 Rewrite the quick exit test in OverlayPanel::DrawOverlays 2019-03-16 08:07:09 -04:00
Paul Licameli e6324e86ac Fix cross-platform one-pixel differences in line drawing...
... Make all line drawing go through our AColor which wraps the wxDC
line-drawing functions.

Despite what wxWidgets documentation says, the functions still don't
consistently include the first point and omit the last point of a line.  I
observed inclusion of both on Mac, while on Windows, omission sometimes of the
first point instead of the last.

Discrepancies could be observed in 2.3.0 between Windows and Mac, using the
Window magnifier or command+alt+ +, zooming in closely on the ends of the
shadow lines below and right of tracks, or at the bottom-right corners of the
bevels drawn around vertical rulers.

So where there is an observable one-pixel difference of drawing between
platforms, there is the question, which was the intent when the drawing code
was written?  Should the coordinates be corrected by one or not?

I reviewed each case and used my judgment.

Most of the calls are in drawing rulers.  Major tick lines were drawn five
pixels long, and minor, three, on Mac.  I keep this behavior, but you might
argue for making them four and two.

On the other hand the drawing of ruler grid lines, which you can see in
the equalization and frequency analysis windows, did need a one-pixel correction
to avoid straying out of bounds.
2019-03-16 07:51:28 -04:00
Paul Licameli 5fd6965925 Use type aliases CommandID, CommandIDs...
... for identifiers of menu commands and macros, and for vectors thereof
2019-03-15 15:18:11 -04:00
Paul Licameli a30000cf74 Use type aliases FilePath, FilePaths...
... for wxString and wxArrayStringEx, holding file paths (absolute or relative,
directory or plain file); to be replaced later with different types

(not yet using std::vector, becase of some uses of wxArrayString::Index with
two arguments)
2019-03-15 15:18:11 -04:00
Paul Licameli 06b3b42794 Remove unnecessary initializers for empty wxString 2019-03-15 15:18:11 -04:00
Paul Licameli 135c2a71ce Replace "" and wxEmptyString with {} in default argument values 2019-03-15 15:18:11 -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