mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-31 16:09:28 +02:00
Merge remote-tracking branch 'upstream/master' into darkaudacity
This commit is contained in:
commit
3a1f945692
@ -528,6 +528,7 @@ void snd_list_unref(snd_list_type list)
|
||||
break; // the rest of the list is shared, nothing more to free
|
||||
}
|
||||
|
||||
next = NULL;
|
||||
// list nodes either point to a block of samples or this is the
|
||||
// last list node (list->block == NULL) which points to a suspension
|
||||
// lists can also terminate at the zero_block, which is an infinite
|
||||
@ -540,7 +541,6 @@ void snd_list_unref(snd_list_type list)
|
||||
/* free suspension structure */
|
||||
/* nyquist_printf("freeing susp@%p\n", list->u.susp); */
|
||||
(*(list->u.susp->free))(list->u.susp);
|
||||
next = NULL;
|
||||
}
|
||||
/* if (list == list_watch)
|
||||
printf("freeing watched snd_list %p\n", list); */
|
||||
|
@ -1212,9 +1212,11 @@
|
||||
5E74D2E31CC4429700D88B0B /* EditCursorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E74D2DD1CC4429700D88B0B /* EditCursorOverlay.cpp */; };
|
||||
5E74D2E41CC4429700D88B0B /* PlayIndicatorOverlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E74D2DF1CC4429700D88B0B /* PlayIndicatorOverlay.cpp */; };
|
||||
5E74D2E51CC4429700D88B0B /* Scrubbing.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E74D2E11CC4429700D88B0B /* Scrubbing.cpp */; };
|
||||
5E94A1BA1D1F1C8400A8713A /* wxPanelWrapper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5E94A1B81D1F1C8400A8713A /* wxPanelWrapper.cpp */; };
|
||||
5ED1D0AD1CDE55BD00471E3C /* Overlay.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0A91CDE55BD00471E3C /* Overlay.cpp */; };
|
||||
5ED1D0AE1CDE55BD00471E3C /* OverlayPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0AB1CDE55BD00471E3C /* OverlayPanel.cpp */; };
|
||||
5ED1D0B11CDE560C00471E3C /* BackedPanel.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5ED1D0AF1CDE560C00471E3C /* BackedPanel.cpp */; };
|
||||
5EF17C231D1F0A690090A642 /* ScrubbingToolBar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5EF17C211D1F0A690090A642 /* ScrubbingToolBar.cpp */; };
|
||||
8406A93812D0F2510011EA01 /* EQDefaultCurves.xml in Resources */ = {isa = PBXBuildFile; fileRef = 8406A93712D0F2510011EA01 /* EQDefaultCurves.xml */; };
|
||||
8484F31413086237002DF7F0 /* DeviceManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8484F31213086237002DF7F0 /* DeviceManager.cpp */; };
|
||||
ED15214D163C22F000451B5F /* lsr.c in Sources */ = {isa = PBXBuildFile; fileRef = ED152123163C220300451B5F /* lsr.c */; };
|
||||
@ -2986,6 +2988,8 @@
|
||||
5E74D2E01CC4429700D88B0B /* PlayIndicatorOverlay.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlayIndicatorOverlay.h; sourceTree = "<group>"; };
|
||||
5E74D2E11CC4429700D88B0B /* Scrubbing.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scrubbing.cpp; sourceTree = "<group>"; };
|
||||
5E74D2E21CC4429700D88B0B /* Scrubbing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Scrubbing.h; sourceTree = "<group>"; };
|
||||
5E94A1B81D1F1C8400A8713A /* wxPanelWrapper.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = wxPanelWrapper.cpp; sourceTree = "<group>"; };
|
||||
5E94A1B91D1F1C8400A8713A /* wxPanelWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wxPanelWrapper.h; sourceTree = "<group>"; };
|
||||
5ED18DB61CC16B1E00FAFE95 /* Reverb_libSoX.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Reverb_libSoX.h; sourceTree = "<group>"; };
|
||||
5ED18DB71CC290AB00FAFE95 /* wxFileNameWrapper.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = wxFileNameWrapper.h; sourceTree = "<group>"; };
|
||||
5ED1D0A91CDE55BD00471E3C /* Overlay.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Overlay.cpp; sourceTree = "<group>"; };
|
||||
@ -2994,6 +2998,8 @@
|
||||
5ED1D0AC1CDE55BD00471E3C /* OverlayPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = OverlayPanel.h; sourceTree = "<group>"; };
|
||||
5ED1D0AF1CDE560C00471E3C /* BackedPanel.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BackedPanel.cpp; sourceTree = "<group>"; };
|
||||
5ED1D0B01CDE560C00471E3C /* BackedPanel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BackedPanel.h; sourceTree = "<group>"; };
|
||||
5EF17C211D1F0A690090A642 /* ScrubbingToolBar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScrubbingToolBar.cpp; sourceTree = "<group>"; };
|
||||
5EF17C221D1F0A690090A642 /* ScrubbingToolBar.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScrubbingToolBar.h; sourceTree = "<group>"; };
|
||||
82FF184D13CF01A600C1B664 /* dBTable.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = dBTable.cpp; path = sbsms/src/dBTable.cpp; sourceTree = "<group>"; };
|
||||
82FF184E13CF01A600C1B664 /* dBTable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = dBTable.h; path = sbsms/src/dBTable.h; sourceTree = "<group>"; };
|
||||
82FF184F13CF01A600C1B664 /* slide.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = slide.cpp; path = sbsms/src/slide.cpp; sourceTree = "<group>"; };
|
||||
@ -4299,53 +4305,55 @@
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
1790B0FE09883BFD008A330A /* AButton.cpp */,
|
||||
1790B10009883BFD008A330A /* ASlider.cpp */,
|
||||
28F1D8170A2D0018005506A7 /* AttachableScrollBar.cpp */,
|
||||
5ED1D0AF1CDE560C00471E3C /* BackedPanel.cpp */,
|
||||
283AA0E90C56ED08002CBD34 /* ErrorDialog.cpp */,
|
||||
28F1D8190A2D0018005506A7 /* ExpandingToolBar.cpp */,
|
||||
28CCDCFF0F939FD70081F2FC /* FileHistory.cpp */,
|
||||
2897F6FC0AB3DCD0003C20C5 /* Grabber.cpp */,
|
||||
280828580A75E0EA000002EF /* Grid.cpp */,
|
||||
280112791943EE0E00D98A16 /* HelpSystem.cpp */,
|
||||
28530C480DF2105200555C94 /* HtmlWindow.cpp */,
|
||||
28F1D81B0A2D0019005506A7 /* ImageRoll.cpp */,
|
||||
2849A41E17F8BEC2005C653F /* KeyView.cpp */,
|
||||
2816372C0BAE3B6C0079C746 /* LinkingHtmlWindow.cpp */,
|
||||
1790B10309883BFD008A330A /* Meter.cpp */,
|
||||
1790B10509883BFD008A330A /* MultiDialog.cpp */,
|
||||
28001B3C1A0F0E5D007DD161 /* NumericTextCtrl.cpp */,
|
||||
28F2CED0181867BB00573D61 /* numformatter.cpp */,
|
||||
5ED1D0A91CDE55BD00471E3C /* Overlay.cpp */,
|
||||
5ED1D0AB1CDE55BD00471E3C /* OverlayPanel.cpp */,
|
||||
28530C4A0DF2105200555C94 /* ProgressDialog.cpp */,
|
||||
1790B10709883BFD008A330A /* Ruler.cpp */,
|
||||
28F2CED2181867BB00573D61 /* valnum.cpp */,
|
||||
1790B10B09883BFD008A330A /* Warning.cpp */,
|
||||
1790B0FF09883BFD008A330A /* AButton.h */,
|
||||
1790B10009883BFD008A330A /* ASlider.cpp */,
|
||||
1790B10109883BFD008A330A /* ASlider.h */,
|
||||
28F1D8170A2D0018005506A7 /* AttachableScrollBar.cpp */,
|
||||
28F1D8180A2D0018005506A7 /* AttachableScrollBar.h */,
|
||||
5ED1D0AF1CDE560C00471E3C /* BackedPanel.cpp */,
|
||||
5ED1D0B01CDE560C00471E3C /* BackedPanel.h */,
|
||||
283AA0E90C56ED08002CBD34 /* ErrorDialog.cpp */,
|
||||
283AA0EA0C56ED08002CBD34 /* ErrorDialog.h */,
|
||||
28F1D8190A2D0018005506A7 /* ExpandingToolBar.cpp */,
|
||||
28F1D81A0A2D0018005506A7 /* ExpandingToolBar.h */,
|
||||
28CCDCFF0F939FD70081F2FC /* FileHistory.cpp */,
|
||||
28CCDD040F93A0B20081F2FC /* FileHistory.h */,
|
||||
2897F6FC0AB3DCD0003C20C5 /* Grabber.cpp */,
|
||||
2897F6FD0AB3DCD0003C20C5 /* Grabber.h */,
|
||||
280828580A75E0EA000002EF /* Grid.cpp */,
|
||||
280828590A75E0EA000002EF /* Grid.h */,
|
||||
280112791943EE0E00D98A16 /* HelpSystem.cpp */,
|
||||
2801127A1943EE0E00D98A16 /* HelpSystem.h */,
|
||||
28530C480DF2105200555C94 /* HtmlWindow.cpp */,
|
||||
28530C490DF2105200555C94 /* HtmlWindow.h */,
|
||||
28F1D81B0A2D0019005506A7 /* ImageRoll.cpp */,
|
||||
28F1D81C0A2D0019005506A7 /* ImageRoll.h */,
|
||||
2849A41E17F8BEC2005C653F /* KeyView.cpp */,
|
||||
2849A41F17F8BEC2005C653F /* KeyView.h */,
|
||||
2816372C0BAE3B6C0079C746 /* LinkingHtmlWindow.cpp */,
|
||||
2816372D0BAE3B6C0079C746 /* LinkingHtmlWindow.h */,
|
||||
1790B10309883BFD008A330A /* Meter.cpp */,
|
||||
1790B10409883BFD008A330A /* Meter.h */,
|
||||
1790B10509883BFD008A330A /* MultiDialog.cpp */,
|
||||
1790B10609883BFD008A330A /* MultiDialog.h */,
|
||||
28001B3C1A0F0E5D007DD161 /* NumericTextCtrl.cpp */,
|
||||
28001B3D1A0F0E5D007DD161 /* NumericTextCtrl.h */,
|
||||
28F2CED0181867BB00573D61 /* numformatter.cpp */,
|
||||
28F2CED1181867BB00573D61 /* numformatter.h */,
|
||||
5ED1D0A91CDE55BD00471E3C /* Overlay.cpp */,
|
||||
5ED1D0AA1CDE55BD00471E3C /* Overlay.h */,
|
||||
5ED1D0AB1CDE55BD00471E3C /* OverlayPanel.cpp */,
|
||||
5ED1D0AC1CDE55BD00471E3C /* OverlayPanel.h */,
|
||||
28530C4A0DF2105200555C94 /* ProgressDialog.cpp */,
|
||||
28530C4B0DF2105200555C94 /* ProgressDialog.h */,
|
||||
1790B10709883BFD008A330A /* Ruler.cpp */,
|
||||
1790B10809883BFD008A330A /* Ruler.h */,
|
||||
28F2CED2181867BB00573D61 /* valnum.cpp */,
|
||||
28F2CED3181867BB00573D61 /* valnum.h */,
|
||||
1790B10B09883BFD008A330A /* Warning.cpp */,
|
||||
1790B10C09883BFD008A330A /* Warning.h */,
|
||||
5E94A1B81D1F1C8400A8713A /* wxPanelWrapper.cpp */,
|
||||
5E94A1B91D1F1C8400A8713A /* wxPanelWrapper.h */,
|
||||
);
|
||||
path = widgets;
|
||||
sourceTree = "<group>";
|
||||
@ -5224,9 +5232,6 @@
|
||||
2897F6DB0AB3DB5A003C20C5 /* toolbars */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
28001B481A0F0EB6007DD161 /* SpectralSelectionBar.cpp */,
|
||||
28001B491A0F0EB6007DD161 /* SpectralSelectionBar.h */,
|
||||
28001B4A1A0F0EB6007DD161 /* SpectralSelectionBarListener.h */,
|
||||
2897F6DC0AB3DB5A003C20C5 /* ControlToolBar.cpp */,
|
||||
2897F6DD0AB3DB5A003C20C5 /* ControlToolBar.h */,
|
||||
289F9C7C0AC671BB00797DC1 /* DeviceToolBar.cpp */,
|
||||
@ -5237,9 +5242,14 @@
|
||||
2897F6E10AB3DB5A003C20C5 /* MeterToolBar.h */,
|
||||
2897F6E20AB3DB5A003C20C5 /* MixerToolBar.cpp */,
|
||||
2897F6E30AB3DB5A003C20C5 /* MixerToolBar.h */,
|
||||
5EF17C211D1F0A690090A642 /* ScrubbingToolBar.cpp */,
|
||||
5EF17C221D1F0A690090A642 /* ScrubbingToolBar.h */,
|
||||
2897F6E40AB3DB5A003C20C5 /* SelectionBar.cpp */,
|
||||
2897F6E50AB3DB5A003C20C5 /* SelectionBar.h */,
|
||||
2803C8BB19F35B4900278526 /* SelectionBarListener.h */,
|
||||
28001B481A0F0EB6007DD161 /* SpectralSelectionBar.cpp */,
|
||||
28001B491A0F0EB6007DD161 /* SpectralSelectionBar.h */,
|
||||
28001B4A1A0F0EB6007DD161 /* SpectralSelectionBarListener.h */,
|
||||
2897F6E60AB3DB5A003C20C5 /* ToolBar.cpp */,
|
||||
2897F6E70AB3DB5A003C20C5 /* ToolBar.h */,
|
||||
2897F6E80AB3DB5A003C20C5 /* ToolDock.cpp */,
|
||||
@ -7323,6 +7333,7 @@
|
||||
1790B12E09883BFD008A330A /* Amplify.cpp in Sources */,
|
||||
1790B13409883BFD008A330A /* ChangePitch.cpp in Sources */,
|
||||
1790B13509883BFD008A330A /* ChangeSpeed.cpp in Sources */,
|
||||
5EF17C231D1F0A690090A642 /* ScrubbingToolBar.cpp in Sources */,
|
||||
1790B13609883BFD008A330A /* ChangeTempo.cpp in Sources */,
|
||||
1790B13709883BFD008A330A /* ClickRemoval.cpp in Sources */,
|
||||
1790B13809883BFD008A330A /* Compressor.cpp in Sources */,
|
||||
@ -7341,6 +7352,7 @@
|
||||
1790B14709883BFD008A330A /* Nyquist.cpp in Sources */,
|
||||
1790B14809883BFD008A330A /* Phaser.cpp in Sources */,
|
||||
1790B14A09883BFD008A330A /* Repeat.cpp in Sources */,
|
||||
5E94A1BA1D1F1C8400A8713A /* wxPanelWrapper.cpp in Sources */,
|
||||
1790B14B09883BFD008A330A /* Reverse.cpp in Sources */,
|
||||
1790B14C09883BFD008A330A /* Silence.cpp in Sources */,
|
||||
1790B14D09883BFD008A330A /* SimpleMono.cpp in Sources */,
|
||||
|
@ -174,11 +174,20 @@ void AColor::DrawFocus(wxDC & dc, wxRect & rect)
|
||||
x2 = rect.GetRight(),
|
||||
y2 = rect.GetBottom();
|
||||
|
||||
#ifdef __WXMAC__
|
||||
// Why must this be different?
|
||||
// Otherwise nothing is visible if you do as for the
|
||||
// other platforms.
|
||||
dc.SetPen(wxPen(wxT("MEDIUM GREY"), 1, wxSOLID));
|
||||
|
||||
dc.SetLogicalFunction(wxCOPY);
|
||||
#else
|
||||
dc.SetPen(wxPen(wxT("MEDIUM GREY"), 0, wxSOLID));
|
||||
|
||||
// this seems to be closer than what Windows does than wxINVERT although
|
||||
// I'm still not sure if it's correct
|
||||
dc.SetLogicalFunction(wxAND_REVERSE);
|
||||
#endif
|
||||
|
||||
wxCoord z;
|
||||
for ( z = x1 + 1; z < x2; z += 2 )
|
||||
|
@ -69,7 +69,7 @@ void HighlightTextCtrl::OnMouseEvent(wxMouseEvent& event)
|
||||
|
||||
//v static const kHighlightTextCtrlID = 7654;
|
||||
|
||||
BEGIN_EVENT_TABLE(Lyrics, wxPanel)
|
||||
BEGIN_EVENT_TABLE(Lyrics, wxPanelWrapper)
|
||||
EVT_KEY_DOWN(Lyrics::OnKeyEvent)
|
||||
EVT_PAINT(Lyrics::OnPaint)
|
||||
EVT_SIZE(Lyrics::OnSize)
|
||||
@ -78,12 +78,12 @@ BEGIN_EVENT_TABLE(Lyrics, wxPanel)
|
||||
// EVT_COMMAND_LEFT_CLICK(kHighlightTextCtrlID, Lyrics::OnHighlightTextCtrl)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(Lyrics, wxPanel)
|
||||
IMPLEMENT_CLASS(Lyrics, wxPanelWrapper)
|
||||
|
||||
Lyrics::Lyrics(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos /*= wxDefaultPosition*/,
|
||||
const wxSize& size /*= wxDefaultSize*/):
|
||||
wxPanel(parent, id, pos, size),
|
||||
wxPanelWrapper(parent, id, pos, size),
|
||||
mWidth(size.x), mHeight(size.y)
|
||||
{
|
||||
mKaraokeHeight = mHeight;
|
||||
|
@ -15,8 +15,8 @@
|
||||
#include "Audacity.h"
|
||||
|
||||
#include <wx/dynarray.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include "widgets/wxPanelWrapper.h"
|
||||
|
||||
class LabelTrack;
|
||||
|
||||
@ -58,7 +58,7 @@ private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
class Lyrics final : public wxPanel
|
||||
class Lyrics final : public wxPanelWrapper
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(Lyrics)
|
||||
|
||||
|
@ -513,6 +513,8 @@ audacity_SOURCES = \
|
||||
toolbars/MeterToolBar.h \
|
||||
toolbars/MixerToolBar.cpp \
|
||||
toolbars/MixerToolBar.h \
|
||||
toolbars/ScrubbingToolBar.cpp \
|
||||
toolbars/ScrubbingToolBar.h \
|
||||
toolbars/SelectionBar.cpp \
|
||||
toolbars/SelectionBar.h \
|
||||
toolbars/SpectralSelectionBar.cpp \
|
||||
@ -582,6 +584,8 @@ audacity_SOURCES = \
|
||||
widgets/valnum.h \
|
||||
widgets/Warning.cpp \
|
||||
widgets/Warning.h \
|
||||
widgets/wxPanelWrapper.cpp \
|
||||
widgets/wxPanelWrapper.h \
|
||||
xml/XMLFileReader.cpp \
|
||||
xml/XMLFileReader.h \
|
||||
xml/XMLWriter.cpp \
|
||||
|
@ -137,6 +137,8 @@ simplifies construction of menu items.
|
||||
#include "tracks/ui/Scrubbing.h"
|
||||
#include "prefs/TracksPrefs.h"
|
||||
|
||||
#include "widgets/Meter.h"
|
||||
|
||||
enum {
|
||||
kAlignStartZero = 0,
|
||||
kAlignStartSelStart,
|
||||
@ -2774,10 +2776,12 @@ void AudacityProject::OnSetRightSelection()
|
||||
void AudacityProject::NextOrPrevFrame(bool forward)
|
||||
{
|
||||
// Focus won't take in a dock unless at least one descendant window
|
||||
// accepts focus. Tell all AButtons to take focus for the duration of this
|
||||
// accepts focus. Tell controls to take focus for the duration of this
|
||||
// function, only. Outside of this, they won't steal the focus when
|
||||
// clicked.
|
||||
auto temp = AButton::TemporarilyAllowFocus();
|
||||
auto temp1 = AButton::TemporarilyAllowFocus();
|
||||
auto temp2 = ASlider::TemporarilyAllowFocus();
|
||||
auto temp3 = Meter::TemporarilyAllowFocus();
|
||||
|
||||
|
||||
// Define the set of windows we rotate among.
|
||||
@ -2788,7 +2792,7 @@ void AudacityProject::NextOrPrevFrame(bool forward)
|
||||
;
|
||||
|
||||
wxWindow *const begin [rotationSize] = {
|
||||
mToolManager->GetTopDock(),
|
||||
GetTopPanel(),
|
||||
#ifdef EXPERIMENTAL_TIME_RULER_NAVIGATION
|
||||
GetRulerPanel(),
|
||||
#endif
|
||||
|
@ -140,7 +140,7 @@ enum {
|
||||
ID_TOGGLEBUTTON_SOLO,
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(MixerTrackCluster, wxPanel)
|
||||
BEGIN_EVENT_TABLE(MixerTrackCluster, wxPanelWrapper)
|
||||
EVT_MOUSE_EVENTS(MixerTrackCluster::OnMouseEvent)
|
||||
EVT_PAINT(MixerTrackCluster::OnPaint)
|
||||
|
||||
@ -157,7 +157,7 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
|
||||
WaveTrack* pLeftTrack, WaveTrack* pRightTrack /*= NULL*/,
|
||||
const wxPoint& pos /*= wxDefaultPosition*/,
|
||||
const wxSize& size /*= wxDefaultSize*/)
|
||||
: wxPanel(parent, -1, pos, size)
|
||||
: wxPanelWrapper(parent, -1, pos, size)
|
||||
{
|
||||
mMixerBoard = grandParent;
|
||||
mProject = project;
|
||||
|
@ -17,13 +17,13 @@
|
||||
#include <wx/bmpbuttn.h>
|
||||
#include <wx/hashmap.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/scrolwin.h>
|
||||
#include <wx/statbmp.h>
|
||||
#include <wx/stattext.h>
|
||||
|
||||
#include "widgets/AButton.h"
|
||||
#include "widgets/ASlider.h"
|
||||
#include "widgets/wxPanelWrapper.h"
|
||||
|
||||
// containment hierarchy:
|
||||
// MixerBoardFrame -> MixerBoard -> MixerBoardScrolledWindow -> MixerTrackCluster(s)
|
||||
@ -68,7 +68,7 @@ class NoteTrack;
|
||||
#endif
|
||||
class WaveTrack;
|
||||
|
||||
class MixerTrackCluster final : public wxPanel
|
||||
class MixerTrackCluster final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
MixerTrackCluster(wxWindow* parent,
|
||||
|
@ -151,6 +151,7 @@ scroll information. It also has some status flags.
|
||||
#include "toolbars/EditToolBar.h"
|
||||
#include "toolbars/MeterToolBar.h"
|
||||
#include "toolbars/MixerToolBar.h"
|
||||
#include "toolbars/ScrubbingToolBar.h"
|
||||
#include "toolbars/SelectionBar.h"
|
||||
#include "toolbars/SpectralSelectionBar.h"
|
||||
#include "toolbars/ToolsToolBar.h"
|
||||
@ -876,10 +877,21 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
// Near as I can tell, this is only a problem under Windows.
|
||||
//
|
||||
|
||||
|
||||
// PRL: this panel groups the top tool dock and the ruler into one
|
||||
// tab cycle.
|
||||
// Must create it with non-default width equal to the main window width,
|
||||
// or else the device toolbar doesn't make initial widths of the choice
|
||||
// controls correct.
|
||||
mTopPanel = safenew wxPanelWrapper {
|
||||
this, wxID_ANY, wxDefaultPosition, { this->GetSize().GetWidth(), -1 }
|
||||
};
|
||||
mTopPanel->SetAutoLayout(true);
|
||||
|
||||
//
|
||||
// Create the ToolDock
|
||||
//
|
||||
mToolManager = std::make_unique<ToolManager>( this );
|
||||
mToolManager = std::make_unique<ToolManager>( this, mTopPanel );
|
||||
GetSelectionBar()->SetListener(this);
|
||||
#ifdef EXPERIMENTAL_SPECTRAL_EDITING
|
||||
GetSpectralSelectionBar()->SetListener(this);
|
||||
@ -889,7 +901,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
//
|
||||
// Create the horizontal ruler
|
||||
//
|
||||
mRuler = safenew AdornedRulerPanel( this,
|
||||
mRuler = safenew AdornedRulerPanel( this, mTopPanel,
|
||||
wxID_ANY,
|
||||
wxDefaultPosition,
|
||||
wxSize( -1, AdornedRulerPanel::GetRulerHeight(false) ),
|
||||
@ -915,7 +927,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
// Not using a notebook, so we place the track panel inside another panel,
|
||||
// this keeps the notebook code and normal code consistant and also
|
||||
// paves the way for adding additional windows inside the track panel.
|
||||
mMainPanel = safenew wxPanel(this, -1,
|
||||
mMainPanel = safenew wxPanelWrapper(this, -1,
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxNO_BORDER);
|
||||
@ -930,13 +942,18 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
#endif
|
||||
|
||||
pPage->SetBackgroundColour(theTheme.Colour( clrMedium ));
|
||||
{
|
||||
auto ubs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||
ubs->Add(mToolManager->GetTopDock(), 0, wxEXPAND | wxALIGN_TOP);
|
||||
ubs->Add(mRuler, 0, wxEXPAND);
|
||||
mTopPanel->SetSizer(ubs.release());
|
||||
}
|
||||
|
||||
wxBoxSizer *bs;
|
||||
{
|
||||
auto ubs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||
bs = ubs.get();
|
||||
bs->Add(mToolManager->GetTopDock(), 0, wxEXPAND | wxALIGN_TOP);
|
||||
bs->Add(mRuler, 0, wxEXPAND);
|
||||
bs->Add(mTopPanel, 0, wxEXPAND | wxALIGN_TOP);
|
||||
bs->Add(pPage, 1, wxEXPAND);
|
||||
bs->Add(mToolManager->GetBotDock(), 0, wxEXPAND);
|
||||
SetAutoLayout(true);
|
||||
@ -1002,7 +1019,7 @@ AudacityProject::AudacityProject(wxWindow * parent, wxWindowID id,
|
||||
// will be given the focus even if we try to SetFocus(). By
|
||||
// making the TrackPanel that first window, we resolve several
|
||||
// keyboard focus problems.
|
||||
pPage->MoveBeforeInTabOrder(mToolManager->GetTopDock());
|
||||
pPage->MoveBeforeInTabOrder(mTopPanel);
|
||||
|
||||
bs = (wxBoxSizer *)pPage->GetSizer();
|
||||
|
||||
|
@ -258,7 +258,8 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
|
||||
bool GetDirty() { return mDirty; }
|
||||
void SetProjectTitle();
|
||||
|
||||
TrackPanel * GetTrackPanel(){return mTrackPanel;}
|
||||
wxPanel *GetTopPanel() { return mTopPanel; }
|
||||
TrackPanel * GetTrackPanel() {return mTrackPanel;}
|
||||
|
||||
bool GetIsEmpty();
|
||||
|
||||
@ -594,6 +595,7 @@ public:
|
||||
wxStatusBar *mStatusBar;
|
||||
|
||||
AdornedRulerPanel *mRuler{};
|
||||
wxPanel *mTopPanel{};
|
||||
TrackPanel *mTrackPanel{};
|
||||
TrackFactory *mTrackFactory{};
|
||||
wxPanel * mMainPanel;
|
||||
|
@ -107,6 +107,7 @@ for registering for changes.
|
||||
#include "Experimental.h"
|
||||
#include "Shuttle.h"
|
||||
#include "WrappedType.h"
|
||||
#include "widgets/wxPanelWrapper.h"
|
||||
|
||||
ShuttleGuiBase::ShuttleGuiBase(wxWindow * pParent, teShuttleMode ShuttleMode )
|
||||
{
|
||||
@ -790,7 +791,7 @@ wxPanel * ShuttleGuiBase::StartPanel(int iStyle)
|
||||
if( mShuttleMode != eIsCreating )
|
||||
return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
|
||||
wxPanel * pPanel;
|
||||
mpWind = pPanel = safenew wxPanel( GetParent(), miId, wxDefaultPosition, wxDefaultSize,
|
||||
mpWind = pPanel = safenew wxPanelWrapper( GetParent(), miId, wxDefaultPosition, wxDefaultSize,
|
||||
Style( wxNO_BORDER ));
|
||||
|
||||
if( iStyle != 0 )
|
||||
@ -847,7 +848,7 @@ wxNotebookPage * ShuttleGuiBase::StartNotebookPage( const wxString & Name )
|
||||
return NULL;
|
||||
// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
|
||||
wxNotebook * pNotebook = (wxNotebook*)mpParent;
|
||||
wxNotebookPage * pPage = safenew wxPanel(GetParent());
|
||||
wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent());
|
||||
pPage->SetName(Name);
|
||||
|
||||
pNotebook->AddPage(
|
||||
@ -869,7 +870,7 @@ void ShuttleGuiBase::StartNotebookPage( const wxString & Name, wxNotebookPage *
|
||||
return;
|
||||
// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wx);
|
||||
wxNotebook * pNotebook = (wxNotebook*)mpParent;
|
||||
// wxNotebookPage * pPage = safenew wxPanel(GetParent());
|
||||
// wxNotebookPage * pPage = safenew wxPanelWrapper(GetParent());
|
||||
pPage->Create( mpParent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, wxT("panel"));
|
||||
pPage->SetName(Name);
|
||||
|
||||
@ -895,7 +896,7 @@ void ShuttleGuiBase::EndNotebookPage()
|
||||
|
||||
// Doxygen description is at the start of the file
|
||||
// this is a wxPanel with erase background disabled.
|
||||
class InvisiblePanel final : public wxPanel
|
||||
class InvisiblePanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
InvisiblePanel(
|
||||
@ -904,7 +905,7 @@ public:
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = wxTAB_TRAVERSAL ) :
|
||||
wxPanel( parent, id, pos, size, style )
|
||||
wxPanelWrapper( parent, id, pos, size, style )
|
||||
{
|
||||
};
|
||||
~InvisiblePanel(){;};
|
||||
@ -914,7 +915,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
BEGIN_EVENT_TABLE(InvisiblePanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(InvisiblePanel, wxPanelWrapper)
|
||||
// EVT_PAINT(InvisiblePanel::OnPaint)
|
||||
EVT_ERASE_BACKGROUND( InvisiblePanel::OnErase)
|
||||
END_EVENT_TABLE()
|
||||
@ -932,7 +933,7 @@ wxPanel * ShuttleGuiBase::StartInvisiblePanel()
|
||||
if( mShuttleMode != eIsCreating )
|
||||
return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), wxPanel);
|
||||
wxPanel * pPanel;
|
||||
mpWind = pPanel = safenew wxPanel(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
|
||||
mpWind = pPanel = safenew wxPanelWrapper(GetParent(), miId, wxDefaultPosition, wxDefaultSize,
|
||||
wxNO_BORDER);
|
||||
|
||||
mpWind->SetBackgroundColour(
|
||||
|
@ -607,7 +607,7 @@ static int GetDistance(const wxPoint& first, const wxPoint& second)
|
||||
return distanceY;
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(EffectAutoDuckPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(EffectAutoDuckPanel, wxPanelWrapper)
|
||||
EVT_PAINT(EffectAutoDuckPanel::OnPaint)
|
||||
EVT_MOUSE_CAPTURE_CHANGED(EffectAutoDuckPanel::OnMouseCaptureChanged)
|
||||
EVT_MOUSE_CAPTURE_LOST(EffectAutoDuckPanel::OnMouseCaptureLost)
|
||||
@ -617,7 +617,7 @@ BEGIN_EVENT_TABLE(EffectAutoDuckPanel, wxPanel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
EffectAutoDuckPanel::EffectAutoDuckPanel(wxWindow *parent, EffectAutoDuck *effect)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(600, 300))
|
||||
: wxPanelWrapper(parent, wxID_ANY, wxDefaultPosition, wxSize(600, 300))
|
||||
{
|
||||
mParent = parent;
|
||||
mEffect = effect;
|
||||
|
@ -14,12 +14,12 @@
|
||||
#include <wx/bitmap.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/textctrl.h>
|
||||
#include <wx/window.h>
|
||||
|
||||
#include "Effect.h"
|
||||
#include "../widgets/wxPanelWrapper.h"
|
||||
|
||||
class EffectAutoDuckPanel;
|
||||
class ShuttleGui;
|
||||
@ -90,7 +90,7 @@ private:
|
||||
friend class EffectAutoDuckPanel;
|
||||
};
|
||||
|
||||
class EffectAutoDuckPanel final : public wxPanel
|
||||
class EffectAutoDuckPanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
EffectAutoDuckPanel(wxWindow *parent, EffectAutoDuck *effect);
|
||||
|
@ -664,7 +664,7 @@ void EffectCompressor::UpdateUI()
|
||||
// EffectCompressorPanel
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(EffectCompressorPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(EffectCompressorPanel, wxPanelWrapper)
|
||||
EVT_PAINT(EffectCompressorPanel::OnPaint)
|
||||
EVT_SIZE(EffectCompressorPanel::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
@ -673,7 +673,7 @@ EffectCompressorPanel::EffectCompressorPanel(wxWindow *parent,
|
||||
double & threshold,
|
||||
double & noiseFloor,
|
||||
double & ratio)
|
||||
: wxPanel(parent),
|
||||
: wxPanelWrapper(parent),
|
||||
threshold(threshold),
|
||||
noiseFloor(noiseFloor),
|
||||
ratio(ratio)
|
||||
|
@ -15,11 +15,11 @@
|
||||
#include <wx/checkbox.h>
|
||||
#include <wx/event.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/slider.h>
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/window.h>
|
||||
#include "../widgets/wxPanelWrapper.h"
|
||||
|
||||
#include "TwoPassSimpleMono.h"
|
||||
|
||||
@ -133,7 +133,7 @@ private:
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
class EffectCompressorPanel final : public wxPanel
|
||||
class EffectCompressorPanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
EffectCompressorPanel(wxWindow *parent,
|
||||
|
@ -2793,11 +2793,11 @@ void EffectDialog::OnOk(wxCommandEvent & WXUNUSED(evt))
|
||||
//
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class EffectPanel final : public wxPanel
|
||||
class EffectPanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
EffectPanel(wxWindow *parent)
|
||||
: wxPanel(parent)
|
||||
: wxPanelWrapper(parent)
|
||||
{
|
||||
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
||||
SetName(wxT("\a"));
|
||||
@ -2984,8 +2984,8 @@ bool EffectUIHost::Initialize()
|
||||
vs->Add(hs.release(), 1, wxEXPAND);
|
||||
}
|
||||
|
||||
wxPanel *buttonPanel = safenew wxPanel(this, wxID_ANY);
|
||||
wxPanel *const bar = safenew wxPanel(buttonPanel, wxID_ANY);
|
||||
wxPanel *buttonPanel = safenew wxPanelWrapper(this, wxID_ANY);
|
||||
wxPanel *const bar = safenew wxPanelWrapper(buttonPanel, wxID_ANY);
|
||||
|
||||
// This fools NVDA into not saying "Panel" when the dialog gets focus
|
||||
bar->SetName(wxT("\a"));
|
||||
|
@ -106,7 +106,7 @@ EffectRack::EffectRack()
|
||||
|
||||
{
|
||||
auto bs = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||
mPanel = safenew wxPanel(this, wxID_ANY);
|
||||
mPanel = safenew wxPanelWrapper(this, wxID_ANY);
|
||||
bs->Add(mPanel, 1, wxEXPAND);
|
||||
SetSizer(bs.release());
|
||||
}
|
||||
|
@ -732,7 +732,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
|
||||
szrG = S.GetSizer();
|
||||
|
||||
// Panel used to host the sliders since they will be positioned manually.
|
||||
mGraphicPanel = safenew wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, 150));
|
||||
mGraphicPanel = safenew wxPanelWrapper(parent, wxID_ANY, wxDefaultPosition, wxSize(-1, 150));
|
||||
S.Prop(1).AddWindow(mGraphicPanel, wxEXPAND);
|
||||
|
||||
for (int i = 0; (i < NUMBER_OF_BANDS) && (kThirdOct[i] <= mHiFreq); ++i)
|
||||
@ -2887,7 +2887,7 @@ void EffectEqualization::OnBench( wxCommandEvent & event)
|
||||
// EqualizationPanel
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(EqualizationPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(EqualizationPanel, wxPanelWrapper)
|
||||
EVT_PAINT(EqualizationPanel::OnPaint)
|
||||
EVT_MOUSE_EVENTS(EqualizationPanel::OnMouseEvent)
|
||||
EVT_MOUSE_CAPTURE_LOST(EqualizationPanel::OnCaptureLost)
|
||||
@ -2895,7 +2895,7 @@ BEGIN_EVENT_TABLE(EqualizationPanel, wxPanel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
EqualizationPanel::EqualizationPanel(EffectEqualization *effect, wxWindow *parent)
|
||||
: wxPanel(parent)
|
||||
: wxPanelWrapper(parent)
|
||||
{
|
||||
mParent = parent;
|
||||
mEffect = effect;
|
||||
|
@ -279,7 +279,7 @@ private:
|
||||
friend class EditCurvesDialog;
|
||||
};
|
||||
|
||||
class EqualizationPanel final : public wxPanel
|
||||
class EqualizationPanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
EqualizationPanel(EffectEqualization *effect, wxWindow *parent);
|
||||
|
@ -1008,13 +1008,13 @@ void EffectScienFilter::EnableDisableRippleCtl(int FilterType)
|
||||
// EffectScienFilterPanel
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(EffectScienFilterPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(EffectScienFilterPanel, wxPanelWrapper)
|
||||
EVT_PAINT(EffectScienFilterPanel::OnPaint)
|
||||
EVT_SIZE(EffectScienFilterPanel::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
EffectScienFilterPanel::EffectScienFilterPanel(EffectScienFilter *effect, wxWindow *parent)
|
||||
: wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(400, 200))
|
||||
: wxPanelWrapper(parent, wxID_ANY, wxDefaultPosition, wxSize(400, 200))
|
||||
{
|
||||
mEffect = effect;
|
||||
mParent = parent;
|
||||
|
@ -135,7 +135,7 @@ private:
|
||||
friend class EffectScienFilterPanel;
|
||||
};
|
||||
|
||||
class EffectScienFilterPanel final : public wxPanel
|
||||
class EffectScienFilterPanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
EffectScienFilterPanel(EffectScienFilter *effect, wxWindow *parent);
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include <wx/filename.h>
|
||||
#include <wx/frame.h>
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/stattext.h>
|
||||
@ -34,6 +33,7 @@
|
||||
|
||||
#include "../../ShuttleGui.h"
|
||||
#include "../../widgets/valnum.h"
|
||||
#include "../../widgets/wxPanelWrapper.h"
|
||||
|
||||
#include "AudioUnitEffect.h"
|
||||
|
||||
@ -1758,7 +1758,7 @@ bool AudioUnitEffect::PopulateUI(wxWindow *parent)
|
||||
auto mainSizer = std::make_unique<wxBoxSizer>(wxVERTICAL);
|
||||
|
||||
wxASSERT(mParent); // To justify safenew
|
||||
container = safenew wxPanel(mParent, wxID_ANY);
|
||||
container = safenew wxPanelWrapper(mParent, wxID_ANY);
|
||||
mainSizer->Add(container, 1, wxEXPAND);
|
||||
|
||||
mParent->SetSizer(mainSizer.release());
|
||||
|
@ -31,6 +31,7 @@
|
||||
#include "../../Internat.h"
|
||||
#include "../../ShuttleGui.h"
|
||||
#include "../../widgets/valnum.h"
|
||||
#include "../../widgets/wxPanelWrapper.h"
|
||||
|
||||
#include "lilv/lilv.h"
|
||||
#include "suil/suil.h"
|
||||
@ -1449,7 +1450,7 @@ bool LV2Effect::BuildFancy()
|
||||
}
|
||||
|
||||
// Use a panel to host the plugins GUI
|
||||
mContainer = safenew wxPanel(mParent, wxID_ANY);
|
||||
mContainer = safenew wxPanelWrapper(mParent, wxID_ANY);
|
||||
if (!mContainer)
|
||||
{
|
||||
lilv_uis_free(uis);
|
||||
|
@ -220,7 +220,7 @@ bool ExportPlugin::DisplayOptions(wxWindow * WXUNUSED(parent), int WXUNUSED(form
|
||||
wxWindow *ExportPlugin::OptionsCreate(wxWindow *parent, int WXUNUSED(format))
|
||||
{
|
||||
wxASSERT(parent); // To justify safenew
|
||||
wxPanel *p = safenew wxPanel(parent, wxID_ANY);
|
||||
wxPanel *p = safenew wxPanelWrapper(parent, wxID_ANY);
|
||||
ShuttleGui S(p, eIsCreatingFromPrefs);
|
||||
|
||||
S.StartHorizontalLay(wxCENTER);
|
||||
@ -985,7 +985,7 @@ bool Exporter::SetAutoExportOptions(AudacityProject *project) {
|
||||
// ExportMixerPanel
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
BEGIN_EVENT_TABLE(ExportMixerPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ExportMixerPanel, wxPanelWrapper)
|
||||
EVT_PAINT(ExportMixerPanel::OnPaint)
|
||||
EVT_MOUSE_EVENTS(ExportMixerPanel::OnMouseEvent)
|
||||
END_EVENT_TABLE()
|
||||
@ -993,7 +993,7 @@ END_EVENT_TABLE()
|
||||
ExportMixerPanel::ExportMixerPanel( MixerSpec *mixerSpec,
|
||||
wxArrayString trackNames,wxWindow *parent, wxWindowID id,
|
||||
const wxPoint& pos, const wxSize& size):
|
||||
wxPanel(parent, id, pos, size)
|
||||
wxPanelWrapper(parent, id, pos, size)
|
||||
{
|
||||
mBitmap = NULL;
|
||||
mWidth = 0;
|
||||
|
@ -16,10 +16,10 @@
|
||||
#include <wx/dialog.h>
|
||||
#include <wx/dynarray.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/simplebook.h>
|
||||
#include "../Tags.h"
|
||||
#include "../SampleFormat.h"
|
||||
#include "../widgets/wxPanelWrapper.h"
|
||||
|
||||
#include "FileDialog.h"
|
||||
|
||||
@ -215,7 +215,7 @@ private:
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportMixerPanel
|
||||
//----------------------------------------------------------------------------
|
||||
class ExportMixerPanel final : public wxPanel
|
||||
class ExportMixerPanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
ExportMixerPanel( MixerSpec *mixerSpec, wxArrayString trackNames,
|
||||
|
@ -39,7 +39,7 @@
|
||||
// ExportCLOptions
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class ExportCLOptions final : public wxPanel
|
||||
class ExportCLOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
ExportCLOptions(wxWindow *parent, int format);
|
||||
@ -60,14 +60,14 @@ private:
|
||||
|
||||
#define ID_BROWSE 5000
|
||||
|
||||
BEGIN_EVENT_TABLE(ExportCLOptions, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ExportCLOptions, wxPanelWrapper)
|
||||
EVT_BUTTON(ID_BROWSE, ExportCLOptions::OnBrowse)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
///
|
||||
///
|
||||
ExportCLOptions::ExportCLOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
mHistory.Load(*gPrefs, wxT("/FileFormats/ExternalProgramHistory"));
|
||||
|
||||
|
@ -142,7 +142,7 @@ const int ExportFFmpegAC3Options::iAC3BitRates[] = { 32000, 40000, 48000, 56000,
|
||||
const int ExportFFmpegAC3Options::iAC3SampleRates[] = { 32000, 44100, 48000, 0 };
|
||||
|
||||
ExportFFmpegAC3Options::ExportFFmpegAC3Options(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
for (unsigned int i=0; i < (sizeof(iAC3BitRates)/sizeof(int)); i++)
|
||||
{
|
||||
@ -205,7 +205,7 @@ bool ExportFFmpegAC3Options::TransferDataFromWindow()
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
ExportFFmpegAACOptions::ExportFFmpegAACOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
@ -268,7 +268,7 @@ int ExportFFmpegAMRNBOptions::iAMRNBBitRate[] =
|
||||
{ 4750, 5150, 5900, 6700, 7400, 7950, 10200, 12200 };
|
||||
|
||||
ExportFFmpegAMRNBOptions::ExportFFmpegAMRNBOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
for (unsigned int i=0; i < (sizeof(iAMRNBBitRate)/sizeof(int)); i++)
|
||||
{
|
||||
@ -338,7 +338,7 @@ const int ExportFFmpegWMAOptions::iWMABitRate[] =
|
||||
{ 24000, 32000, 40000, 48000, 64000, 80000, 96000, 128000, 160000, 192000, 256000, 320000 };
|
||||
|
||||
ExportFFmpegWMAOptions::ExportFFmpegWMAOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
for (unsigned int i=0; i < (sizeof(iWMABitRate)/sizeof(int)); i++)
|
||||
{
|
||||
@ -402,12 +402,12 @@ bool ExportFFmpegWMAOptions::TransferDataFromWindow()
|
||||
|
||||
#define OpenID 9000
|
||||
|
||||
BEGIN_EVENT_TABLE(ExportFFmpegCustomOptions, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ExportFFmpegCustomOptions, wxPanelWrapper)
|
||||
EVT_BUTTON(OpenID, ExportFFmpegCustomOptions::OnOpen)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
ExportFFmpegCustomOptions::ExportFFmpegCustomOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
@ -20,6 +20,7 @@ LRN
|
||||
#include <wx/listimpl.cpp>
|
||||
#include "../xml/XMLFileReader.h"
|
||||
#include "../FileNames.h"
|
||||
#include "../widgets/wxPanelWrapper.h"
|
||||
|
||||
|
||||
/// Identifiers for pre-set export types.
|
||||
@ -58,7 +59,7 @@ struct CompatibilityEntry
|
||||
|
||||
|
||||
/// AC3 export options dialog
|
||||
class ExportFFmpegAC3Options final : public wxPanel
|
||||
class ExportFFmpegAC3Options final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -84,7 +85,7 @@ private:
|
||||
int mBitRateFromChoice;
|
||||
};
|
||||
|
||||
class ExportFFmpegAACOptions final : public wxPanel
|
||||
class ExportFFmpegAACOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -100,7 +101,7 @@ private:
|
||||
wxSpinCtrl *mQualitySpin;
|
||||
};
|
||||
|
||||
class ExportFFmpegAMRNBOptions final : public wxPanel
|
||||
class ExportFFmpegAMRNBOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -122,7 +123,7 @@ private:
|
||||
int mBitRateFromChoice;
|
||||
};
|
||||
|
||||
class ExportFFmpegWMAOptions final : public wxPanel
|
||||
class ExportFFmpegWMAOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -145,7 +146,7 @@ private:
|
||||
int mBitRateFromChoice;
|
||||
};
|
||||
|
||||
class ExportFFmpegCustomOptions final : public wxPanel
|
||||
class ExportFFmpegCustomOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -47,7 +47,7 @@ and libvorbis examples, Monty <monty@xiph.org>
|
||||
// ExportFLACOptions Class
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class ExportFLACOptions final : public wxPanel
|
||||
class ExportFLACOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -62,7 +62,7 @@ public:
|
||||
///
|
||||
///
|
||||
ExportFLACOptions::ExportFLACOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
@ -82,7 +82,7 @@ static int iBitrates[] = {
|
||||
192, 224, 256, 320, 384
|
||||
};
|
||||
|
||||
class ExportMP2Options final : public wxPanel
|
||||
class ExportMP2Options final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
ExportMP2Options(wxWindow *parent, int format);
|
||||
@ -100,7 +100,7 @@ private:
|
||||
///
|
||||
///
|
||||
ExportMP2Options::ExportMP2Options(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
for (unsigned int i=0; i < (sizeof(iBitrates)/sizeof(int)); i++)
|
||||
{
|
||||
|
@ -262,7 +262,7 @@ static void InitMP3_Statics()
|
||||
}
|
||||
}
|
||||
|
||||
class ExportMP3Options final : public wxPanel
|
||||
class ExportMP3Options final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -305,7 +305,7 @@ private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(ExportMP3Options, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ExportMP3Options, wxPanelWrapper)
|
||||
EVT_RADIOBUTTON(ID_SET, ExportMP3Options::OnSET)
|
||||
EVT_RADIOBUTTON(ID_VBR, ExportMP3Options::OnVBR)
|
||||
EVT_RADIOBUTTON(ID_ABR, ExportMP3Options::OnABR)
|
||||
@ -317,7 +317,7 @@ END_EVENT_TABLE()
|
||||
///
|
||||
///
|
||||
ExportMP3Options::ExportMP3Options(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
InitMP3_Statics();
|
||||
|
||||
|
@ -42,7 +42,7 @@
|
||||
// ExportOGGOptions
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
class ExportOGGOptions final : public wxPanel
|
||||
class ExportOGGOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -61,7 +61,7 @@ private:
|
||||
///
|
||||
///
|
||||
ExportOGGOptions::ExportOGGOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
mOggQualityUnscaled = gPrefs->Read(wxT("/FileFormats/OggExportQuality"),50)/10;
|
||||
|
||||
|
@ -92,7 +92,7 @@ static void WriteExportFormatPref(int format)
|
||||
#define ID_HEADER_CHOICE 7102
|
||||
#define ID_ENCODING_CHOICE 7103
|
||||
|
||||
class ExportPCMOptions final : public wxPanel
|
||||
class ExportPCMOptions final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
@ -123,12 +123,12 @@ private:
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(ExportPCMOptions, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ExportPCMOptions, wxPanelWrapper)
|
||||
EVT_CHOICE(ID_HEADER_CHOICE, ExportPCMOptions::OnHeaderChoice)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
ExportPCMOptions::ExportPCMOptions(wxWindow *parent, int selformat)
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
int format;
|
||||
|
||||
|
@ -29,7 +29,7 @@
|
||||
#include "../Menus.h"
|
||||
#include "../toolbars/ToolManager.h"
|
||||
|
||||
BEGIN_EVENT_TABLE(BatchPrefs, wxPanel)
|
||||
BEGIN_EVENT_TABLE(BatchPrefs, PrefsPanel)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
/// Constructor
|
||||
|
@ -73,6 +73,9 @@ BEGIN_EVENT_TABLE(PrefsDialog, wxDialog)
|
||||
EVT_BUTTON(wxID_CANCEL, PrefsDialog::OnCancel)
|
||||
EVT_BUTTON(wxID_APPLY, PrefsDialog::OnApply)
|
||||
EVT_TREE_KEY_DOWN(wxID_ANY, PrefsDialog::OnTreeKeyDown) // Handles key events when tree has focus
|
||||
|
||||
EVT_CHAR_HOOK(PrefsDialog::OnCharHook)
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
@ -373,6 +376,12 @@ void PrefsDialog::OnTreeKeyDown(wxTreeEvent & event)
|
||||
event.Skip(); // Ensure standard behavior when enter is not pressed
|
||||
}
|
||||
|
||||
void PrefsDialog::OnCharHook(wxKeyEvent &event)
|
||||
{
|
||||
// Common behavior, let's define it in just one place
|
||||
wxPanelWrapper::DoCharHook(event);
|
||||
}
|
||||
|
||||
void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
|
||||
{
|
||||
RecordExpansionState();
|
||||
|
@ -61,6 +61,8 @@ class PrefsDialog /* not final */ : public wxDialog
|
||||
void OnApply(wxCommandEvent & e);
|
||||
void OnTreeKeyDown(wxTreeEvent & e); // Used to dismiss the dialog when enter is pressed with focus on tree
|
||||
|
||||
void OnCharHook(wxKeyEvent &e);
|
||||
|
||||
void SelectPageByName(const wxString &pageName);
|
||||
|
||||
// Accessor to help implementations of SavePreferredPage(),
|
||||
|
@ -28,8 +28,8 @@ ThemePrefs.
|
||||
#ifndef __AUDACITY_PREFS_PANEL__
|
||||
#define __AUDACITY_PREFS_PANEL__
|
||||
|
||||
#include <wx/panel.h>
|
||||
#include <wx/window.h>
|
||||
#include "../widgets/wxPanelWrapper.h"
|
||||
|
||||
/* A few constants for an attempt at semi-uniformity */
|
||||
#define PREFS_FONT_SIZE 8
|
||||
@ -40,11 +40,11 @@ ThemePrefs.
|
||||
#define TOP_LEVEL_BORDER 5
|
||||
#define GENERIC_CONTROL_BORDER 5
|
||||
|
||||
class PrefsPanel /* not final */ : public wxPanel
|
||||
class PrefsPanel /* not final */ : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
PrefsPanel(wxWindow * parent, const wxString &title)
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
: wxPanelWrapper(parent, wxID_ANY)
|
||||
{
|
||||
SetLabel(title); // Provide visual label
|
||||
SetName(title); // Provide audible label
|
||||
|
@ -138,7 +138,14 @@ AButton *ControlToolBar::MakeButton(teBmps eEnabledUp, teBmps eEnabledDown, teBm
|
||||
wxDefaultPosition, processdownevents,
|
||||
theTheme.ImageSize( bmpRecoloredUpLarge ));
|
||||
r->SetLabel(label);
|
||||
r->SetFocusRect( r->GetRect().Deflate( 12, 12 ) );
|
||||
enum { deflation =
|
||||
#ifdef __WXMAC__
|
||||
3
|
||||
#else
|
||||
12
|
||||
#endif
|
||||
};
|
||||
r->SetFocusRect( r->GetClientRect().Deflate( deflation, deflation ) );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
@ -346,246 +346,3 @@ void EditToolBar::EnableDisableButtons()
|
||||
mButtons[ETBSyncLockID]->PopUp();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
// PRL: to do: move the below to its own file
|
||||
// Much of this is imitative of EditToolBar. Should there be a common base
|
||||
// class?
|
||||
#include "../Audacity.h"
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/event.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/tooltip.h>
|
||||
#endif
|
||||
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../ImageManipulation.h"
|
||||
#include "../Internat.h"
|
||||
#include "../Prefs.h"
|
||||
#include "../Project.h"
|
||||
#include "../Theme.h"
|
||||
#include "../Track.h"
|
||||
#include "../UndoManager.h"
|
||||
#include "../widgets/AButton.h"
|
||||
#include "../widgets/Ruler.h"
|
||||
#include "../tracks/ui/Scrubbing.h"
|
||||
|
||||
#include "../Experimental.h"
|
||||
|
||||
IMPLEMENT_CLASS(ScrubbingToolBar, ToolBar);
|
||||
|
||||
//const int BUTTON_WIDTH = 27;
|
||||
//const int SEPARATOR_WIDTH = 14;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Methods for ScrubbingToolBar
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
BEGIN_EVENT_TABLE( ScrubbingToolBar, ToolBar )
|
||||
EVT_COMMAND_RANGE( STBFirstButton,
|
||||
STBFirstButton + STBNumButtons - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED,
|
||||
ScrubbingToolBar::OnButton )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
//Standard contructor
|
||||
ScrubbingToolBar::ScrubbingToolBar()
|
||||
: ToolBar(ScrubbingBarID, _("Scrub"), wxT("Scrub"))
|
||||
{
|
||||
}
|
||||
|
||||
ScrubbingToolBar::~ScrubbingToolBar()
|
||||
{
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::Create(wxWindow * parent)
|
||||
{
|
||||
ToolBar::Create(parent);
|
||||
}
|
||||
|
||||
/// This is a convenience function that allows for button creation in
|
||||
/// MakeButtons() with fewer arguments
|
||||
/// Very similar to code in ControlToolBar...
|
||||
AButton *ScrubbingToolBar::AddButton
|
||||
(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
|
||||
int id,
|
||||
const wxChar *label,
|
||||
bool toggle)
|
||||
{
|
||||
AButton *&r = mButtons[id];
|
||||
|
||||
r = ToolBar::MakeButton
|
||||
(this,
|
||||
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
||||
eEnabledUp, eEnabledDown, eDisabled,
|
||||
wxWindowID(id),
|
||||
wxDefaultPosition,
|
||||
toggle,
|
||||
theTheme.ImageSize( bmpRecoloredUpSmall ));
|
||||
|
||||
r->SetLabel(label);
|
||||
// JKC: Unlike ControlToolBar, does not have a focus rect. Shouldn't it?
|
||||
// r->SetFocusRect( r->GetRect().Deflate( 4, 4 ) );
|
||||
|
||||
Add( r, 0, wxALIGN_CENTER );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::Populate()
|
||||
{
|
||||
MakeButtonBackgroundsSmall();
|
||||
|
||||
/* Buttons */
|
||||
AddButton(bmpScrub, bmpScrub, bmpScrubDisabled, STBScrubID,
|
||||
_("Scrub"), true);
|
||||
AddButton(bmpSeek, bmpSeek, bmpSeekDisabled, STBSeekID,
|
||||
_("Seek"), true);
|
||||
AddButton(bmpToggleScrubBar, bmpToggleScrubBar, bmpToggleScrubBar,
|
||||
STBBarID,
|
||||
_("Scrub bar"), true);
|
||||
|
||||
|
||||
RegenerateTooltips();
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::UpdatePrefs()
|
||||
{
|
||||
RegenerateTooltips();
|
||||
|
||||
// Set label to pull in language change
|
||||
SetLabel(_("Scrubbing"));
|
||||
|
||||
// Give base class a chance
|
||||
ToolBar::UpdatePrefs();
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::RegenerateTooltips()
|
||||
{
|
||||
#if wxUSE_TOOLTIPS
|
||||
std::vector<wxString> commands;
|
||||
auto fn = [&]
|
||||
(AButton &button, const wxString &label, const wxString &command)
|
||||
{
|
||||
commands.clear();
|
||||
commands.push_back(label);
|
||||
commands.push_back(command);
|
||||
ToolBar::SetButtonToolTip(button, commands);
|
||||
};
|
||||
|
||||
auto project = GetActiveProject();
|
||||
if (project) {
|
||||
auto &scrubber = project->GetScrubber();
|
||||
|
||||
const auto scrubButton = mButtons[STBScrubID];
|
||||
const auto seekButton = mButtons[STBSeekID];
|
||||
|
||||
wxString label;
|
||||
label = (
|
||||
scrubber.Scrubs()
|
||||
/* i18n-hint: These commands assist the user in finding a sound by ear. ...
|
||||
"Scrubbing" is variable-speed playback, ...
|
||||
"Seeking" is normal speed playback but with skips
|
||||
*/
|
||||
? _("Stop Scrubbing")
|
||||
: _("Start Scrubbing")
|
||||
);
|
||||
fn(*scrubButton, label, wxT("Scrub"));
|
||||
|
||||
label = (
|
||||
scrubber.Seeks()
|
||||
/* i18n-hint: These commands assist the user in finding a sound by ear. ...
|
||||
"Scrubbing" is variable-speed playback, ...
|
||||
"Seeking" is normal speed playback but with skips
|
||||
*/
|
||||
? _("Stop Seeking")
|
||||
: _("Start Seeking")
|
||||
);
|
||||
fn(*seekButton, label, wxT("Seek"));
|
||||
|
||||
label = (
|
||||
project->GetRulerPanel()->ShowingScrubBar()
|
||||
? _("Hide Scrub Bar")
|
||||
: _("Show Scrub Bar")
|
||||
);
|
||||
fn(*mButtons[STBBarID], label, wxT("ToggleScrubBar"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::OnButton(wxCommandEvent &event)
|
||||
{
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (!p) return;
|
||||
auto &scrubber = p->GetScrubber();
|
||||
|
||||
int id = event.GetId();
|
||||
|
||||
switch (id) {
|
||||
case STBScrubID:
|
||||
scrubber.OnScrub(event);
|
||||
break;
|
||||
case STBSeekID:
|
||||
scrubber.OnSeek(event);
|
||||
break;
|
||||
case STBBarID:
|
||||
scrubber.OnToggleScrubBar(event);
|
||||
break;
|
||||
default:
|
||||
wxASSERT(false);
|
||||
}
|
||||
|
||||
EnableDisableButtons();
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::EnableDisableButtons()
|
||||
{
|
||||
const auto scrubButton = mButtons[STBScrubID];
|
||||
scrubButton->SetEnabled(true);
|
||||
const auto seekButton = mButtons[STBSeekID];
|
||||
seekButton->SetEnabled(true);
|
||||
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (!p) return;
|
||||
|
||||
auto &scrubber = p->GetScrubber();
|
||||
const auto canScrub = scrubber.CanScrub();
|
||||
|
||||
if (scrubber.Scrubs()) {
|
||||
scrubButton->PushDown();
|
||||
scrubButton->Enable();
|
||||
}
|
||||
else {
|
||||
scrubButton->PopUp();
|
||||
if (canScrub)
|
||||
scrubButton->Enable();
|
||||
else
|
||||
scrubButton->Disable();
|
||||
}
|
||||
|
||||
if (scrubber.Seeks()) {
|
||||
seekButton->PushDown();
|
||||
seekButton->Enable();
|
||||
}
|
||||
else {
|
||||
seekButton->PopUp();
|
||||
if (canScrub)
|
||||
seekButton->Enable();
|
||||
else
|
||||
seekButton->Disable();
|
||||
}
|
||||
|
||||
const auto barButton = mButtons[STBBarID];
|
||||
barButton->Enable();
|
||||
if (p->GetRulerPanel()->ShowingScrubBar())
|
||||
barButton->PushDown();
|
||||
else
|
||||
barButton->PopUp();
|
||||
}
|
||||
|
@ -97,67 +97,5 @@ class EditToolBar final : public ToolBar {
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
// PRL: to do: move this to its own file
|
||||
|
||||
#include <wx/defs.h>
|
||||
|
||||
#include "ToolBar.h"
|
||||
#include "../Theme.h"
|
||||
#include "../Experimental.h"
|
||||
|
||||
class wxCommandEvent;
|
||||
class wxDC;
|
||||
class wxImage;
|
||||
class wxWindow;
|
||||
|
||||
class AButton;
|
||||
|
||||
enum {
|
||||
STBScrubID,
|
||||
STBSeekID,
|
||||
STBBarID,
|
||||
|
||||
STBNumButtons,
|
||||
STBFirstButton = STBScrubID
|
||||
};
|
||||
|
||||
class ScrubbingToolBar final : public ToolBar {
|
||||
|
||||
public:
|
||||
|
||||
ScrubbingToolBar();
|
||||
virtual ~ScrubbingToolBar();
|
||||
|
||||
void Create(wxWindow *parent);
|
||||
|
||||
void OnButton(wxCommandEvent & event);
|
||||
|
||||
void Populate();
|
||||
void Repaint(wxDC * WXUNUSED(dc)) {};
|
||||
void EnableDisableButtons() override;
|
||||
void UpdatePrefs() override;
|
||||
|
||||
void RegenerateTooltips() override;
|
||||
|
||||
private:
|
||||
|
||||
AButton *AddButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
|
||||
int id, const wxChar *label, bool toggle = false);
|
||||
|
||||
void MakeButtons();
|
||||
|
||||
AButton *mButtons[STBNumButtons];
|
||||
|
||||
wxImage *upImage;
|
||||
wxImage *downImage;
|
||||
wxImage *hiliteImage;
|
||||
|
||||
public:
|
||||
|
||||
DECLARE_CLASS(EditToolBar);
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
253
src/toolbars/ScrubbingToolBar.cpp
Normal file
253
src/toolbars/ScrubbingToolBar.cpp
Normal file
@ -0,0 +1,253 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
ScrubbingToolBar.cpp
|
||||
|
||||
Paul Licameli
|
||||
|
||||
See ScrubbingToolBar.h for details
|
||||
|
||||
*******************************************************************/
|
||||
|
||||
// Much of this is imitative of EditToolBar. Should there be a common base
|
||||
// class?
|
||||
#include "../Audacity.h"
|
||||
#include "ScrubbingToolBar.h"
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include <wx/wxprec.h>
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include <wx/event.h>
|
||||
#include <wx/image.h>
|
||||
#include <wx/intl.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/tooltip.h>
|
||||
#endif
|
||||
|
||||
#include "../AllThemeResources.h"
|
||||
#include "../AudioIO.h"
|
||||
#include "../ImageManipulation.h"
|
||||
#include "../Internat.h"
|
||||
#include "../Prefs.h"
|
||||
#include "../Project.h"
|
||||
#include "../Theme.h"
|
||||
#include "../Track.h"
|
||||
#include "../UndoManager.h"
|
||||
#include "../widgets/AButton.h"
|
||||
#include "../widgets/Ruler.h"
|
||||
#include "../tracks/ui/Scrubbing.h"
|
||||
|
||||
#include "../Experimental.h"
|
||||
|
||||
IMPLEMENT_CLASS(ScrubbingToolBar, ToolBar);
|
||||
|
||||
//const int BUTTON_WIDTH = 27;
|
||||
//const int SEPARATOR_WIDTH = 14;
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Methods for ScrubbingToolBar
|
||||
////////////////////////////////////////////////////////////
|
||||
|
||||
BEGIN_EVENT_TABLE( ScrubbingToolBar, ToolBar )
|
||||
EVT_COMMAND_RANGE( STBFirstButton,
|
||||
STBFirstButton + STBNumButtons - 1,
|
||||
wxEVT_COMMAND_BUTTON_CLICKED,
|
||||
ScrubbingToolBar::OnButton )
|
||||
END_EVENT_TABLE()
|
||||
|
||||
//Standard contructor
|
||||
ScrubbingToolBar::ScrubbingToolBar()
|
||||
: ToolBar(ScrubbingBarID, _("Scrub"), wxT("Scrub"))
|
||||
{
|
||||
}
|
||||
|
||||
ScrubbingToolBar::~ScrubbingToolBar()
|
||||
{
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::Create(wxWindow * parent)
|
||||
{
|
||||
ToolBar::Create(parent);
|
||||
}
|
||||
|
||||
/// This is a convenience function that allows for button creation in
|
||||
/// MakeButtons() with fewer arguments
|
||||
/// Very similar to code in ControlToolBar...
|
||||
AButton *ScrubbingToolBar::AddButton
|
||||
(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
|
||||
int id,
|
||||
const wxChar *label,
|
||||
bool toggle)
|
||||
{
|
||||
AButton *&r = mButtons[id];
|
||||
|
||||
r = ToolBar::MakeButton
|
||||
(this,
|
||||
bmpRecoloredUpSmall, bmpRecoloredDownSmall, bmpRecoloredHiliteSmall,
|
||||
eEnabledUp, eEnabledDown, eDisabled,
|
||||
wxWindowID(id),
|
||||
wxDefaultPosition,
|
||||
toggle,
|
||||
theTheme.ImageSize( bmpRecoloredUpSmall ));
|
||||
|
||||
r->SetLabel(label);
|
||||
// JKC: Unlike ControlToolBar, does not have a focus rect. Shouldn't it?
|
||||
// r->SetFocusRect( r->GetRect().Deflate( 4, 4 ) );
|
||||
|
||||
Add( r, 0, wxALIGN_CENTER );
|
||||
|
||||
return r;
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::Populate()
|
||||
{
|
||||
MakeButtonBackgroundsSmall();
|
||||
|
||||
/* Buttons */
|
||||
AddButton(bmpScrub, bmpScrub, bmpScrubDisabled, STBScrubID,
|
||||
_("Scrub"), true);
|
||||
AddButton(bmpSeek, bmpSeek, bmpSeekDisabled, STBSeekID,
|
||||
_("Seek"), true);
|
||||
AddButton(bmpToggleScrubBar, bmpToggleScrubBar, bmpToggleScrubBar,
|
||||
STBBarID,
|
||||
_("Scrub bar"), true);
|
||||
|
||||
|
||||
RegenerateTooltips();
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::UpdatePrefs()
|
||||
{
|
||||
RegenerateTooltips();
|
||||
|
||||
// Set label to pull in language change
|
||||
SetLabel(_("Scrubbing"));
|
||||
|
||||
// Give base class a chance
|
||||
ToolBar::UpdatePrefs();
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::RegenerateTooltips()
|
||||
{
|
||||
#if wxUSE_TOOLTIPS
|
||||
std::vector<wxString> commands;
|
||||
auto fn = [&]
|
||||
(AButton &button, const wxString &label, const wxString &command)
|
||||
{
|
||||
commands.clear();
|
||||
commands.push_back(label);
|
||||
commands.push_back(command);
|
||||
ToolBar::SetButtonToolTip(button, commands);
|
||||
};
|
||||
|
||||
auto project = GetActiveProject();
|
||||
if (project) {
|
||||
auto &scrubber = project->GetScrubber();
|
||||
|
||||
const auto scrubButton = mButtons[STBScrubID];
|
||||
const auto seekButton = mButtons[STBSeekID];
|
||||
|
||||
wxString label;
|
||||
label = (
|
||||
scrubber.Scrubs()
|
||||
/* i18n-hint: These commands assist the user in finding a sound by ear. ...
|
||||
"Scrubbing" is variable-speed playback, ...
|
||||
"Seeking" is normal speed playback but with skips
|
||||
*/
|
||||
? _("Stop Scrubbing")
|
||||
: _("Start Scrubbing")
|
||||
);
|
||||
fn(*scrubButton, label, wxT("Scrub"));
|
||||
|
||||
label = (
|
||||
scrubber.Seeks()
|
||||
/* i18n-hint: These commands assist the user in finding a sound by ear. ...
|
||||
"Scrubbing" is variable-speed playback, ...
|
||||
"Seeking" is normal speed playback but with skips
|
||||
*/
|
||||
? _("Stop Seeking")
|
||||
: _("Start Seeking")
|
||||
);
|
||||
fn(*seekButton, label, wxT("Seek"));
|
||||
|
||||
label = (
|
||||
project->GetRulerPanel()->ShowingScrubBar()
|
||||
? _("Hide Scrub Bar")
|
||||
: _("Show Scrub Bar")
|
||||
);
|
||||
fn(*mButtons[STBBarID], label, wxT("ToggleScrubBar"));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::OnButton(wxCommandEvent &event)
|
||||
{
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (!p) return;
|
||||
auto &scrubber = p->GetScrubber();
|
||||
|
||||
int id = event.GetId();
|
||||
|
||||
switch (id) {
|
||||
case STBScrubID:
|
||||
scrubber.OnScrub(event);
|
||||
break;
|
||||
case STBSeekID:
|
||||
scrubber.OnSeek(event);
|
||||
break;
|
||||
case STBBarID:
|
||||
scrubber.OnToggleScrubBar(event);
|
||||
break;
|
||||
default:
|
||||
wxASSERT(false);
|
||||
}
|
||||
|
||||
EnableDisableButtons();
|
||||
}
|
||||
|
||||
void ScrubbingToolBar::EnableDisableButtons()
|
||||
{
|
||||
const auto scrubButton = mButtons[STBScrubID];
|
||||
scrubButton->SetEnabled(true);
|
||||
const auto seekButton = mButtons[STBSeekID];
|
||||
seekButton->SetEnabled(true);
|
||||
|
||||
AudacityProject *p = GetActiveProject();
|
||||
if (!p) return;
|
||||
|
||||
auto &scrubber = p->GetScrubber();
|
||||
const auto canScrub = scrubber.CanScrub();
|
||||
|
||||
if (scrubber.Scrubs()) {
|
||||
scrubButton->PushDown();
|
||||
scrubButton->Enable();
|
||||
}
|
||||
else {
|
||||
scrubButton->PopUp();
|
||||
if (canScrub)
|
||||
scrubButton->Enable();
|
||||
else
|
||||
scrubButton->Disable();
|
||||
}
|
||||
|
||||
if (scrubber.Seeks()) {
|
||||
seekButton->PushDown();
|
||||
seekButton->Enable();
|
||||
}
|
||||
else {
|
||||
seekButton->PopUp();
|
||||
if (canScrub)
|
||||
seekButton->Enable();
|
||||
else
|
||||
seekButton->Disable();
|
||||
}
|
||||
|
||||
const auto barButton = mButtons[STBBarID];
|
||||
barButton->Enable();
|
||||
if (p->GetRulerPanel()->ShowingScrubBar())
|
||||
barButton->PushDown();
|
||||
else
|
||||
barButton->PopUp();
|
||||
}
|
76
src/toolbars/ScrubbingToolBar.h
Normal file
76
src/toolbars/ScrubbingToolBar.h
Normal file
@ -0,0 +1,76 @@
|
||||
/**********************************************************************
|
||||
|
||||
Audacity: A Digital Audio Editor
|
||||
|
||||
|
||||
ScrubbingToolbar.h
|
||||
|
||||
Paul Licameli
|
||||
|
||||
**********************************************************************/
|
||||
|
||||
#ifndef __AUDACITY_SCRUBBING_TOOLBAR__
|
||||
#define __AUDACITY_SCRUBBING_TOOLBAR__
|
||||
|
||||
|
||||
|
||||
#include <wx/defs.h>
|
||||
|
||||
#include "ToolBar.h"
|
||||
#include "../Theme.h"
|
||||
#include "../Experimental.h"
|
||||
|
||||
class wxCommandEvent;
|
||||
class wxDC;
|
||||
class wxImage;
|
||||
class wxWindow;
|
||||
|
||||
class AButton;
|
||||
|
||||
enum {
|
||||
STBScrubID,
|
||||
STBSeekID,
|
||||
STBBarID,
|
||||
|
||||
STBNumButtons,
|
||||
STBFirstButton = STBScrubID
|
||||
};
|
||||
|
||||
class ScrubbingToolBar final : public ToolBar {
|
||||
|
||||
public:
|
||||
|
||||
ScrubbingToolBar();
|
||||
virtual ~ScrubbingToolBar();
|
||||
|
||||
void Create(wxWindow *parent);
|
||||
|
||||
void OnButton(wxCommandEvent & event);
|
||||
|
||||
void Populate();
|
||||
void Repaint(wxDC * WXUNUSED(dc)) {};
|
||||
void EnableDisableButtons() override;
|
||||
void UpdatePrefs() override;
|
||||
|
||||
void RegenerateTooltips() override;
|
||||
|
||||
private:
|
||||
|
||||
AButton *AddButton(teBmps eEnabledUp, teBmps eEnabledDown, teBmps eDisabled,
|
||||
int id, const wxChar *label, bool toggle = false);
|
||||
|
||||
void MakeButtons();
|
||||
|
||||
AButton *mButtons[STBNumButtons];
|
||||
|
||||
wxImage *upImage;
|
||||
wxImage *downImage;
|
||||
wxImage *hiliteImage;
|
||||
|
||||
public:
|
||||
|
||||
DECLARE_CLASS(EditToolBar);
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
#endif
|
@ -267,7 +267,7 @@ void ToolBarResizer::OnKeyDown(wxKeyEvent &event)
|
||||
//
|
||||
// Define class to RTTI
|
||||
//
|
||||
IMPLEMENT_CLASS( ToolBar, wxPanel );
|
||||
IMPLEMENT_CLASS( ToolBar, wxPanelWrapper );
|
||||
|
||||
//
|
||||
// Custom event
|
||||
@ -277,7 +277,7 @@ DEFINE_EVENT_TYPE(EVT_TOOLBAR_UPDATED)
|
||||
//
|
||||
// Event table
|
||||
//
|
||||
BEGIN_EVENT_TABLE( ToolBar, wxPanel )
|
||||
BEGIN_EVENT_TABLE( ToolBar, wxPanelWrapper )
|
||||
EVT_PAINT( ToolBar::OnPaint )
|
||||
EVT_ERASE_BACKGROUND( ToolBar::OnErase )
|
||||
EVT_MOUSE_EVENTS( ToolBar::OnMouseEvents )
|
||||
@ -290,7 +290,7 @@ ToolBar::ToolBar( int type,
|
||||
const wxString &label,
|
||||
const wxString §ion,
|
||||
bool resizable )
|
||||
: wxPanel()
|
||||
: wxPanelWrapper()
|
||||
{
|
||||
// Save parameters
|
||||
mType = type;
|
||||
@ -425,13 +425,13 @@ void ToolBar::Create( wxWindow *parent )
|
||||
mParent = parent;
|
||||
|
||||
// Create the window and label it
|
||||
wxPanel::Create( mParent,
|
||||
wxPanelWrapper::Create( mParent,
|
||||
mType,
|
||||
wxDefaultPosition,
|
||||
wxDefaultSize,
|
||||
wxNO_BORDER | wxTAB_TRAVERSAL,
|
||||
GetTitle() );
|
||||
wxPanel::SetLabel( GetLabel() );
|
||||
wxPanelWrapper::SetLabel( GetLabel() );
|
||||
|
||||
// Go do the rest of the creation
|
||||
ReCreateButtons();
|
||||
|
@ -17,10 +17,10 @@
|
||||
|
||||
#include <vector>
|
||||
#include <wx/defs.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/sizer.h>
|
||||
|
||||
#include "../Theme.h"
|
||||
#include "../widgets/wxPanelWrapper.h"
|
||||
|
||||
class wxDC;
|
||||
class wxEraseEvent;
|
||||
@ -84,7 +84,7 @@ enum
|
||||
// How may pixels padding each side of a floating toolbar
|
||||
enum { ToolBarFloatMargin = 1 };
|
||||
|
||||
class ToolBar /* not final */ : public wxPanel
|
||||
class ToolBar /* not final */ : public wxPanelWrapper
|
||||
{
|
||||
|
||||
public:
|
||||
|
@ -325,7 +325,7 @@ void ToolBarConfiguration::Write
|
||||
gPrefs->Write( wxT("Show"), bar->IsVisible() );
|
||||
}
|
||||
|
||||
IMPLEMENT_CLASS( ToolDock, wxPanel );
|
||||
IMPLEMENT_CLASS( ToolDock, wxPanelWrapper );
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Methods for ToolDock
|
||||
@ -336,7 +336,7 @@ IMPLEMENT_CLASS( ToolDock, wxPanel );
|
||||
//
|
||||
DEFINE_EVENT_TYPE( EVT_TOOLBAR_FLOAT );
|
||||
|
||||
BEGIN_EVENT_TABLE( ToolDock, wxPanel )
|
||||
BEGIN_EVENT_TABLE( ToolDock, wxPanelWrapper )
|
||||
EVT_GRABBER( wxID_ANY, ToolDock::OnGrabber )
|
||||
EVT_ERASE_BACKGROUND( ToolDock::OnErase )
|
||||
EVT_PAINT( ToolDock::OnPaint )
|
||||
@ -348,7 +348,7 @@ END_EVENT_TABLE()
|
||||
// Constructor
|
||||
//
|
||||
ToolDock::ToolDock( ToolManager *manager, wxWindow *parent, int dockid ):
|
||||
wxPanel( parent, dockid, wxDefaultPosition, parent->GetSize() )
|
||||
wxPanelWrapper( parent, dockid, wxDefaultPosition, parent->GetSize() )
|
||||
{
|
||||
SetLabel( _( "ToolDock" ) );
|
||||
SetName( _( "ToolDock" ) );
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <vector>
|
||||
#include "../MemoryX.h" // for std::move
|
||||
#include <wx/defs.h>
|
||||
#include <wx/panel.h>
|
||||
|
||||
#include "ToolBar.h"
|
||||
|
||||
@ -282,7 +281,7 @@ private:
|
||||
Forest mForest;
|
||||
};
|
||||
|
||||
class ToolDock final : public wxPanel
|
||||
class ToolDock final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
|
||||
|
@ -53,6 +53,7 @@
|
||||
#include "EditToolBar.h"
|
||||
#include "MeterToolBar.h"
|
||||
#include "MixerToolBar.h"
|
||||
#include "ScrubbingToolBar.h"
|
||||
#include "SelectionBar.h"
|
||||
#include "SpectralSelectionBar.h"
|
||||
#include "ToolsToolBar.h"
|
||||
@ -351,7 +352,7 @@ END_EVENT_TABLE()
|
||||
//
|
||||
// Constructor
|
||||
//
|
||||
ToolManager::ToolManager( AudacityProject *parent )
|
||||
ToolManager::ToolManager( AudacityProject *parent, wxWindow *topDockParent )
|
||||
: wxEvtHandler()
|
||||
{
|
||||
wxPoint pt[ 3 ];
|
||||
@ -434,7 +435,7 @@ ToolManager::ToolManager( AudacityProject *parent )
|
||||
this );
|
||||
|
||||
// Create the top and bottom docks
|
||||
mTopDock = safenew ToolDock( this, mParent, TopDockID );
|
||||
mTopDock = safenew ToolDock( this, topDockParent, TopDockID );
|
||||
mBotDock = safenew ToolDock( this, mParent, BotDockID );
|
||||
|
||||
// Create all of the toolbars
|
||||
@ -836,10 +837,51 @@ void ToolManager::ReadConfig()
|
||||
d->LoadConfig();
|
||||
|
||||
// Add all unordered toolbars
|
||||
bool deviceWasPositioned = false;
|
||||
for( int ord = 0; ord < (int) unordered[ dock ].GetCount(); ord++ )
|
||||
{
|
||||
ToolBar *t = mBars[ unordered[ dock ][ ord ] ];
|
||||
|
||||
if (deviceWasPositioned &&
|
||||
t->GetType() == DeviceBarID)
|
||||
continue;
|
||||
|
||||
if (someFound &&
|
||||
t->GetType() == ScrubbingBarID) {
|
||||
// Special case code to put the NEW scrubbing toolbar where we
|
||||
// want it, when audacity.cfg is present from an older version
|
||||
ToolBar *lastRoot {};
|
||||
|
||||
// Change from the ideal configuration to the constrained one,
|
||||
// just as when dragging and dropping
|
||||
ToolBarConfiguration dummy;
|
||||
mTopDock->WrapConfiguration(dummy);
|
||||
|
||||
// Start a NEW row with just the scrubbing toolbar
|
||||
auto &configuration = mTopDock->GetConfiguration();
|
||||
for (const auto place : configuration)
|
||||
if (place.position.rightOf == nullptr)
|
||||
lastRoot = place.pTree->pBar;
|
||||
ToolBarConfiguration::Position position {
|
||||
nullptr, lastRoot, false
|
||||
};
|
||||
mTopDock->Dock(t, false, position);
|
||||
|
||||
// Reposition the device toolbar, if it was docked above,
|
||||
// right of scrubbing
|
||||
const auto deviceToolBar = mBars[ DeviceBarID ];
|
||||
if (deviceToolBar->GetDock() == mTopDock) {
|
||||
deviceToolBar->GetDock()->Undock(deviceToolBar);
|
||||
position = { t, nullptr };
|
||||
mTopDock->Dock(deviceToolBar, false, position);
|
||||
|
||||
// Remember not to place the device toolbar again
|
||||
deviceWasPositioned = true;
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
// Dock it
|
||||
d->Dock( t, false );
|
||||
|
||||
|
@ -45,7 +45,7 @@ class ToolManager final : public wxEvtHandler
|
||||
|
||||
public:
|
||||
|
||||
ToolManager( AudacityProject *parent );
|
||||
ToolManager( AudacityProject *parent, wxWindow *topDockParent );
|
||||
~ToolManager();
|
||||
|
||||
void LayoutToolBars();
|
||||
|
@ -21,7 +21,7 @@ Paul Licameli split from TrackPanel.cpp
|
||||
#include "../../commands/CommandFunctors.h"
|
||||
#include "../../prefs/PlaybackPrefs.h"
|
||||
#include "../../toolbars/ControlToolBar.h"
|
||||
#include "../../toolbars/EditToolBar.h"
|
||||
#include "../../toolbars/ScrubbingToolBar.h"
|
||||
#include "../../toolbars/ToolManager.h"
|
||||
|
||||
#undef USE_TRANSCRIPTION_TOOLBAR
|
||||
|
@ -242,6 +242,15 @@ void AButton::UseDisabledAsDownHiliteImage(bool flag)
|
||||
mUseDisabledAsDownHiliteImage = flag;
|
||||
}
|
||||
|
||||
// This compensates for a but in wxWidgets 3.0.2 for mac:
|
||||
// Couldn't set focus from keyboard when AcceptsFocus returns false;
|
||||
// this bypasses that limitation
|
||||
void AButton::SetFocusFromKbd()
|
||||
{
|
||||
auto temp = TemporarilyAllowFocus();
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
void AButton::SetAlternateImages(unsigned idx,
|
||||
wxImage up,
|
||||
wxImage over,
|
||||
@ -343,12 +352,10 @@ void AButton::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||
|
||||
mImages[mAlternateIdx].mArr[buttonState].Draw(dc, GetClientRect());
|
||||
|
||||
#if defined(__WXMSW__) || defined(__WXGTK__)
|
||||
if( mButtonIsFocused )
|
||||
{
|
||||
AColor::DrawFocus( dc, mFocusRect );
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void AButton::OnErase(wxEraseEvent & WXUNUSED(event))
|
||||
@ -567,6 +574,11 @@ void AButton::SetControl(bool control)
|
||||
mWasControlDown = control;
|
||||
}
|
||||
|
||||
auto AButton::TemporarilyAllowFocus() -> TempAllowFocus {
|
||||
s_AcceptsFocus = true;
|
||||
return std::move(TempAllowFocus{ &s_AcceptsFocus });
|
||||
}
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
|
||||
AButtonAx::AButtonAx( wxWindow *window ):
|
||||
|
@ -59,6 +59,8 @@ class AButton final : public wxWindow {
|
||||
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||
bool AcceptsFocusFromKeyboard() const override { return true; }
|
||||
|
||||
void SetFocusFromKbd() override;
|
||||
|
||||
// Associate a set of four images (button up, highlight, button down,
|
||||
// disabled) with one nondefault state of the button
|
||||
void SetAlternateImages(unsigned idx,
|
||||
@ -142,10 +144,7 @@ class AButton final : public wxWindow {
|
||||
using TempAllowFocus = std::unique_ptr<bool, Resetter>;
|
||||
|
||||
public:
|
||||
static TempAllowFocus TemporarilyAllowFocus() {
|
||||
s_AcceptsFocus = true;
|
||||
return std::move(TempAllowFocus{ &s_AcceptsFocus });
|
||||
}
|
||||
static TempAllowFocus TemporarilyAllowFocus();
|
||||
|
||||
private:
|
||||
|
||||
|
@ -1783,6 +1783,22 @@ bool ASlider::IsEnabled() const
|
||||
return mLWSlider->GetEnabled();
|
||||
}
|
||||
|
||||
bool ASlider::s_AcceptsFocus{ false };
|
||||
|
||||
auto ASlider::TemporarilyAllowFocus() -> TempAllowFocus {
|
||||
s_AcceptsFocus = true;
|
||||
return std::move(TempAllowFocus{ &s_AcceptsFocus });
|
||||
}
|
||||
|
||||
// This compensates for a but in wxWidgets 3.0.2 for mac:
|
||||
// Couldn't set focus from keyboard when AcceptsFocus returns false;
|
||||
// this bypasses that limitation
|
||||
void ASlider::SetFocusFromKbd()
|
||||
{
|
||||
auto temp = TemporarilyAllowFocus();
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
|
||||
ASliderAx::ASliderAx( wxWindow * window ) :
|
||||
|
@ -15,6 +15,7 @@
|
||||
|
||||
#include "../Experimental.h"
|
||||
|
||||
#include "../MemoryX.h"
|
||||
#include <wx/defs.h>
|
||||
#include <wx/window.h>
|
||||
#include <wx/dialog.h>
|
||||
@ -264,7 +265,10 @@ class ASlider /* not final */ : public wxPanel
|
||||
int orientation = wxHORIZONTAL);
|
||||
virtual ~ASlider();
|
||||
|
||||
bool AcceptsFocus() const override { return false; }
|
||||
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||
bool AcceptsFocusFromKeyboard() const override { return true; }
|
||||
|
||||
void SetFocusFromKbd() override;
|
||||
|
||||
void GetScroll(float & line, float & page);
|
||||
void SetScroll(float line, float page);
|
||||
@ -298,6 +302,14 @@ class ASlider /* not final */ : public wxPanel
|
||||
bool Enable(bool enable = true);
|
||||
bool IsEnabled() const;
|
||||
|
||||
private:
|
||||
static bool s_AcceptsFocus;
|
||||
struct Resetter { void operator () (bool *p) const { if(p) *p = false; } };
|
||||
using TempAllowFocus = std::unique_ptr<bool, Resetter>;
|
||||
|
||||
public:
|
||||
static TempAllowFocus TemporarilyAllowFocus();
|
||||
|
||||
private:
|
||||
LWSlider *mLWSlider;
|
||||
bool mSliderIsFocused;
|
||||
|
@ -13,7 +13,7 @@ BackedPanel::BackedPanel(wxWindow * parent, wxWindowID id,
|
||||
const wxPoint & pos,
|
||||
const wxSize & size,
|
||||
long style)
|
||||
: wxPanel(parent, id, pos, size, style)
|
||||
: wxPanelWrapper(parent, id, pos, size, style)
|
||||
, mBacking{ safenew wxBitmap(1, 1) }
|
||||
{
|
||||
// Preinit the backing DC and bitmap so routines that require it will
|
||||
@ -77,7 +77,7 @@ void BackedPanel::OnSize(wxSizeEvent & /* event */)
|
||||
Refresh();
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(BackedPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(BackedPanel, wxPanelWrapper)
|
||||
EVT_SIZE(BackedPanel::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
@ -10,10 +10,10 @@
|
||||
#define __AUDACITY_BACKED_PANEL__
|
||||
|
||||
#include "../MemoryX.h"
|
||||
#include <wx/panel.h>
|
||||
#include <wx/dcmemory.h>
|
||||
#include "wxPanelWrapper.h"
|
||||
|
||||
class AUDACITY_DLL_API BackedPanel /* not final */ : public wxPanel {
|
||||
class AUDACITY_DLL_API BackedPanel /* not final */ : public wxPanelWrapper {
|
||||
public:
|
||||
BackedPanel(wxWindow * parent, wxWindowID id,
|
||||
const wxPoint & pos,
|
||||
|
@ -107,13 +107,13 @@ public:
|
||||
// ExpandingToolBar
|
||||
//
|
||||
|
||||
BEGIN_EVENT_TABLE(ExpandingToolBar, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ExpandingToolBar, wxPanelWrapper)
|
||||
EVT_SIZE(ExpandingToolBar::OnSize)
|
||||
EVT_TIMER(kTimerID, ExpandingToolBar::OnTimer)
|
||||
EVT_BUTTON(kToggleButtonID, ExpandingToolBar::OnToggle)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(ExpandingToolBar, wxPanel)
|
||||
IMPLEMENT_CLASS(ExpandingToolBar, wxPanelWrapper)
|
||||
|
||||
//static
|
||||
int ExpandingToolBar::msNoAutoExpandStack = 0;
|
||||
@ -122,7 +122,7 @@ ExpandingToolBar::ExpandingToolBar(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size):
|
||||
wxPanel(parent, id, pos, size),
|
||||
wxPanelWrapper(parent, id, pos, size),
|
||||
mIsAutoExpanded(false),
|
||||
mIsManualExpanded(false),
|
||||
mIsExpanded(false),
|
||||
@ -135,9 +135,9 @@ ExpandingToolBar::ExpandingToolBar(wxWindow* parent,
|
||||
mDragImage(NULL),
|
||||
mTopLevelParent(NULL)
|
||||
{
|
||||
mMainPanel = safenew wxPanel(this, -1,
|
||||
mMainPanel = safenew wxPanelWrapper(this, -1,
|
||||
wxDefaultPosition, wxSize(1, 1));
|
||||
mExtraPanel = safenew wxPanel(this, -1,
|
||||
mExtraPanel = safenew wxPanelWrapper(this, -1,
|
||||
wxDefaultPosition, wxSize(1, 1));
|
||||
|
||||
mGrabber = NULL;
|
||||
@ -655,20 +655,20 @@ void ExpandingToolBar::FinishMoving()
|
||||
// ToolBarGrabber
|
||||
//
|
||||
|
||||
BEGIN_EVENT_TABLE(ToolBarGrabber, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ToolBarGrabber, wxPanelWrapper)
|
||||
EVT_PAINT(ToolBarGrabber::OnPaint)
|
||||
EVT_SIZE(ToolBarGrabber::OnSize)
|
||||
EVT_MOUSE_EVENTS(ToolBarGrabber::OnMouse)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(ToolBarGrabber, wxPanel)
|
||||
IMPLEMENT_CLASS(ToolBarGrabber, wxPanelWrapper)
|
||||
|
||||
ToolBarGrabber::ToolBarGrabber(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
ExpandingToolBar *ownerToolbar,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size):
|
||||
wxPanel(parent, id, pos, size),
|
||||
wxPanelWrapper(parent, id, pos, size),
|
||||
mOwnerToolBar(ownerToolbar)
|
||||
{
|
||||
wxImage grabberImages = theTheme.Image(bmpToolBarGrabber);
|
||||
@ -835,18 +835,18 @@ void ToolBarFrame::Fit()
|
||||
// ToolBarArea
|
||||
//
|
||||
|
||||
BEGIN_EVENT_TABLE(ToolBarArea, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ToolBarArea, wxPanelWrapper)
|
||||
EVT_SIZE(ToolBarArea::OnSize)
|
||||
EVT_MOUSE_EVENTS(ToolBarArea::OnMouse)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(ToolBarArea, wxPanel)
|
||||
IMPLEMENT_CLASS(ToolBarArea, wxPanelWrapper)
|
||||
|
||||
ToolBarArea::ToolBarArea(wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size):
|
||||
wxPanel(parent, id, pos, size),
|
||||
wxPanelWrapper(parent, id, pos, size),
|
||||
mInOnSize(false),
|
||||
mCapturedChild(NULL)
|
||||
{
|
||||
|
@ -20,6 +20,7 @@
|
||||
#include <wx/minifram.h>
|
||||
|
||||
#include "ImageRoll.h"
|
||||
#include "wxPanelWrapper.h"
|
||||
|
||||
class wxDragImage;
|
||||
|
||||
@ -43,7 +44,7 @@ WX_DECLARE_OBJARRAY(wxRect, wxArrayRect);
|
||||
// Can be docked into a ToolBarArea or floated in an ToolBarFrame;
|
||||
//
|
||||
|
||||
class ExpandingToolBar final : public wxPanel
|
||||
class ExpandingToolBar final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
DECLARE_DYNAMIC_CLASS(ExpandingToolBar)
|
||||
@ -121,7 +122,7 @@ class ExpandingToolBar final : public wxPanel
|
||||
friend class ExpandingToolBarEvtHandler;
|
||||
};
|
||||
|
||||
class ToolBarGrabber final : public wxPanel
|
||||
class ToolBarGrabber final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
DECLARE_DYNAMIC_CLASS(ToolBarGrabber);
|
||||
@ -193,7 +194,7 @@ class ToolBarFrame final : public wxMiniFrame
|
||||
// ToolBarArea sets the height dynamically based on the number of
|
||||
// toolbars it contains.
|
||||
//
|
||||
class ToolBarArea final : public wxPanel
|
||||
class ToolBarArea final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
DECLARE_DYNAMIC_CLASS(ToolBarArea)
|
||||
|
@ -94,6 +94,7 @@
|
||||
|
||||
*//*******************************************************************/
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "ImageRoll.h"
|
||||
|
||||
#include <wx/wx.h>
|
||||
@ -414,12 +415,12 @@ void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logic
|
||||
} // switch
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(ImageRollPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(ImageRollPanel, wxPanelWrapper)
|
||||
EVT_PAINT(ImageRollPanel::OnPaint)
|
||||
EVT_SIZE(ImageRollPanel::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(ImageRollPanel, wxPanel)
|
||||
IMPLEMENT_CLASS(ImageRollPanel, wxPanelWrapper)
|
||||
|
||||
ImageRollPanel::ImageRollPanel(wxWindow *parent,
|
||||
wxWindowID id,
|
||||
@ -427,7 +428,7 @@ ImageRollPanel::ImageRollPanel(wxWindow *parent,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
long style):
|
||||
wxPanel(parent, id, pos, size, style),
|
||||
wxPanelWrapper(parent, id, pos, size, style),
|
||||
mImageRoll(imgRoll),
|
||||
mLogicalFunction(wxCOPY)
|
||||
{
|
||||
|
@ -16,8 +16,8 @@
|
||||
#include <wx/dcclient.h>
|
||||
#include <wx/defs.h>
|
||||
#include <wx/dynarray.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/version.h>
|
||||
#include "wxPanelWrapper.h"
|
||||
|
||||
#if !wxCHECK_VERSION(3,0,0)
|
||||
#define wxRasterOperationMode int
|
||||
@ -67,7 +67,7 @@ class ImageRoll
|
||||
|
||||
// A very simple class that just display an ImageRoll that doesn't
|
||||
// do anything
|
||||
class ImageRollPanel final : public wxPanel
|
||||
class ImageRollPanel final : public wxPanelWrapper
|
||||
{
|
||||
public:
|
||||
DECLARE_DYNAMIC_CLASS(ImageRollPanel);
|
||||
|
@ -192,7 +192,7 @@ enum {
|
||||
OnPreferencesID
|
||||
};
|
||||
|
||||
BEGIN_EVENT_TABLE(Meter, wxPanel)
|
||||
BEGIN_EVENT_TABLE(Meter, wxPanelWrapper)
|
||||
EVT_TIMER(OnMeterUpdateID, Meter::OnMeterUpdate)
|
||||
EVT_MOUSE_EVENTS(Meter::OnMouse)
|
||||
EVT_CONTEXT_MENU(Meter::OnContext)
|
||||
@ -207,7 +207,7 @@ BEGIN_EVENT_TABLE(Meter, wxPanel)
|
||||
EVT_MENU(OnPreferencesID, Meter::OnPreferences)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(Meter, wxPanel)
|
||||
IMPLEMENT_CLASS(Meter, wxPanelWrapper)
|
||||
|
||||
Meter::Meter(AudacityProject *project,
|
||||
wxWindow* parent, wxWindowID id,
|
||||
@ -216,7 +216,7 @@ Meter::Meter(AudacityProject *project,
|
||||
const wxSize& size /*= wxDefaultSize*/,
|
||||
Style style /*= HorizontalStereo*/,
|
||||
float fDecayRate /*= 60.0f*/)
|
||||
: wxPanel(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER | wxWANTS_CHARS),
|
||||
: wxPanelWrapper(parent, id, pos, size, wxTAB_TRAVERSAL | wxNO_BORDER | wxWANTS_CHARS),
|
||||
mProject(project),
|
||||
mQueue(1024),
|
||||
mWidth(size.x),
|
||||
@ -672,13 +672,11 @@ void Meter::OnPaint(wxPaintEvent & WXUNUSED(event))
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(__WXMSW__) || defined(__WXGTK__)
|
||||
if (mIsFocused)
|
||||
{
|
||||
wxRect r = mIconRect;
|
||||
AColor::DrawFocus(destDC, r.Inflate(1, 1));
|
||||
}
|
||||
#endif
|
||||
|
||||
delete paintDC;
|
||||
}
|
||||
@ -2098,6 +2096,23 @@ wxString Meter::Key(const wxString & key) const
|
||||
return wxT("/Meter/Output/") + key;
|
||||
}
|
||||
|
||||
bool Meter::s_AcceptsFocus{ false };
|
||||
|
||||
auto Meter::TemporarilyAllowFocus() -> TempAllowFocus {
|
||||
s_AcceptsFocus = true;
|
||||
return std::move(TempAllowFocus{ &s_AcceptsFocus });
|
||||
}
|
||||
|
||||
// This compensates for a but in wxWidgets 3.0.2 for mac:
|
||||
// Couldn't set focus from keyboard when AcceptsFocus returns false;
|
||||
// this bypasses that limitation
|
||||
void Meter::SetFocusFromKbd()
|
||||
{
|
||||
auto temp = TemporarilyAllowFocus();
|
||||
SetFocus();
|
||||
}
|
||||
|
||||
|
||||
#if wxUSE_ACCESSIBILITY
|
||||
|
||||
MeterAx::MeterAx(wxWindow *window):
|
||||
|
@ -17,7 +17,6 @@
|
||||
#define __AUDACITY_METER__
|
||||
|
||||
#include <wx/defs.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/timer.h>
|
||||
|
||||
#include "../SampleFormat.h"
|
||||
@ -86,7 +85,7 @@ class MeterUpdateQueue
|
||||
|
||||
class MeterAx;
|
||||
|
||||
class Meter final : public wxPanel
|
||||
class Meter final : public wxPanelWrapper
|
||||
{
|
||||
DECLARE_DYNAMIC_CLASS(Meter)
|
||||
|
||||
@ -113,8 +112,10 @@ class Meter final : public wxPanel
|
||||
|
||||
~Meter();
|
||||
|
||||
bool AcceptsFocus() const override { return false; };
|
||||
bool AcceptsFocusFromKeyboard() const override { return true; };
|
||||
bool AcceptsFocus() const override { return s_AcceptsFocus; }
|
||||
bool AcceptsFocusFromKeyboard() const override { return true; }
|
||||
|
||||
void SetFocusFromKbd() override;
|
||||
|
||||
void UpdatePrefs();
|
||||
void Clear();
|
||||
@ -179,6 +180,14 @@ class Meter final : public wxPanel
|
||||
void *SaveState();
|
||||
void RestoreState(void *state);
|
||||
|
||||
private:
|
||||
static bool s_AcceptsFocus;
|
||||
struct Resetter { void operator () (bool *p) const { if(p) *p = false; } };
|
||||
using TempAllowFocus = std::unique_ptr<bool, Resetter>;
|
||||
|
||||
public:
|
||||
static TempAllowFocus TemporarilyAllowFocus();
|
||||
|
||||
private:
|
||||
//
|
||||
// Event handlers
|
||||
|
@ -1604,18 +1604,18 @@ void Ruler::SetUseZoomInfo(int leftOffset, const ZoomInfo *zoomInfo)
|
||||
// RulerPanel
|
||||
//
|
||||
|
||||
BEGIN_EVENT_TABLE(RulerPanel, wxPanel)
|
||||
BEGIN_EVENT_TABLE(RulerPanel, wxPanelWrapper)
|
||||
EVT_ERASE_BACKGROUND(RulerPanel::OnErase)
|
||||
EVT_PAINT(RulerPanel::OnPaint)
|
||||
EVT_SIZE(RulerPanel::OnSize)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
IMPLEMENT_CLASS(RulerPanel, wxPanel)
|
||||
IMPLEMENT_CLASS(RulerPanel, wxPanelWrapper)
|
||||
|
||||
RulerPanel::RulerPanel(wxWindow* parent, wxWindowID id,
|
||||
const wxPoint& pos /*= wxDefaultPosition*/,
|
||||
const wxSize& size /*= wxDefaultSize*/):
|
||||
wxPanel(parent, id, pos, size)
|
||||
wxPanelWrapper(parent, id, pos, size)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1652,7 +1652,7 @@ void RulerPanel::DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags)
|
||||
{
|
||||
wxPanel::DoSetSize(x, y, width, height, sizeFlags);
|
||||
wxPanelWrapper::DoSetSize(x, y, width, height, sizeFlags);
|
||||
|
||||
int w, h;
|
||||
GetClientSize(&w, &h);
|
||||
@ -1954,13 +1954,14 @@ BEGIN_EVENT_TABLE(AdornedRulerPanel, OverlayPanel)
|
||||
|
||||
END_EVENT_TABLE()
|
||||
|
||||
AdornedRulerPanel::AdornedRulerPanel(AudacityProject* parent,
|
||||
AdornedRulerPanel::AdornedRulerPanel(AudacityProject* project,
|
||||
wxWindow *parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos,
|
||||
const wxSize& size,
|
||||
ViewInfo *viewinfo)
|
||||
: OverlayPanel(parent, id, pos, size)
|
||||
, mProject(parent)
|
||||
, mProject(project)
|
||||
, mViewInfo(viewinfo)
|
||||
{
|
||||
for (auto &button : mButtons)
|
||||
@ -1992,7 +1993,7 @@ AdornedRulerPanel::AdornedRulerPanel(AudacityProject* parent,
|
||||
mRuler.SetLabelEdges( false );
|
||||
mRuler.SetFormat( Ruler::TimeFormat );
|
||||
|
||||
mTracks = parent->GetTracks();
|
||||
mTracks = project->GetTracks();
|
||||
|
||||
mSnapManager = NULL;
|
||||
mIsSnapped = false;
|
||||
|
@ -243,7 +243,7 @@ private:
|
||||
NumberScale *mpNumberScale;
|
||||
};
|
||||
|
||||
class AUDACITY_DLL_API RulerPanel final : public wxPanel {
|
||||
class AUDACITY_DLL_API RulerPanel final : public wxPanelWrapper {
|
||||
DECLARE_DYNAMIC_CLASS(RulerPanel)
|
||||
|
||||
public:
|
||||
@ -285,7 +285,8 @@ class QuickPlayRulerOverlay;
|
||||
class AUDACITY_DLL_API AdornedRulerPanel final : public OverlayPanel
|
||||
{
|
||||
public:
|
||||
AdornedRulerPanel(AudacityProject* parent,
|
||||
AdornedRulerPanel(AudacityProject *project,
|
||||
wxWindow* parent,
|
||||
wxWindowID id,
|
||||
const wxPoint& pos = wxDefaultPosition,
|
||||
const wxSize& size = wxDefaultSize,
|
||||
|
46
src/widgets/wxPanelWrapper.cpp
Normal file
46
src/widgets/wxPanelWrapper.cpp
Normal file
@ -0,0 +1,46 @@
|
||||
//
|
||||
// wxPanelWrapper.cpp
|
||||
// Audacity
|
||||
//
|
||||
// Created by Paul Licameli on 6/25/16.
|
||||
//
|
||||
//
|
||||
|
||||
#include "../Audacity.h"
|
||||
#include "wxPanelWrapper.h"
|
||||
|
||||
IMPLEMENT_CLASS(wxPanelWrapper, wxPanel)
|
||||
|
||||
wxPanelWrapper::wxPanelWrapper(wxWindow * parent, wxWindowID id,
|
||||
const wxPoint & pos,
|
||||
const wxSize & size,
|
||||
long style)
|
||||
: wxPanel(parent, id, pos, size, style)
|
||||
{}
|
||||
|
||||
void wxPanelWrapper::DoCharHook(wxKeyEvent &event)
|
||||
{
|
||||
#ifdef __WXMAC__
|
||||
// Compensate for the regressions in TAB key navigation
|
||||
// due to the switch to wxWidgets 3.0.2
|
||||
if (event.GetKeyCode() == WXK_TAB) {
|
||||
wxWindow::FindFocus()->Navigate(
|
||||
event.ShiftDown()
|
||||
? wxNavigationKeyEvent::IsBackward
|
||||
: wxNavigationKeyEvent::IsForward
|
||||
);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
event.Skip();
|
||||
}
|
||||
|
||||
void wxPanelWrapper::OnCharHook(wxKeyEvent &event)
|
||||
{
|
||||
DoCharHook(event);
|
||||
}
|
||||
|
||||
BEGIN_EVENT_TABLE(wxPanelWrapper, wxPanel)
|
||||
EVT_CHAR_HOOK(wxPanelWrapper::OnCharHook)
|
||||
END_EVENT_TABLE()
|
34
src/widgets/wxPanelWrapper.h
Normal file
34
src/widgets/wxPanelWrapper.h
Normal file
@ -0,0 +1,34 @@
|
||||
//
|
||||
// wxPanelWrapper.h
|
||||
// Audacity
|
||||
//
|
||||
// Created by Paul Licameli on 6/25/16.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef __AUDACITY_WXPANEL_WRAPPER__
|
||||
#define __AUDACITY_WXPANEL_WRAPPER__
|
||||
|
||||
#include <wx/panel.h>
|
||||
|
||||
class AUDACITY_DLL_API wxPanelWrapper /* not final */ : public wxPanel {
|
||||
public:
|
||||
wxPanelWrapper() : wxPanel {} {}
|
||||
|
||||
wxPanelWrapper(wxWindow * parent, wxWindowID id = wxID_ANY,
|
||||
const wxPoint & pos = wxDefaultPosition,
|
||||
const wxSize & size = wxDefaultSize,
|
||||
// default as for wxPanel:
|
||||
long style = wxTAB_TRAVERSAL | wxNO_BORDER);
|
||||
|
||||
static void DoCharHook(wxKeyEvent &event);
|
||||
|
||||
private:
|
||||
void OnCharHook(wxKeyEvent &event);
|
||||
|
||||
DECLARE_DYNAMIC_CLASS(wxPanelWrapper);
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
};
|
||||
|
||||
#endif
|
@ -212,6 +212,7 @@
|
||||
<ClCompile Include="..\..\..\src\TimeDialog.cpp" />
|
||||
<ClCompile Include="..\..\..\src\TimerRecordDialog.cpp" />
|
||||
<ClCompile Include="..\..\..\src\TimeTrack.cpp" />
|
||||
<ClCompile Include="..\..\..\src\toolbars\ScrubbingToolBar.cpp" />
|
||||
<ClCompile Include="..\..\..\src\toolbars\SpectralSelectionBar.cpp" />
|
||||
<ClCompile Include="..\..\..\src\Track.cpp" />
|
||||
<ClCompile Include="..\..\..\src\TrackArtist.cpp" />
|
||||
@ -230,6 +231,7 @@
|
||||
<ClCompile Include="..\..\..\src\widgets\NumericTextCtrl.cpp" />
|
||||
<ClCompile Include="..\..\..\src\widgets\Overlay.cpp" />
|
||||
<ClCompile Include="..\..\..\src\widgets\OverlayPanel.cpp" />
|
||||
<ClCompile Include="..\..\..\src\widgets\wxPanelWrapper.cpp" />
|
||||
<ClCompile Include="..\..\..\src\WrappedType.cpp" />
|
||||
<ClCompile Include="..\..\..\src\effects\Amplify.cpp" />
|
||||
<ClCompile Include="..\..\..\src\effects\AutoDuck.cpp" />
|
||||
@ -445,6 +447,7 @@
|
||||
<ClInclude Include="..\..\..\src\RevisionIdent.h" />
|
||||
<ClInclude Include="..\..\..\src\SelectedRegion.h" />
|
||||
<ClInclude Include="..\..\..\src\SseMathFuncs.h" />
|
||||
<ClInclude Include="..\..\..\src\toolbars\ScrubbingToolBar.h" />
|
||||
<ClInclude Include="..\..\..\src\toolbars\SpectralSelectionBar.h" />
|
||||
<ClInclude Include="..\..\..\src\toolbars\SpectralSelectionBarListener.h" />
|
||||
<ClInclude Include="..\..\..\src\TrackPanelCell.h" />
|
||||
@ -460,6 +463,7 @@
|
||||
<ClInclude Include="..\..\..\src\widgets\NumericTextCtrl.h" />
|
||||
<ClInclude Include="..\..\..\src\widgets\Overlay.h" />
|
||||
<ClInclude Include="..\..\..\src\widgets\OverlayPanel.h" />
|
||||
<ClInclude Include="..\..\..\src\widgets\wxPanelWrapper.h" />
|
||||
<ClInclude Include="..\..\..\src\wxFileNameWrapper.h" />
|
||||
<ClInclude Include="..\..\configwin.h" />
|
||||
<ClInclude Include="..\..\..\src\Dependencies.h" />
|
||||
|
@ -884,6 +884,12 @@
|
||||
<ClCompile Include="..\..\..\src\effects\Distortion.cpp">
|
||||
<Filter>src\effects</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\toolbars\ScrubbingToolBar.cpp">
|
||||
<Filter>src\toolbars</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\src\widgets\wxPanelWrapper.cpp">
|
||||
<Filter>src\widgets</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\src\AboutDialog.h">
|
||||
@ -1789,6 +1795,12 @@
|
||||
<ClInclude Include="..\..\..\src\effects\Distortion.h">
|
||||
<Filter>src\effects</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\toolbars\ScrubbingToolBar.h">
|
||||
<Filter>src\toolbars</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\src\widgets\wxPanelWrapper.h">
|
||||
<Filter>src\widgets</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="..\..\audacity.ico">
|
||||
|
Loading…
x
Reference in New Issue
Block a user