From 84c0337aba6c5211a5f9f3e13d1ffd6c95e753c1 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 10 Jul 2016 17:10:50 -0400 Subject: [PATCH] Fix TAB key navigation on Mac for all dialogs (not only for panels) --- src/AboutDialog.cpp | 6 +++--- src/AboutDialog.h | 4 ++-- src/AudioIO.h | 1 - src/AutoRecovery.cpp | 6 +++--- src/BatchCommandDialog.cpp | 4 ++-- src/BatchCommandDialog.h | 2 +- src/BatchProcessDialog.cpp | 12 +++++------ src/BatchProcessDialog.h | 4 ++-- src/Benchmark.cpp | 6 +++--- src/Dependencies.cpp | 8 ++++---- src/FFmpeg.cpp | 8 ++++---- src/FFmpeg.h | 4 ++-- src/FreqWindow.cpp | 6 +++--- src/FreqWindow.h | 2 +- src/HistoryWindow.cpp | 4 ++-- src/HistoryWindow.h | 5 +++-- src/LabelDialog.cpp | 6 +++--- src/LabelDialog.h | 4 ++-- src/LangChoice.cpp | 8 ++++---- src/Menus.cpp | 4 ++-- src/PluginManager.cpp | 6 +++--- src/SoundActivatedRecord.cpp | 4 ++-- src/SoundActivatedRecord.h | 4 ++-- src/SplashDialog.cpp | 6 +++--- src/SplashDialog.h | 3 ++- src/Tags.cpp | 6 +++--- src/Tags.h | 5 +++-- src/TimeDialog.cpp | 4 ++-- src/TimeDialog.h | 5 +++-- src/TimerRecordDialog.cpp | 4 ++-- src/TimerRecordDialog.h | 2 +- src/TrackPanel.cpp | 4 ++-- src/effects/Contrast.cpp | 4 ++-- src/effects/Contrast.h | 4 ++-- src/effects/Effect.cpp | 18 ++++++++--------- src/effects/Effect.h | 7 +++---- src/effects/Equalization.cpp | 4 ++-- src/effects/Equalization.h | 2 +- src/effects/NoiseReduction.cpp | 2 +- src/effects/NoiseRemoval.cpp | 2 +- src/effects/ScoreAlignDialog.cpp | 6 +++--- src/effects/ScoreAlignDialog.h | 2 +- src/effects/VST/VSTEffect.cpp | 10 +++++----- src/effects/audiounits/AudioUnitEffect.cpp | 20 +++++++++---------- src/effects/ladspa/LadspaEffect.cpp | 7 ++++--- src/effects/lv2/LV2Effect.cpp | 6 +++--- src/effects/nyquist/Nyquist.cpp | 4 ++-- src/effects/nyquist/Nyquist.h | 2 +- src/export/Export.cpp | 4 ++-- src/export/Export.h | 2 +- src/export/ExportCL.cpp | 2 +- src/export/ExportFFmpeg.cpp | 2 +- src/export/ExportFFmpegDialogs.cpp | 4 ++-- src/export/ExportFFmpegDialogs.h | 2 +- src/export/ExportMP3.cpp | 8 ++++---- src/export/ExportMultiple.cpp | 8 ++++---- src/export/ExportMultiple.h | 6 +++--- src/import/Import.cpp | 4 ++-- src/import/Import.h | 5 +++-- src/import/ImportPCM.cpp | 2 +- src/import/ImportRaw.cpp | 6 +++--- src/prefs/PrefsDialog.cpp | 23 +++++++--------------- src/prefs/PrefsDialog.h | 5 ++--- src/toolbars/DeviceToolBar.cpp | 2 +- src/widgets/ASlider.cpp | 4 ++-- src/widgets/ASlider.h | 4 ++-- src/widgets/ErrorDialog.cpp | 4 ++-- src/widgets/ErrorDialog.h | 3 ++- src/widgets/ExpandingToolBar.cpp | 6 +++--- src/widgets/ExpandingToolBar.h | 2 +- src/widgets/HelpSystem.cpp | 2 +- src/widgets/LinkingHtmlWindow.cpp | 4 ++-- src/widgets/LinkingHtmlWindow.h | 4 ++-- src/widgets/Meter.cpp | 2 +- src/widgets/MultiDialog.cpp | 6 +++--- src/widgets/ProgressDialog.cpp | 14 ++++++------- src/widgets/ProgressDialog.h | 5 +++-- src/widgets/Warning.cpp | 8 ++++---- src/widgets/wxPanelWrapper.h | 3 +++ 79 files changed, 206 insertions(+), 207 deletions(-) diff --git a/src/AboutDialog.cpp b/src/AboutDialog.cpp index f4ae674c1..c158302a8 100644 --- a/src/AboutDialog.cpp +++ b/src/AboutDialog.cpp @@ -217,11 +217,11 @@ void AboutDialog::CreateCreditsList() // ---------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(AboutDialog, wxDialog) +BEGIN_EVENT_TABLE(AboutDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, AboutDialog::OnOK) END_EVENT_TABLE() -IMPLEMENT_CLASS(AboutDialog, wxDialog) +IMPLEMENT_CLASS(AboutDialog, wxDialogWrapper) namespace { AboutDialog *sActiveInstance{}; @@ -233,7 +233,7 @@ AboutDialog *AboutDialog::ActiveIntance() } AboutDialog::AboutDialog(wxWindow * parent) - : wxDialog(parent, -1, _("About Audacity"), + : wxDialogWrapper(parent, -1, _("About Audacity"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { diff --git a/src/AboutDialog.h b/src/AboutDialog.h index 9a67df589..abc9cf49a 100644 --- a/src/AboutDialog.h +++ b/src/AboutDialog.h @@ -13,10 +13,10 @@ #include "MemoryX.h" #include -#include #include #include #include +#include "widgets/wxPanelWrapper.h" class ShuttleGui; @@ -49,7 +49,7 @@ struct AboutDialogCreditItem { using AboutDialogCreditItemsList = std::vector; -class AboutDialog final : public wxDialog { +class AboutDialog final : public wxDialogWrapper { DECLARE_DYNAMIC_CLASS(AboutDialog) public: diff --git a/src/AudioIO.h b/src/AudioIO.h index ca7b2a81d..05cd1eeeb 100644 --- a/src/AudioIO.h +++ b/src/AudioIO.h @@ -51,7 +51,6 @@ class AudioThread; class Meter; class SelectedRegion; class TimeTrack; -class wxDialog; class AudacityProject; class WaveTrackArray; diff --git a/src/AutoRecovery.cpp b/src/AutoRecovery.cpp index cf80eeb0b..3529e93e0 100644 --- a/src/AutoRecovery.cpp +++ b/src/AutoRecovery.cpp @@ -37,7 +37,7 @@ enum { ID_FILE_LIST }; -class AutoRecoveryDialog final : public wxDialog +class AutoRecoveryDialog final : public wxDialogWrapper { public: AutoRecoveryDialog(wxWindow *parent); @@ -57,7 +57,7 @@ public: }; AutoRecoveryDialog::AutoRecoveryDialog(wxWindow *parent) : - wxDialog(parent, -1, _("Automatic Crash Recovery"), + wxDialogWrapper(parent, -1, _("Automatic Crash Recovery"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE & (~wxCLOSE_BOX)) // no close box { @@ -66,7 +66,7 @@ AutoRecoveryDialog::AutoRecoveryDialog(wxWindow *parent) : PopulateOrExchange(S); } -BEGIN_EVENT_TABLE(AutoRecoveryDialog, wxDialog) +BEGIN_EVENT_TABLE(AutoRecoveryDialog, wxDialogWrapper) EVT_BUTTON(ID_RECOVER_ALL, AutoRecoveryDialog::OnRecoverAll) EVT_BUTTON(ID_RECOVER_NONE, AutoRecoveryDialog::OnRecoverNone) EVT_BUTTON(ID_QUIT_AUDACITY, AutoRecoveryDialog::OnQuitAudacity) diff --git a/src/BatchCommandDialog.cpp b/src/BatchCommandDialog.cpp index 0675ed820..cbadbc0e2 100644 --- a/src/BatchCommandDialog.cpp +++ b/src/BatchCommandDialog.cpp @@ -47,7 +47,7 @@ selected command. #define EditParamsButtonID 7002 #define UsePresetButtonID 7003 -BEGIN_EVENT_TABLE(BatchCommandDialog, wxDialog) +BEGIN_EVENT_TABLE(BatchCommandDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, BatchCommandDialog::OnOk) EVT_BUTTON(wxID_CANCEL, BatchCommandDialog::OnCancel) EVT_BUTTON(EditParamsButtonID, BatchCommandDialog::OnEditParams) @@ -57,7 +57,7 @@ BEGIN_EVENT_TABLE(BatchCommandDialog, wxDialog) END_EVENT_TABLE(); BatchCommandDialog::BatchCommandDialog(wxWindow * parent, wxWindowID id): - wxDialog(parent, id, _("Select Command"), + wxDialogWrapper(parent, id, _("Select Command"), wxDefaultPosition, wxDefaultSize, wxCAPTION | wxRESIZE_BORDER) { diff --git a/src/BatchCommandDialog.h b/src/BatchCommandDialog.h index 81b4802f3..088a4ba3d 100644 --- a/src/BatchCommandDialog.h +++ b/src/BatchCommandDialog.h @@ -36,7 +36,7 @@ class wxListEvent; class wxButton; class ShuttleGui; -class BatchCommandDialog final : public wxDialog { +class BatchCommandDialog final : public wxDialogWrapper { public: // constructors and destructors BatchCommandDialog(wxWindow *parent, wxWindowID id); diff --git a/src/BatchProcessDialog.cpp b/src/BatchProcessDialog.cpp index b9e575d28..7f3d7c701 100644 --- a/src/BatchProcessDialog.cpp +++ b/src/BatchProcessDialog.cpp @@ -56,14 +56,14 @@ #define ApplyToProjectID 7003 #define ApplyToFilesID 7004 -BEGIN_EVENT_TABLE(BatchProcessDialog, wxDialog) +BEGIN_EVENT_TABLE(BatchProcessDialog, wxDialogWrapper) EVT_BUTTON(ApplyToProjectID, BatchProcessDialog::OnApplyToProject) EVT_BUTTON(ApplyToFilesID, BatchProcessDialog::OnApplyToFiles) EVT_BUTTON(wxID_CANCEL, BatchProcessDialog::OnCancel) END_EVENT_TABLE() BatchProcessDialog::BatchProcessDialog(wxWindow * parent): - wxDialog(parent, wxID_ANY, _("Apply Chain"), + wxDialogWrapper(parent, wxID_ANY, _("Apply Chain"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { @@ -153,7 +153,7 @@ void BatchProcessDialog::OnApplyToProject(wxCommandEvent & WXUNUSED(event)) } wxString name = mChains->GetItemText(item); - wxDialog * pD = safenew wxDialog(this, wxID_ANY, GetTitle()); + wxDialog * pD = safenew wxDialogWrapper(this, wxID_ANY, GetTitle()); pD->SetName(pD->GetTitle()); ShuttleGui S(pD, eIsCreating); @@ -294,7 +294,7 @@ void BatchProcessDialog::OnApplyToFiles(wxCommandEvent & WXUNUSED(event)) files.Sort(); - wxDialog * pD = safenew wxDialog(this, wxID_ANY, GetTitle()); + wxDialog * pD = safenew wxDialogWrapper(this, wxID_ANY, GetTitle()); pD->SetName(pD->GetTitle()); ShuttleGui S(pD, eIsCreating); @@ -423,7 +423,7 @@ enum { RenameButtonID }; -BEGIN_EVENT_TABLE(EditChainsDialog, wxDialog) +BEGIN_EVENT_TABLE(EditChainsDialog, wxDialogWrapper) EVT_LIST_ITEM_SELECTED(ChainsListID, EditChainsDialog::OnChainSelected) EVT_LIST_ITEM_SELECTED(CommandsListID, EditChainsDialog::OnListSelected) EVT_LIST_BEGIN_LABEL_EDIT(ChainsListID, EditChainsDialog::OnChainsBeginEdit) @@ -455,7 +455,7 @@ enum { /// Constructor EditChainsDialog::EditChainsDialog(wxWindow * parent): - wxDialog(parent, wxID_ANY, _("Edit Chains"), + wxDialogWrapper(parent, wxID_ANY, _("Edit Chains"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { diff --git a/src/BatchProcessDialog.h b/src/BatchProcessDialog.h index aad30a4d2..289f29c7d 100644 --- a/src/BatchProcessDialog.h +++ b/src/BatchProcessDialog.h @@ -38,7 +38,7 @@ class wxListEvent; class wxButton; class ShuttleGui; -class BatchProcessDialog final : public wxDialog { +class BatchProcessDialog final : public wxDialogWrapper { public: // constructors and destructors BatchProcessDialog(wxWindow * parent); @@ -62,7 +62,7 @@ class BatchProcessDialog final : public wxDialog { DECLARE_EVENT_TABLE() }; -class EditChainsDialog final : public wxDialog +class EditChainsDialog final : public wxDialogWrapper { public: EditChainsDialog(wxWindow * parent); diff --git a/src/Benchmark.cpp b/src/Benchmark.cpp index c8c6fbb34..6763bb6d0 100644 --- a/src/Benchmark.cpp +++ b/src/Benchmark.cpp @@ -42,7 +42,7 @@ of the BlockFile system. #include "FileDialog.h" -class BenchmarkDialog final : public wxDialog +class BenchmarkDialog final : public wxDialogWrapper { public: // constructors and destructors @@ -117,7 +117,7 @@ enum { RandSeedID }; -BEGIN_EVENT_TABLE(BenchmarkDialog,wxDialog) +BEGIN_EVENT_TABLE(BenchmarkDialog, wxDialogWrapper) EVT_BUTTON( RunID, BenchmarkDialog::OnRun ) EVT_BUTTON( BSaveID, BenchmarkDialog::OnSave ) EVT_BUTTON( ClearID, BenchmarkDialog::OnClear ) @@ -125,7 +125,7 @@ BEGIN_EVENT_TABLE(BenchmarkDialog,wxDialog) END_EVENT_TABLE() BenchmarkDialog::BenchmarkDialog(wxWindow *parent): - wxDialog( parent, 0, wxT("Benchmark"), + wxDialogWrapper( parent, 0, wxT("Benchmark"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) diff --git a/src/Dependencies.cpp b/src/Dependencies.cpp index 17310868a..4c489a679 100644 --- a/src/Dependencies.cpp +++ b/src/Dependencies.cpp @@ -235,7 +235,7 @@ static void RemoveDependencies(AudacityProject *project, // DependencyDialog // -class DependencyDialog final : public wxDialog +class DependencyDialog final : public wxDialogWrapper { public: DependencyDialog(wxWindow *parent, @@ -281,7 +281,7 @@ enum { FutureActionChoiceID }; -BEGIN_EVENT_TABLE(DependencyDialog, wxDialog) +BEGIN_EVENT_TABLE(DependencyDialog, wxDialogWrapper) EVT_LIST_ITEM_SELECTED(FileListID, DependencyDialog::OnList) EVT_LIST_ITEM_DESELECTED(FileListID, DependencyDialog::OnList) EVT_BUTTON(CopySelectedFilesButtonID, DependencyDialog::OnCopySelectedFiles) @@ -296,7 +296,7 @@ DependencyDialog::DependencyDialog(wxWindow *parent, AudacityProject *project, AliasedFileArray &aliasedFiles, bool isSaving) -: wxDialog(parent, id, _("Project Depends on Other Audio Files"), +: wxDialogWrapper(parent, id, _("Project Depends on Other Audio Files"), wxDefaultPosition, wxDefaultSize, (isSaving ? (wxDEFAULT_DIALOG_STYLE & ~wxCLOSE_BOX) : // no close box when saving @@ -466,7 +466,7 @@ void DependencyDialog::OnSize(wxSizeEvent &evt) // Also subtract 8 from file path column width for borders. mFileListCtrl->SetColumnWidth(0, fileListCtrlWidth - 120 - 8); mFileListCtrl->SetColumnWidth(1, 120); - wxDialog::OnSize(evt); + wxDialogWrapper::OnSize(evt); } void DependencyDialog::OnNo(wxCommandEvent & WXUNUSED(event)) diff --git a/src/FFmpeg.cpp b/src/FFmpeg.cpp index c252a7e76..a365911ac 100644 --- a/src/FFmpeg.cpp +++ b/src/FFmpeg.cpp @@ -449,12 +449,12 @@ class FFmpegNotFoundDialog; #define ID_FFMPEG_DLOAD 5001 /// Allows user to locate libav* libraries -class FindFFmpegDialog final : public wxDialog +class FindFFmpegDialog final : public wxDialogWrapper { public: FindFFmpegDialog(wxWindow *parent, const wxString &path, const wxString &name, const wxString &type) - : wxDialog(parent, wxID_ANY, wxString(_("Locate FFmpeg"))) + : wxDialogWrapper(parent, wxID_ANY, wxString(_("Locate FFmpeg"))) { SetName(GetTitle()); ShuttleGui S(this, eIsCreating); @@ -558,7 +558,7 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(FindFFmpegDialog, wxDialog) +BEGIN_EVENT_TABLE(FindFFmpegDialog, wxDialogWrapper) EVT_BUTTON(ID_FFMPEG_BROWSE, FindFFmpegDialog::OnBrowse) EVT_BUTTON(ID_FFMPEG_DLOAD, FindFFmpegDialog::OnDownload) END_EVENT_TABLE() @@ -568,7 +568,7 @@ END_EVENT_TABLE() // FFmpegNotFoundDialog //---------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(FFmpegNotFoundDialog, wxDialog) +BEGIN_EVENT_TABLE(FFmpegNotFoundDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, FFmpegNotFoundDialog::OnOk) END_EVENT_TABLE() diff --git a/src/FFmpeg.h b/src/FFmpeg.h index 8f0eb95a3..883ad3b9f 100644 --- a/src/FFmpeg.h +++ b/src/FFmpeg.h @@ -172,12 +172,12 @@ bool LoadFFmpeg(bool showerror); /// If Audacity failed to load libav*, this dialog /// shows up and tells user about that. It will pop-up /// again and again until it is disabled. -class FFmpegNotFoundDialog final : public wxDialog +class FFmpegNotFoundDialog final : public wxDialogWrapper { public: FFmpegNotFoundDialog(wxWindow *parent) - : wxDialog(parent, wxID_ANY, wxString(_("FFmpeg not found"))) + : wxDialogWrapper(parent, wxID_ANY, wxString(_("FFmpeg not found"))) { SetName(GetTitle()); ShuttleGui S(this, eIsCreating); diff --git a/src/FreqWindow.cpp b/src/FreqWindow.cpp index 02a894eec..eca50546a 100644 --- a/src/FreqWindow.cpp +++ b/src/FreqWindow.cpp @@ -157,7 +157,7 @@ static const char * ZoomOut[] = { // FreqWindow -BEGIN_EVENT_TABLE(FreqWindow, wxDialog) +BEGIN_EVENT_TABLE(FreqWindow, wxDialogWrapper) EVT_CLOSE(FreqWindow::OnCloseWindow) EVT_SIZE(FreqWindow::OnSize) EVT_SLIDER(FreqZoomSliderID, FreqWindow::OnZoomSlider) @@ -187,7 +187,7 @@ SpectrumAnalyst::~SpectrumAnalyst() FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint & pos) -: wxDialog(parent, id, title, pos, wxDefaultSize, +: wxDialogWrapper(parent, id, title, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX), mData(NULL), mBitmap(NULL), @@ -544,7 +544,7 @@ bool FreqWindow::Show(bool show) Recalc(); } - bool res = wxDialog::Show(show); + bool res = wxDialogWrapper::Show(show); return res; } diff --git a/src/FreqWindow.h b/src/FreqWindow.h index 674f4f51f..245adfe47 100644 --- a/src/FreqWindow.h +++ b/src/FreqWindow.h @@ -123,7 +123,7 @@ private: DECLARE_EVENT_TABLE(); }; -class FreqWindow final : public wxDialog +class FreqWindow final : public wxDialogWrapper { public: FreqWindow(wxWindow *parent, wxWindowID id, diff --git a/src/HistoryWindow.cpp b/src/HistoryWindow.cpp index 9f9c6c48e..36dd355eb 100644 --- a/src/HistoryWindow.cpp +++ b/src/HistoryWindow.cpp @@ -45,7 +45,7 @@ enum { ID_DISCARD }; -BEGIN_EVENT_TABLE(HistoryWindow, wxDialog) +BEGIN_EVENT_TABLE(HistoryWindow, wxDialogWrapper) EVT_SIZE(HistoryWindow::OnSize) EVT_CLOSE(HistoryWindow::OnCloseWindow) EVT_LIST_ITEM_SELECTED(wxID_ANY, HistoryWindow::OnItemSelected) @@ -53,7 +53,7 @@ BEGIN_EVENT_TABLE(HistoryWindow, wxDialog) END_EVENT_TABLE() HistoryWindow::HistoryWindow(AudacityProject *parent, UndoManager *manager): - wxDialog((wxWindow*)parent, wxID_ANY, wxString(_("Undo History")), + wxDialogWrapper((wxWindow*)parent, wxID_ANY, wxString(_("Undo History")), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER ) { diff --git a/src/HistoryWindow.h b/src/HistoryWindow.h index cf98e0d6a..18396b2db 100644 --- a/src/HistoryWindow.h +++ b/src/HistoryWindow.h @@ -12,18 +12,19 @@ #define __AUDACITY_HISTORY_WINDOW__ #include -#include #include #include #include #include #include +#include "widgets/wxPanelWrapper.h" + class AudacityProject; class ShuttleGui; class UndoManager; -class HistoryWindow final : public wxDialog { +class HistoryWindow final : public wxDialogWrapper { public: HistoryWindow(AudacityProject * parent, UndoManager *manager); diff --git a/src/LabelDialog.cpp b/src/LabelDialog.cpp index 359167bbf..923dfd092 100644 --- a/src/LabelDialog.cpp +++ b/src/LabelDialog.cpp @@ -74,7 +74,7 @@ enum { ID_EXPORT }; -BEGIN_EVENT_TABLE(LabelDialog, wxDialog) +BEGIN_EVENT_TABLE(LabelDialog, wxDialogWrapper) EVT_GRID_SELECT_CELL(LabelDialog::OnSelectCell) EVT_GRID_CELL_CHANGED(LabelDialog::OnCellChange) EVT_BUTTON(ID_INSERTA, LabelDialog::OnInsert) @@ -97,7 +97,7 @@ LabelDialog::LabelDialog(wxWindow *parent, ViewInfo &viewinfo, double rate, const wxString & format, const wxString &freqFormat) -: wxDialog(parent, +: wxDialogWrapper(parent, wxID_ANY, _("Edit Labels"), wxDefaultPosition, @@ -313,7 +313,7 @@ bool LabelDialog::TransferDataToWindow() bool LabelDialog::Show(bool show) { - bool ret = wxDialog::Show(show); + bool ret = wxDialogWrapper::Show(show); // Set initial row // (This will not work until the grid is actually displayed) diff --git a/src/LabelDialog.h b/src/LabelDialog.h index 62d78fde7..4d25248f7 100644 --- a/src/LabelDialog.h +++ b/src/LabelDialog.h @@ -13,13 +13,13 @@ #include #include -#include #include #include #include #include "Internat.h" #include "widgets/Grid.h" +#include "widgets/wxPanelWrapper.h" class TrackFactory; class TrackList; @@ -30,7 +30,7 @@ class ViewInfo; typedef std::vector RowDataArray; -class LabelDialog final : public wxDialog +class LabelDialog final : public wxDialogWrapper { public: diff --git a/src/LangChoice.cpp b/src/LangChoice.cpp index 398902674..70ca4b8f2 100644 --- a/src/LangChoice.cpp +++ b/src/LangChoice.cpp @@ -20,7 +20,6 @@ of languages for Audacity. #include #include #include -#include #include #include #include @@ -29,8 +28,9 @@ of languages for Audacity. #include "LangChoice.h" #include "Languages.h" #include "ShuttleGui.h" +#include "widgets/wxPanelWrapper.h" -class LangChoiceDialog final : public wxDialog { +class LangChoiceDialog final : public wxDialogWrapper { public: LangChoiceDialog(wxWindow * parent, wxWindowID id, @@ -65,14 +65,14 @@ wxString ChooseLanguage(wxWindow *parent) return returnVal; } -BEGIN_EVENT_TABLE(LangChoiceDialog, wxDialog) +BEGIN_EVENT_TABLE(LangChoiceDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, LangChoiceDialog::OnOk) END_EVENT_TABLE() LangChoiceDialog::LangChoiceDialog(wxWindow * parent, wxWindowID id, const wxString & title): - wxDialog(parent, id, title) + wxDialogWrapper(parent, id, title) { SetName(GetTitle()); GetLanguages(mLangCodes, mLangNames); diff --git a/src/Menus.cpp b/src/Menus.cpp index 40c32e6f5..d7680c033 100644 --- a/src/Menus.cpp +++ b/src/Menus.cpp @@ -6738,7 +6738,7 @@ void AudacityProject::OnAudioDeviceInfo() { wxString info = gAudioIO->GetDeviceInfo(); - wxDialog dlg(this, wxID_ANY, wxString(_("Audio Device Info"))); + wxDialogWrapper dlg(this, wxID_ANY, wxString(_("Audio Device Info"))); dlg.SetName(dlg.GetTitle()); ShuttleGui S(&dlg, eIsCreating); @@ -6873,7 +6873,7 @@ void AudacityProject::OnResample() while (true) { - wxDialog dlg(this, wxID_ANY, wxString(_("Resample"))); + wxDialogWrapper dlg(this, wxID_ANY, wxString(_("Resample"))); dlg.SetName(dlg.GetTitle()); ShuttleGui S(&dlg, eIsCreating); wxString rate; diff --git a/src/PluginManager.cpp b/src/PluginManager.cpp index f787b70ab..5ffbc4ae6 100644 --- a/src/PluginManager.cpp +++ b/src/PluginManager.cpp @@ -414,7 +414,7 @@ enum COL_COUNT }; -class PluginRegistrationDialog final : public wxDialog +class PluginRegistrationDialog final : public wxDialogWrapper { public: // constructors and destructors @@ -461,7 +461,7 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(PluginRegistrationDialog, wxDialog) +BEGIN_EVENT_TABLE(PluginRegistrationDialog, wxDialogWrapper) EVT_LIST_COL_CLICK(ID_List, PluginRegistrationDialog::OnSort) EVT_BUTTON(wxID_OK, PluginRegistrationDialog::OnOK) EVT_BUTTON(wxID_CANCEL, PluginRegistrationDialog::OnCancel) @@ -476,7 +476,7 @@ BEGIN_EVENT_TABLE(PluginRegistrationDialog, wxDialog) END_EVENT_TABLE() PluginRegistrationDialog::PluginRegistrationDialog(wxWindow *parent, EffectType type) -: wxDialog(parent, +: wxDialogWrapper(parent, wxID_ANY, _("Plug-in Manager: Effects, Generators and Analyzers"), wxDefaultPosition, wxDefaultSize, diff --git a/src/SoundActivatedRecord.cpp b/src/SoundActivatedRecord.cpp index e066757b2..66e02573a 100644 --- a/src/SoundActivatedRecord.cpp +++ b/src/SoundActivatedRecord.cpp @@ -26,12 +26,12 @@ #include "Prefs.h" #include "prefs/GUISettings.h" -BEGIN_EVENT_TABLE(SoundActivatedRecord, wxDialog) +BEGIN_EVENT_TABLE(SoundActivatedRecord, wxDialogWrapper) EVT_BUTTON(wxID_OK, SoundActivatedRecord::OnOK) END_EVENT_TABLE() SoundActivatedRecord::SoundActivatedRecord(wxWindow* parent) -: wxDialog(parent, -1, _("Sound Activated Record"), wxDefaultPosition, +: wxDialogWrapper(parent, -1, _("Sound Activated Record"), wxDefaultPosition, wxDefaultSize, wxCAPTION ) // wxDefaultSize, wxCAPTION | wxTHICK_FRAME) { diff --git a/src/SoundActivatedRecord.h b/src/SoundActivatedRecord.h index be4af097d..44fe8b327 100644 --- a/src/SoundActivatedRecord.h +++ b/src/SoundActivatedRecord.h @@ -16,11 +16,11 @@ #ifndef __AUDACITY_SOUND_ACTIVATED_RECORD__ #define __AUDACITY_SOUND_ACTIVATED_RECORD__ -#include +#include "widgets/wxPanelWrapper.h" class ShuttleGui; -class SoundActivatedRecord final : public wxDialog +class SoundActivatedRecord final : public wxDialogWrapper { public: SoundActivatedRecord(wxWindow* parent); diff --git a/src/SplashDialog.cpp b/src/SplashDialog.cpp index bdc84076c..0973523f2 100644 --- a/src/SplashDialog.cpp +++ b/src/SplashDialog.cpp @@ -51,15 +51,15 @@ enum DontShowID=1000, }; -BEGIN_EVENT_TABLE(SplashDialog, wxDialog) +BEGIN_EVENT_TABLE(SplashDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, SplashDialog::OnOK) EVT_CHECKBOX( DontShowID, SplashDialog::OnDontShow ) END_EVENT_TABLE() -IMPLEMENT_CLASS(SplashDialog, wxDialog) +IMPLEMENT_CLASS(SplashDialog, wxDialogWrapper) SplashDialog::SplashDialog(wxWindow * parent) - : wxDialog(parent, -1, _("Welcome to Audacity!"), + : wxDialogWrapper(parent, -1, _("Welcome to Audacity!"), wxPoint( -1, 60 ), // default x position, y position 60 pixels from top of screen. wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { diff --git a/src/SplashDialog.h b/src/SplashDialog.h index eadd3ce79..ab702a3d2 100644 --- a/src/SplashDialog.h +++ b/src/SplashDialog.h @@ -12,6 +12,7 @@ #define __AUDACITY_SPLASH_DLG__ #include +#include "widgets/wxPanelWrapper.h" class wxBoxSizer; class wxStaticBitmap; @@ -21,7 +22,7 @@ class AudacityProject; class wxCheckbox; class HtmlWindow; -class SplashDialog final : public wxDialog { +class SplashDialog final : public wxDialogWrapper { DECLARE_DYNAMIC_CLASS(SplashDialog) public: SplashDialog(wxWindow * parent); diff --git a/src/Tags.cpp b/src/Tags.cpp index 842dd2251..8648c56a8 100644 --- a/src/Tags.cpp +++ b/src/Tags.cpp @@ -669,7 +669,7 @@ enum { RemoveID }; -BEGIN_EVENT_TABLE(TagsEditor, wxDialog) +BEGIN_EVENT_TABLE(TagsEditor, wxDialogWrapper) EVT_GRID_CELL_CHANGED(TagsEditor::OnChange) EVT_BUTTON(EditID, TagsEditor::OnEdit) EVT_BUTTON(ResetID, TagsEditor::OnReset) @@ -689,7 +689,7 @@ TagsEditor::TagsEditor(wxWindow * parent, Tags * tags, bool editTitle, bool editTrack) -: wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, +: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), mTags(tags), mEditTitle(editTitle), @@ -1003,7 +1003,7 @@ void TagsEditor::OnEdit(wxCommandEvent & WXUNUSED(event)) mGrid->HideCellEditControl(); } - wxDialog dlg(this, wxID_ANY, _("Edit Genres"), + wxDialogWrapper dlg(this, wxID_ANY, _("Edit Genres"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); dlg.SetName(dlg.GetTitle()); diff --git a/src/Tags.h b/src/Tags.h index 900d96994..4fec7a850 100644 --- a/src/Tags.h +++ b/src/Tags.h @@ -35,11 +35,12 @@ #include "MemoryX.h" #include -#include #include #include #include +#include "widgets/wxPanelWrapper.h" + class wxButton; class wxChoice; class wxComboBox; @@ -135,7 +136,7 @@ class AUDACITY_DLL_API Tags final : public XMLTagHandler { inline bool operator != (const Tags &lhs, const Tags &rhs) { return !(lhs == rhs); } -class TagsEditor final : public wxDialog +class TagsEditor final : public wxDialogWrapper { public: // constructors and destructors diff --git a/src/TimeDialog.cpp b/src/TimeDialog.cpp index 48de799bd..9d457a4cd 100644 --- a/src/TimeDialog.cpp +++ b/src/TimeDialog.cpp @@ -25,7 +25,7 @@ #include "ShuttleGui.h" #include "TimeDialog.h" -BEGIN_EVENT_TABLE(TimeDialog, wxDialog) +BEGIN_EVENT_TABLE(TimeDialog, wxDialogWrapper) EVT_COMMAND(wxID_ANY, EVT_TIMETEXTCTRL_UPDATED, TimeDialog::OnUpdate) END_EVENT_TABLE() @@ -35,7 +35,7 @@ TimeDialog::TimeDialog(wxWindow *parent, double rate, double time, const wxString &prompt) -: wxDialog(parent, wxID_ANY, title), +: wxDialogWrapper(parent, wxID_ANY, title), mPrompt(prompt), mFormat(format), mRate(rate), diff --git a/src/TimeDialog.h b/src/TimeDialog.h index 7975d9ab1..a4e9c86af 100644 --- a/src/TimeDialog.h +++ b/src/TimeDialog.h @@ -12,14 +12,15 @@ #define __AUDACITY_TimeDialog__ #include -#include #include #include +#include "widgets/wxPanelWrapper.h" + class NumericTextCtrl; class ShuttleGui; -class TimeDialog final : public wxDialog +class TimeDialog final : public wxDialogWrapper { public: diff --git a/src/TimerRecordDialog.cpp b/src/TimerRecordDialog.cpp index 4a1564e8b..9f2273ab0 100644 --- a/src/TimerRecordDialog.cpp +++ b/src/TimerRecordDialog.cpp @@ -116,7 +116,7 @@ wxAccStatus DatePickerCtrlAx::GetState(int WXUNUSED(childId), long *state) #endif // wxUSE_ACCESSIBILITY -BEGIN_EVENT_TABLE(TimerRecordDialog, wxDialog) +BEGIN_EVENT_TABLE(TimerRecordDialog, wxDialogWrapper) EVT_DATE_CHANGED(ID_DATEPICKER_START, TimerRecordDialog::OnDatePicker_Start) EVT_TEXT(ID_TIMETEXT_START, TimerRecordDialog::OnTimeText_Start) @@ -139,7 +139,7 @@ BEGIN_EVENT_TABLE(TimerRecordDialog, wxDialog) END_EVENT_TABLE() TimerRecordDialog::TimerRecordDialog(wxWindow* parent, bool bAlreadySaved) -: wxDialog(parent, -1, _("Audacity Timer Record"), wxDefaultPosition, +: wxDialogWrapper(parent, -1, _("Audacity Timer Record"), wxDefaultPosition, wxDefaultSize, wxCAPTION) { SetName(GetTitle()); diff --git a/src/TimerRecordDialog.h b/src/TimerRecordDialog.h index bb7dc1b2c..9daf64998 100644 --- a/src/TimerRecordDialog.h +++ b/src/TimerRecordDialog.h @@ -54,7 +54,7 @@ public: } }; -class TimerRecordDialog final : public wxDialog +class TimerRecordDialog final : public wxDialogWrapper { public: TimerRecordDialog(wxWindow* parent, bool bAlreadySaved); diff --git a/src/TrackPanel.cpp b/src/TrackPanel.cpp index d9fa6467d..c38ae13b9 100644 --- a/src/TrackPanel.cpp +++ b/src/TrackPanel.cpp @@ -8277,7 +8277,7 @@ void TrackPanel::OnRateOther(wxCommandEvent &event) /// \todo Make a real dialog box out of this!! while (true) { - wxDialog dlg(this, wxID_ANY, wxString(_("Set Rate"))); + wxDialogWrapper dlg(this, wxID_ANY, wxString(_("Set Rate"))); dlg.SetName(dlg.GetTitle()); ShuttleGui S(&dlg, eIsCreating); wxString rate; @@ -8574,7 +8574,7 @@ void TrackPanel::OnSetFont(wxCommandEvent & WXUNUSED(event)) LabelTrack::DefaultFontSize); /* i18n-hint: (noun) This is the font for the label track.*/ - wxDialog dlg(this, wxID_ANY, wxString(_("Label Track Font"))); + wxDialogWrapper dlg(this, wxID_ANY, wxString(_("Label Track Font"))); dlg.SetName(dlg.GetTitle()); ShuttleGui S(&dlg, eIsCreating); wxListBox *lb; diff --git a/src/effects/Contrast.cpp b/src/effects/Contrast.cpp index 166c6a76e..cb89e0bf3 100644 --- a/src/effects/Contrast.cpp +++ b/src/effects/Contrast.cpp @@ -137,7 +137,7 @@ enum { ID_RESULTSDB_TEXT }; -BEGIN_EVENT_TABLE(ContrastDialog,wxDialog) +BEGIN_EVENT_TABLE(ContrastDialog,wxDialogWrapper) EVT_BUTTON(ID_BUTTON_USECURRENTF, ContrastDialog::OnGetForeground) EVT_BUTTON(ID_BUTTON_USECURRENTB, ContrastDialog::OnGetBackground) EVT_BUTTON(ID_BUTTON_GETURL, ContrastDialog::OnGetURL) @@ -150,7 +150,7 @@ END_EVENT_TABLE() ContrastDialog::ContrastDialog(wxWindow * parent, wxWindowID id, const wxString & title, const wxPoint & pos): - wxDialog(parent, id, title, pos, wxDefaultSize, + wxDialogWrapper(parent, id, title, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX ) { SetName(GetTitle()); diff --git a/src/effects/Contrast.h b/src/effects/Contrast.h index 3a174ec95..88263533b 100644 --- a/src/effects/Contrast.h +++ b/src/effects/Contrast.h @@ -9,7 +9,7 @@ #ifndef __AUDACITY_CONTRAST_DIALOG__ #define __AUDACITY_CONTRAST_DIALOG__ -#include +#include "widgets/wxPanelWrapper.h" class wxButton; class wxSizer; @@ -26,7 +26,7 @@ class WaveTrack; // Declare window functions -class ContrastDialog final : public wxDialog +class ContrastDialog final : public wxDialogWrapper { public: // constructors and destructors diff --git a/src/effects/Effect.cpp b/src/effects/Effect.cpp index b2cc7ee5e..a9acf7aaf 100644 --- a/src/effects/Effect.cpp +++ b/src/effects/Effect.cpp @@ -2695,7 +2695,7 @@ void Effect::Preview(bool dryOnly) } } -BEGIN_EVENT_TABLE(EffectDialog, wxDialog) +BEGIN_EVENT_TABLE(EffectDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, EffectDialog::OnOk) END_EVENT_TABLE() @@ -2704,7 +2704,7 @@ EffectDialog::EffectDialog(wxWindow * parent, int type, int flags, int additionalButtons) -: wxDialog(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags) +: wxDialogWrapper(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, flags) { mType = type; mAdditionalButtons = additionalButtons; @@ -2845,7 +2845,7 @@ private: #include "../../images/Effect.h" -BEGIN_EVENT_TABLE(EffectUIHost, wxDialog) +BEGIN_EVENT_TABLE(EffectUIHost, wxDialogWrapper) EVT_INIT_DIALOG(EffectUIHost::OnInitDialog) EVT_ERASE_BACKGROUND(EffectUIHost::OnErase) EVT_PAINT(EffectUIHost::OnPaint) @@ -2871,7 +2871,7 @@ END_EVENT_TABLE() EffectUIHost::EffectUIHost(wxWindow *parent, Effect *effect, EffectUIClientInterface *client) -: wxDialog(parent, wxID_ANY, effect->GetName(), +: wxDialogWrapper(parent, wxID_ANY, effect->GetName(), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX) { @@ -2952,7 +2952,7 @@ int EffectUIHost::ShowModal() Layout(); - return wxDialog::ShowModal(); + return wxDialogWrapper::ShowModal(); } // ============================================================================ @@ -3159,7 +3159,7 @@ bool EffectUIHost::Initialize() void EffectUIHost::OnInitDialog(wxInitDialogEvent & evt) { // Do default handling - wxDialog::OnInitDialog(evt); + wxDialogWrapper::OnInitDialog(evt); #if wxCHECK_VERSION(3, 0, 0) //#warning "check to see if this still needed in wx3" @@ -3575,7 +3575,7 @@ void EffectUIHost::OnSaveAs(wxCommandEvent & WXUNUSED(evt)) { wxTextCtrl *text; wxString name; - wxDialog dlg(this, wxID_ANY, wxString(_("Save Preset"))); + wxDialogWrapper dlg(this, wxID_ANY, wxString(_("Save Preset"))); ShuttleGui S(&dlg, eIsCreating); @@ -3852,7 +3852,7 @@ enum ID_Type = 10000 }; -BEGIN_EVENT_TABLE(EffectPresetsDialog, wxDialog) +BEGIN_EVENT_TABLE(EffectPresetsDialog, wxDialogWrapper) EVT_CHOICE(ID_Type, EffectPresetsDialog::OnType) EVT_LISTBOX_DCLICK(wxID_ANY, EffectPresetsDialog::OnOk) EVT_BUTTON(wxID_OK, EffectPresetsDialog::OnOk) @@ -3860,7 +3860,7 @@ BEGIN_EVENT_TABLE(EffectPresetsDialog, wxDialog) END_EVENT_TABLE() EffectPresetsDialog::EffectPresetsDialog(wxWindow *parent, Effect *effect) -: wxDialog(parent, wxID_ANY, wxString(_("Select Preset"))) +: wxDialogWrapper(parent, wxID_ANY, wxString(_("Select Preset"))) { ShuttleGui S(this, eIsCreating); S.StartVerticalLay(); diff --git a/src/effects/Effect.h b/src/effects/Effect.h index eb67f7ecf..a24c90966 100644 --- a/src/effects/Effect.h +++ b/src/effects/Effect.h @@ -25,7 +25,6 @@ class wxCheckBox; class wxChoice; -class wxDialog; class wxListBox; class wxWindow; @@ -544,7 +543,7 @@ private: #define ID_EFFECT_PREVIEW ePreviewID // Base dialog for regular effect -class AUDACITY_DLL_API EffectDialog /* not final */ : public wxDialog +class AUDACITY_DLL_API EffectDialog /* not final */ : public wxDialogWrapper { public: // constructors and destructors @@ -573,7 +572,7 @@ private: }; // -class EffectUIHost final : public wxDialog, +class EffectUIHost final : public wxDialogWrapper, public EffectUIHostInterface { public: @@ -664,7 +663,7 @@ private: DECLARE_EVENT_TABLE(); }; -class EffectPresetsDialog final : public wxDialog +class EffectPresetsDialog final : public wxDialogWrapper { public: EffectPresetsDialog(wxWindow *parent, Effect *effect); diff --git a/src/effects/Equalization.cpp b/src/effects/Equalization.cpp index d4f57f190..b4d52640b 100644 --- a/src/effects/Equalization.cpp +++ b/src/effects/Equalization.cpp @@ -3173,7 +3173,7 @@ void EqualizationPanel::OnCaptureLost(wxMouseCaptureLostEvent & WXUNUSED(event)) // Some things that deal with 'unnamed' curves still use, for example, 'mCustomBackup' as variable names. /// Constructor -BEGIN_EVENT_TABLE(EditCurvesDialog, wxDialog) +BEGIN_EVENT_TABLE(EditCurvesDialog, wxDialogWrapper) EVT_BUTTON(UpButtonID, EditCurvesDialog::OnUp) EVT_BUTTON(DownButtonID, EditCurvesDialog::OnDown) EVT_BUTTON(RenameButtonID, EditCurvesDialog::OnRename) @@ -3190,7 +3190,7 @@ BEGIN_EVENT_TABLE(EditCurvesDialog, wxDialog) END_EVENT_TABLE() EditCurvesDialog::EditCurvesDialog(wxWindow * parent, EffectEqualization * effect, int position): -wxDialog(parent, wxID_ANY, _("Manage Curves List"), +wxDialogWrapper(parent, wxID_ANY, _("Manage Curves List"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { diff --git a/src/effects/Equalization.h b/src/effects/Equalization.h index c3d9dce39..7ef0471c9 100644 --- a/src/effects/Equalization.h +++ b/src/effects/Equalization.h @@ -330,7 +330,7 @@ private: // EditCurvesDialog. Note that the 'modified' curve used to be called 'custom' but is now called 'unnamed' // Some things that deal with 'unnamed' curves still use, for example, 'mCustomBackup' as variable names. -class EditCurvesDialog final : public wxDialog +class EditCurvesDialog final : public wxDialogWrapper { public: EditCurvesDialog(wxWindow * parent, EffectEqualization * effect, int position); diff --git a/src/effects/NoiseReduction.cpp b/src/effects/NoiseReduction.cpp index d18eaf959..7e266c1d8 100644 --- a/src/effects/NoiseReduction.cpp +++ b/src/effects/NoiseReduction.cpp @@ -1486,7 +1486,7 @@ return table; } // namespace -BEGIN_EVENT_TABLE(EffectNoiseReduction::Dialog, wxDialog) +BEGIN_EVENT_TABLE(EffectNoiseReduction::Dialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, EffectNoiseReduction::Dialog::OnReduceNoise) EVT_BUTTON(wxID_CANCEL, EffectNoiseReduction::Dialog::OnCancel) EVT_BUTTON(ID_EFFECT_PREVIEW, EffectNoiseReduction::Dialog::OnPreview) diff --git a/src/effects/NoiseRemoval.cpp b/src/effects/NoiseRemoval.cpp index f9bbd24da..a4ff604f6 100644 --- a/src/effects/NoiseRemoval.cpp +++ b/src/effects/NoiseRemoval.cpp @@ -662,7 +662,7 @@ enum { #define TIME_MAX 100 // Corresponds to 1.000 seconds -BEGIN_EVENT_TABLE(NoiseRemovalDialog,wxDialog) +BEGIN_EVENT_TABLE(NoiseRemovalDialog,wxDialogWrapper) EVT_BUTTON(wxID_OK, NoiseRemovalDialog::OnRemoveNoise) EVT_BUTTON(wxID_CANCEL, NoiseRemovalDialog::OnCancel) EVT_BUTTON(ID_EFFECT_PREVIEW, NoiseRemovalDialog::OnPreview) diff --git a/src/effects/ScoreAlignDialog.cpp b/src/effects/ScoreAlignDialog.cpp index 3fb207d74..f49957172 100644 --- a/src/effects/ScoreAlignDialog.cpp +++ b/src/effects/ScoreAlignDialog.cpp @@ -55,10 +55,10 @@ It \TODO: description static ScoreAlignDialog *gScoreAlignDialog = NULL; -//IMPLEMENT_CLASS(ScoreAlignDialog, wxDialog) +//IMPLEMENT_CLASS(ScoreAlignDialog, wxDialogWrapper) ScoreAlignDialog::ScoreAlignDialog(wxWindow *parent, ScoreAlignParams ¶ms) - : wxDialog(parent, -1, _("Align MIDI to Audio"), + : wxDialogWrapper(parent, -1, _("Align MIDI to Audio"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE) { @@ -284,7 +284,7 @@ void CloseScoreAlignDialog() } -BEGIN_EVENT_TABLE(ScoreAlignDialog, wxDialog) +BEGIN_EVENT_TABLE(ScoreAlignDialog, wxDialogWrapper) // EVT_BUTTON(wxID_OK, ScoreAlignDialog::OnOK) // EVT_BUTTON(wxID_CANCEL, ScoreAlignDialog::OnCancel) EVT_BUTTON(ID_DEFAULT, ScoreAlignDialog::OnDefault) diff --git a/src/effects/ScoreAlignDialog.h b/src/effects/ScoreAlignDialog.h index b7b3ee3de..d297e0aec 100644 --- a/src/effects/ScoreAlignDialog.h +++ b/src/effects/ScoreAlignDialog.h @@ -26,7 +26,7 @@ void CloseScoreAlignDialog(); // Declare window functions -class ScoreAlignDialog final : public wxDialog +class ScoreAlignDialog final : public wxDialogWrapper { public: ScoreAlignParams p; diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index dac6aedf2..f5430253b 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -47,7 +47,6 @@ #include #include #include -#include #include #include #include @@ -86,6 +85,7 @@ #include "../../ShuttleGui.h" #include "../../effects/Effect.h" #include "../../widgets/NumericTextCtrl.h" +#include "../../widgets/wxPanelWrapper.h" #include "../../widgets/valnum.h" #include "../../xml/XMLFileReader.h" #include "../../xml/XMLWriter.h" @@ -695,7 +695,7 @@ void VSTEffectsModule::Check(const wxChar *path) // /////////////////////////////////////////////////////////////////////////////// -class VSTEffectOptionsDialog final : public wxDialog +class VSTEffectOptionsDialog final : public wxDialogWrapper { public: VSTEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host); @@ -714,12 +714,12 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(VSTEffectOptionsDialog, wxDialog) +BEGIN_EVENT_TABLE(VSTEffectOptionsDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, VSTEffectOptionsDialog::OnOk) END_EVENT_TABLE() VSTEffectOptionsDialog::VSTEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host) -: wxDialog(parent, wxID_ANY, wxString(_("VST Effect Options"))) +: wxDialogWrapper(parent, wxID_ANY, wxString(_("VST Effect Options"))) { mHost = host; @@ -1729,7 +1729,7 @@ void VSTEffect::SetHostUI(EffectUIHostInterface *host) bool VSTEffect::PopulateUI(wxWindow *parent) { - mDialog = (wxDialog *) wxGetTopLevelParent(parent); + mDialog = static_cast(wxGetTopLevelParent(parent)); mParent = parent; mParent->PushEventHandler(this); diff --git a/src/effects/audiounits/AudioUnitEffect.cpp b/src/effects/audiounits/AudioUnitEffect.cpp index fc7c307dc..d0d79f394 100644 --- a/src/effects/audiounits/AudioUnitEffect.cpp +++ b/src/effects/audiounits/AudioUnitEffect.cpp @@ -287,7 +287,7 @@ OSType AudioUnitEffectsModule::ToOSType(const wxString & type) // /////////////////////////////////////////////////////////////////////////////// -class AudioUnitEffectOptionsDialog final : public wxDialog +class AudioUnitEffectOptionsDialog final : public wxDialogWrapper { public: AudioUnitEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host); @@ -308,12 +308,12 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(AudioUnitEffectOptionsDialog, wxDialog) +BEGIN_EVENT_TABLE(AudioUnitEffectOptionsDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, AudioUnitEffectOptionsDialog::OnOk) END_EVENT_TABLE() AudioUnitEffectOptionsDialog::AudioUnitEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host) -: wxDialog(parent, wxID_ANY, wxString(_("Audio Unit Effect Options"))) +: wxDialogWrapper(parent, wxID_ANY, wxString(_("Audio Unit Effect Options"))) { mHost = host; @@ -427,7 +427,7 @@ void AudioUnitEffectOptionsDialog::OnOk(wxCommandEvent & WXUNUSED(evt)) #define PRESET_LOCAL_PATH wxT("/Library/Audio/Presets") #define PRESET_USER_PATH wxT("~/Library/Audio/Presets") -class AudioUnitEffectExportDialog final : public wxDialog +class AudioUnitEffectExportDialog final : public wxDialogWrapper { public: AudioUnitEffectExportDialog(wxWindow * parent, AudioUnitEffect *effect); @@ -446,12 +446,12 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(AudioUnitEffectExportDialog, wxDialog) +BEGIN_EVENT_TABLE(AudioUnitEffectExportDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, AudioUnitEffectExportDialog::OnOk) END_EVENT_TABLE() AudioUnitEffectExportDialog::AudioUnitEffectExportDialog(wxWindow * parent, AudioUnitEffect *effect) -: wxDialog(parent, wxID_ANY, wxString(_("Export Audio Unit Presets"))) +: wxDialogWrapper(parent, wxID_ANY, wxString(_("Export Audio Unit Presets"))) { mEffect = effect; @@ -601,7 +601,7 @@ void AudioUnitEffectExportDialog::OnOk(wxCommandEvent & WXUNUSED(evt)) // /////////////////////////////////////////////////////////////////////////////// -class AudioUnitEffectImportDialog final : public wxDialog +class AudioUnitEffectImportDialog final : public wxDialogWrapper { public: AudioUnitEffectImportDialog(wxWindow * parent, AudioUnitEffect *effect); @@ -620,12 +620,12 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(AudioUnitEffectImportDialog, wxDialog) +BEGIN_EVENT_TABLE(AudioUnitEffectImportDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, AudioUnitEffectImportDialog::OnOk) END_EVENT_TABLE() AudioUnitEffectImportDialog::AudioUnitEffectImportDialog(wxWindow * parent, AudioUnitEffect *effect) -: wxDialog(parent, wxID_ANY, wxString(_("Import Audio Unit Presets"))) +: wxDialogWrapper(parent, wxID_ANY, wxString(_("Import Audio Unit Presets"))) { mEffect = effect; @@ -1750,7 +1750,7 @@ bool AudioUnitEffect::PopulateUI(wxWindow *parent) { OSStatus result; - mDialog = (wxDialog *) wxGetTopLevelParent(parent); + mDialog = static_cast(wxGetTopLevelParent(parent)); mParent = parent; wxPanel *container; diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 2468e0c5f..f6729ece6 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -52,6 +52,7 @@ effects from this one class. #include "../../Internat.h" #include "../../ShuttleGui.h" #include "../../widgets/valnum.h" +#include "../../widgets/wxPanelWrapper.h" // ============================================================================ // List of effects that ship with Audacity. These will be autoregistered. @@ -327,7 +328,7 @@ wxArrayString LadspaEffectsModule::GetSearchPaths() // /////////////////////////////////////////////////////////////////////////////// -class LadspaEffectOptionsDialog final : public wxDialog +class LadspaEffectOptionsDialog final : public wxDialogWrapper { public: LadspaEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host); @@ -344,12 +345,12 @@ private: DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(LadspaEffectOptionsDialog, wxDialog) +BEGIN_EVENT_TABLE(LadspaEffectOptionsDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, LadspaEffectOptionsDialog::OnOk) END_EVENT_TABLE() LadspaEffectOptionsDialog::LadspaEffectOptionsDialog(wxWindow * parent, EffectHostInterface *host) -: wxDialog(parent, wxID_ANY, wxString(_("LADSPA Effect Options"))) +: wxDialogWrapper(parent, wxID_ANY, wxString(_("LADSPA Effect Options"))) { mHost = host; diff --git a/src/effects/lv2/LV2Effect.cpp b/src/effects/lv2/LV2Effect.cpp index 94f997f82..6dd9a6a37 100644 --- a/src/effects/lv2/LV2Effect.cpp +++ b/src/effects/lv2/LV2Effect.cpp @@ -163,7 +163,7 @@ void LV2EffectMeter::OnSize(wxSizeEvent & WXUNUSED(evt)) // /////////////////////////////////////////////////////////////////////////////// -class LV2EffectSettingsDialog final : public wxDialog +class LV2EffectSettingsDialog final : public wxDialogWrapper { public: LV2EffectSettingsDialog(wxWindow *parent, LV2Effect *effect); @@ -181,12 +181,12 @@ private: DECLARE_EVENT_TABLE(); }; -BEGIN_EVENT_TABLE(LV2EffectSettingsDialog, wxDialog) +BEGIN_EVENT_TABLE(LV2EffectSettingsDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, LV2EffectSettingsDialog::OnOk) END_EVENT_TABLE() LV2EffectSettingsDialog::LV2EffectSettingsDialog(wxWindow *parent, LV2Effect *effect) -: wxDialog(parent, wxID_ANY, wxString(_("LV2 Effect Settings"))) +: wxDialogWrapper(parent, wxID_ANY, wxString(_("LV2 Effect Settings"))) { mEffect = effect; diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index f976aea44..dc0dea86a 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -2228,7 +2228,7 @@ void NyquistEffect::OnText(wxCommandEvent & evt) /////////////////////////////////////////////////////////////////////////////// -BEGIN_EVENT_TABLE(NyquistOutputDialog, wxDialog) +BEGIN_EVENT_TABLE(NyquistOutputDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, NyquistOutputDialog::OnOk) END_EVENT_TABLE() @@ -2236,7 +2236,7 @@ NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id, const wxString & title, const wxString & prompt, const wxString &message) -: wxDialog(parent, id, title) +: wxDialogWrapper(parent, id, title) { SetName(GetTitle()); diff --git a/src/effects/nyquist/Nyquist.h b/src/effects/nyquist/Nyquist.h index c804cd47f..3334034c2 100644 --- a/src/effects/nyquist/Nyquist.h +++ b/src/effects/nyquist/Nyquist.h @@ -242,7 +242,7 @@ private: friend class NyquistEffectsModule; }; -class NyquistOutputDialog final : public wxDialog +class NyquistOutputDialog final : public wxDialogWrapper { public: NyquistOutputDialog(wxWindow * parent, wxWindowID id, diff --git a/src/export/Export.cpp b/src/export/Export.cpp index 1a0ac4fda..b2518cc1e 100644 --- a/src/export/Export.cpp +++ b/src/export/Export.cpp @@ -1236,7 +1236,7 @@ enum ID_SLIDER_CHANNEL }; -BEGIN_EVENT_TABLE( ExportMixerDialog,wxDialog ) +BEGIN_EVENT_TABLE( ExportMixerDialog, wxDialogWrapper ) EVT_BUTTON( wxID_OK, ExportMixerDialog::OnOk ) EVT_BUTTON( wxID_CANCEL, ExportMixerDialog::OnCancel ) EVT_SIZE( ExportMixerDialog::OnSize ) @@ -1246,7 +1246,7 @@ END_EVENT_TABLE() ExportMixerDialog::ExportMixerDialog( const TrackList *tracks, bool selectedOnly, int maxNumChannels, wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ) : - wxDialog( parent, id, title, position, size, style | wxRESIZE_BORDER ) + wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER ) { SetName(GetTitle()); diff --git a/src/export/Export.h b/src/export/Export.h index a1c7d1dfb..5f1a4ccd7 100644 --- a/src/export/Export.h +++ b/src/export/Export.h @@ -248,7 +248,7 @@ private: //---------------------------------------------------------------------------- // ExportMixerDialog //---------------------------------------------------------------------------- -class ExportMixerDialog final : public wxDialog +class ExportMixerDialog final : public wxDialogWrapper { public: // constructors and destructors diff --git a/src/export/ExportCL.cpp b/src/export/ExportCL.cpp index d853ef863..68ee6f051 100644 --- a/src/export/ExportCL.cpp +++ b/src/export/ExportCL.cpp @@ -498,7 +498,7 @@ int ExportCL::Export(AudacityProject *project, // Display output on error or if the user wants to see it if (process.GetStatus() != 0 || show) { // TODO use ShowInfoDialog() instead. - wxDialog dlg(NULL, + wxDialogWrapper dlg(nullptr, wxID_ANY, wxString(_("Command Output")), wxDefaultPosition, diff --git a/src/export/ExportFFmpeg.cpp b/src/export/ExportFFmpeg.cpp index e38724e6c..d1bb63908 100644 --- a/src/export/ExportFFmpeg.cpp +++ b/src/export/ExportFFmpeg.cpp @@ -937,7 +937,7 @@ void ExportFFmpeg::SetMetadata(const Tags *tags, const char *name, const wxChar int ExportFFmpeg::AskResample(int bitrate, int rate, int lowrate, int highrate, const int *sampRates) { - wxDialog d(NULL, wxID_ANY, wxString(_("Invalid sample rate"))); + wxDialogWrapper d(nullptr, wxID_ANY, wxString(_("Invalid sample rate"))); d.SetName(d.GetTitle()); wxChoice *choice; ShuttleGui S(&d, eIsCreating); diff --git a/src/export/ExportFFmpegDialogs.cpp b/src/export/ExportFFmpegDialogs.cpp index b704e1e9b..c214afd16 100644 --- a/src/export/ExportFFmpegDialogs.cpp +++ b/src/export/ExportFFmpegDialogs.cpp @@ -874,7 +874,7 @@ void FFmpegPresets::WriteXML(XMLWriter &xmlFile) // ExportFFmpegOptions Class //---------------------------------------------------------------------------- -BEGIN_EVENT_TABLE(ExportFFmpegOptions, wxDialog) +BEGIN_EVENT_TABLE(ExportFFmpegOptions, wxDialogWrapper) EVT_BUTTON(wxID_OK,ExportFFmpegOptions::OnOK) EVT_LISTBOX(FEFormatID,ExportFFmpegOptions::OnFormatList) EVT_LISTBOX(FECodecID,ExportFFmpegOptions::OnCodecList) @@ -1303,7 +1303,7 @@ ExportFFmpegOptions::~ExportFFmpegOptions() } ExportFFmpegOptions::ExportFFmpegOptions(wxWindow *parent) -: wxDialog(parent, wxID_ANY, +: wxDialogWrapper(parent, wxID_ANY, wxString(_("Configure custom FFmpeg options"))) { SetName(GetTitle()); diff --git a/src/export/ExportFFmpegDialogs.h b/src/export/ExportFFmpegDialogs.h index 79ffe9a92..236e1bb07 100644 --- a/src/export/ExportFFmpegDialogs.h +++ b/src/export/ExportFFmpegDialogs.h @@ -176,7 +176,7 @@ struct ApplicableFor class FFmpegPresets; /// Custom FFmpeg export dialog -class ExportFFmpegOptions final : public wxDialog +class ExportFFmpegOptions final : public wxDialogWrapper { public: diff --git a/src/export/ExportMP3.cpp b/src/export/ExportMP3.cpp index 37a3a7e6c..d03d9cabf 100644 --- a/src/export/ExportMP3.cpp +++ b/src/export/ExportMP3.cpp @@ -580,14 +580,14 @@ int ExportMP3Options::FindIndex(CHOICES *choices, int cnt, int needle, int def) #define ID_BROWSE 5000 #define ID_DLOAD 5001 -class FindDialog final : public wxDialog +class FindDialog final : public wxDialogWrapper { public: #ifndef DISABLE_DYNAMIC_LOADING_LAME FindDialog(wxWindow *parent, wxString path, wxString name, wxString type) - : wxDialog(parent, wxID_ANY, + : wxDialogWrapper(parent, wxID_ANY, /* i18n-hint: LAME is the name of an MP3 converter and should not be translated*/ wxString(_("Locate Lame"))) { @@ -702,7 +702,7 @@ private: }; #ifndef DISABLE_DYNAMIC_LOADING_LAME -BEGIN_EVENT_TABLE(FindDialog, wxDialog) +BEGIN_EVENT_TABLE(FindDialog, wxDialogWrapper) EVT_BUTTON(ID_BROWSE, FindDialog::OnBrowse) EVT_BUTTON(ID_DLOAD, FindDialog::OnDownload) END_EVENT_TABLE() @@ -1928,7 +1928,7 @@ wxString ExportMP3::FindName(CHOICES *choices, int cnt, int needle) int ExportMP3::AskResample(int bitrate, int rate, int lowrate, int highrate) { - wxDialog d(NULL, wxID_ANY, wxString(_("Invalid sample rate"))); + wxDialogWrapper d(nullptr, wxID_ANY, wxString(_("Invalid sample rate"))); d.SetName(d.GetTitle()); wxChoice *choice; ShuttleGui S(&d, eIsCreating); diff --git a/src/export/ExportMultiple.cpp b/src/export/ExportMultiple.cpp index c2434f71f..6f0c9e9d4 100644 --- a/src/export/ExportMultiple.cpp +++ b/src/export/ExportMultiple.cpp @@ -77,7 +77,7 @@ enum { // ExportMultiple methods // -BEGIN_EVENT_TABLE(ExportMultiple, wxDialog) +BEGIN_EVENT_TABLE(ExportMultiple, wxDialogWrapper) EVT_CHOICE(FormatID, ExportMultiple::OnFormat) // EVT_BUTTON(OptionsID, ExportMultiple::OnOptions) EVT_BUTTON(CreateID, ExportMultiple::OnCreate) @@ -94,7 +94,7 @@ BEGIN_EVENT_TABLE(ExportMultiple, wxDialog) EVT_TEXT(PrefixID, ExportMultiple::OnPrefix) END_EVENT_TABLE() -BEGIN_EVENT_TABLE(SuccessDialog, wxDialog) +BEGIN_EVENT_TABLE(SuccessDialog, wxDialogWrapper) EVT_LIST_KEY_DOWN(wxID_ANY, SuccessDialog::OnKeyDown) EVT_LIST_ITEM_ACTIVATED(wxID_ANY, SuccessDialog::OnItemActivated) // happens when is pressed with list item having focus END_EVENT_TABLE() @@ -104,7 +104,7 @@ BEGIN_EVENT_TABLE(MouseEvtHandler, wxEvtHandler) END_EVENT_TABLE() ExportMultiple::ExportMultiple(AudacityProject *project) -: wxDialog(project, wxID_ANY, wxString(_("Export Multiple"))) +: wxDialogWrapper(project, wxID_ANY, wxString(_("Export Multiple"))) { SetName(GetTitle()); @@ -208,7 +208,7 @@ int ExportMultiple::ShowModal() EnableControls(); - return wxDialog::ShowModal(); + return wxDialogWrapper::ShowModal(); } void ExportMultiple::PopulateOrExchange(ShuttleGui& S) diff --git a/src/export/ExportMultiple.h b/src/export/ExportMultiple.h index 534545b69..7c454e592 100644 --- a/src/export/ExportMultiple.h +++ b/src/export/ExportMultiple.h @@ -30,7 +30,7 @@ class AudacityProject; class LabelTrack; class ShuttleGui; -class ExportMultiple final : public wxDialog +class ExportMultiple final : public wxDialogWrapper { public: @@ -163,11 +163,11 @@ private: }; -class SuccessDialog final : public wxDialog +class SuccessDialog final : public wxDialogWrapper { public: SuccessDialog(wxWindow *parent, wxWindowID id, const wxString &title) : - wxDialog(parent, id, title, wxDefaultPosition, + wxDialogWrapper(parent, id, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) {}; void OnKeyDown(wxListEvent& event); // dismisses dialog when is pressed with list control having focus void OnItemActivated(wxListEvent& event); // dismisses dialog when is pressed with list item having focus diff --git a/src/import/Import.cpp b/src/import/Import.cpp index 4d5d42ea7..0d8aba2b6 100644 --- a/src/import/Import.cpp +++ b/src/import/Import.cpp @@ -736,14 +736,14 @@ bool Importer::Import(const wxString &fName, // ImportStreamDialog //------------------------------------------------------------------------- -BEGIN_EVENT_TABLE( ImportStreamDialog,wxDialog ) +BEGIN_EVENT_TABLE( ImportStreamDialog, wxDialogWrapper ) EVT_BUTTON( wxID_OK, ImportStreamDialog::OnOk ) EVT_BUTTON( wxID_CANCEL, ImportStreamDialog::OnCancel ) END_EVENT_TABLE() ImportStreamDialog::ImportStreamDialog( ImportFileHandle *_mFile, wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ): -wxDialog( parent, id, title, position, size, style | wxRESIZE_BORDER ) +wxDialogWrapper( parent, id, title, position, size, style | wxRESIZE_BORDER ) { SetName(GetTitle()); diff --git a/src/import/Import.h b/src/import/Import.h index 7be685150..d4cbc3752 100644 --- a/src/import/Import.h +++ b/src/import/Import.h @@ -15,10 +15,11 @@ #include #include #include -#include #include #include +#include "../widgets/wxPanelWrapper.h" + class Tags; class TrackFactory; class Track; @@ -157,7 +158,7 @@ private: // ImportStreamDialog //---------------------------------------------------------------------------- -class ImportStreamDialog final : public wxDialog +class ImportStreamDialog final : public wxDialogWrapper { public: // constructors and destructors diff --git a/src/import/ImportPCM.cpp b/src/import/ImportPCM.cpp index f642fb878..11e7d57ba 100644 --- a/src/import/ImportPCM.cpp +++ b/src/import/ImportPCM.cpp @@ -242,7 +242,7 @@ static wxString AskCopyOrEdit() // check the current preferences for whether or not we should ask the user about this. if (oldAskPref) { wxString newCopyPref = wxT("copy"); - wxDialog dialog(NULL, -1, wxString(_("Warning"))); + wxDialogWrapper dialog(nullptr, -1, wxString(_("Warning"))); dialog.SetName(dialog.GetTitle()); wxBoxSizer *vbox; diff --git a/src/import/ImportRaw.cpp b/src/import/ImportRaw.cpp index 800325f11..183b12001 100644 --- a/src/import/ImportRaw.cpp +++ b/src/import/ImportRaw.cpp @@ -57,7 +57,7 @@ and sample size to help you importing data of an unknown format. #include "sndfile.h" -class ImportRawDialog final : public wxDialog { +class ImportRawDialog final : public wxDialogWrapper { public: ImportRawDialog(wxWindow * parent, @@ -293,7 +293,7 @@ enum { PlayID }; -BEGIN_EVENT_TABLE(ImportRawDialog, wxDialog) +BEGIN_EVENT_TABLE(ImportRawDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, ImportRawDialog::OnOK) EVT_BUTTON(wxID_CANCEL, ImportRawDialog::OnCancel) EVT_BUTTON(PlayID, ImportRawDialog::OnPlay) @@ -303,7 +303,7 @@ END_EVENT_TABLE() ImportRawDialog::ImportRawDialog(wxWindow * parent, int encoding, int channels, int offset, double rate) -: wxDialog(parent, wxID_ANY, _("Import Raw Data"), +: wxDialogWrapper(parent, wxID_ANY, _("Import Raw Data"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER), mEncoding(encoding), diff --git a/src/prefs/PrefsDialog.cpp b/src/prefs/PrefsDialog.cpp index 4898dd0ec..4d14e880f 100644 --- a/src/prefs/PrefsDialog.cpp +++ b/src/prefs/PrefsDialog.cpp @@ -68,14 +68,11 @@ #include "MidiIOPrefs.h" #endif -BEGIN_EVENT_TABLE(PrefsDialog, wxDialog) +BEGIN_EVENT_TABLE(PrefsDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, PrefsDialog::OnOK) 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() @@ -97,8 +94,8 @@ public: int wxTreebookExt::ChangeSelection(size_t n) { int i = wxTreebook::ChangeSelection(n); wxString Temp = GetPageText( n ); - ((wxDialog*)GetParent())->SetTitle( Temp ); - ((wxDialog*)GetParent())->SetName( Temp ); + static_cast(GetParent())->SetTitle( Temp ); + static_cast(GetParent())->SetName( Temp ); return i; }; @@ -106,8 +103,8 @@ int wxTreebookExt::SetSelection(size_t n) { int i = wxTreebook::SetSelection(n); wxString Temp = wxString(mTitlePrefix) + GetPageText( n ); - ((wxDialog*)GetParent())->SetTitle( Temp ); - ((wxDialog*)GetParent())->SetName( Temp ); + static_cast(GetParent())->SetTitle( Temp ); + static_cast(GetParent())->SetName( Temp ); PrefsPanel *const panel = static_cast(GetPage(n)); const bool showApply = panel->ShowsApplyButton(); @@ -202,7 +199,7 @@ PrefsDialog::Factories PrefsDialog::PrefsDialog (wxWindow * parent, const wxString &titlePrefix, Factories &factories) -: wxDialog(parent, wxID_ANY, wxString(_("Audacity Preferences")), +: wxDialogWrapper(parent, wxID_ANY, wxString(_("Audacity Preferences")), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) @@ -342,7 +339,7 @@ int PrefsDialog::ShowModal() SetName(Temp); } - return wxDialog::ShowModal(); + return wxDialogWrapper::ShowModal(); } void PrefsDialog::OnCancel(wxCommandEvent & WXUNUSED(event)) @@ -376,12 +373,6 @@ 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 - wxTabTraversalWrapperCharHook(event); -} - void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event)) { RecordExpansionState(); diff --git a/src/prefs/PrefsDialog.h b/src/prefs/PrefsDialog.h index fc4f30d2b..766b43d14 100644 --- a/src/prefs/PrefsDialog.h +++ b/src/prefs/PrefsDialog.h @@ -19,6 +19,7 @@ #include #include #include +#include "../widgets/wxPanelWrapper.h" class PrefsPanel; class PrefsPanelFactory; @@ -29,7 +30,7 @@ class PrefsPanelFactory; #define CONST const #endif -class PrefsDialog /* not final */ : public wxDialog +class PrefsDialog /* not final */ : public wxDialogWrapper { public: // An array of PrefsNode specifies the tree of pages in pre-order traversal. @@ -61,8 +62,6 @@ 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(), diff --git a/src/toolbars/DeviceToolBar.cpp b/src/toolbars/DeviceToolBar.cpp index ca63f0a66..fb7618e6d 100644 --- a/src/toolbars/DeviceToolBar.cpp +++ b/src/toolbars/DeviceToolBar.cpp @@ -794,7 +794,7 @@ void DeviceToolBar::ShowComboDialog(wxChoice *combo, const wxString &title) #if USE_PORTMIXER wxArrayString inputSources = combo->GetStrings(); - wxDialog dlg(NULL, wxID_ANY, title); + wxDialogWrapper dlg(nullptr, wxID_ANY, title); dlg.SetName(dlg.GetTitle()); ShuttleGui S(&dlg, eIsCreating); wxChoice *c; diff --git a/src/widgets/ASlider.cpp b/src/widgets/ASlider.cpp index b07341fd7..b4b60422e 100644 --- a/src/widgets/ASlider.cpp +++ b/src/widgets/ASlider.cpp @@ -178,7 +178,7 @@ void TipPanel::OnCreate(wxWindowCreateEvent & WXUNUSED(event)) // SliderDialog // -BEGIN_EVENT_TABLE(SliderDialog, wxDialog) +BEGIN_EVENT_TABLE(SliderDialog, wxDialogWrapper) EVT_SLIDER(wxID_ANY,SliderDialog::OnSlider) END_EVENT_TABLE(); @@ -190,7 +190,7 @@ SliderDialog::SliderDialog(wxWindow * parent, wxWindowID id, float value, float line, float page): - wxDialog(parent,id,title,position), + wxDialogWrapper(parent,id,title,position), mStyle(style) { SetName(GetTitle()); diff --git a/src/widgets/ASlider.h b/src/widgets/ASlider.h index 927741f81..08d8b0eb4 100644 --- a/src/widgets/ASlider.h +++ b/src/widgets/ASlider.h @@ -18,9 +18,9 @@ #include "../MemoryX.h" #include #include -#include #include #include +#include "widgets/wxPanelWrapper.h" #if wxUSE_ACCESSIBILITY #include @@ -330,7 +330,7 @@ public: // This is a modal dialog that contains an ASlider // and a text-entry box which can be used to set the // value of a slider. -class SliderDialog final : public wxDialog +class SliderDialog final : public wxDialogWrapper { public: SliderDialog(wxWindow * parent, wxWindowID id, diff --git a/src/widgets/ErrorDialog.cpp b/src/widgets/ErrorDialog.cpp index 737497ca4..34a9cb628 100644 --- a/src/widgets/ErrorDialog.cpp +++ b/src/widgets/ErrorDialog.cpp @@ -51,7 +51,7 @@ class AliasedFileMissingDialog final : public ErrorDialog virtual ~AliasedFileMissingDialog(); }; -BEGIN_EVENT_TABLE(ErrorDialog, wxDialog) +BEGIN_EVENT_TABLE(ErrorDialog, wxDialogWrapper) EVT_BUTTON( wxID_OK, ErrorDialog::OnOk) EVT_BUTTON( wxID_HELP, ErrorDialog::OnHelp) END_EVENT_TABLE() @@ -78,7 +78,7 @@ ErrorDialog::ErrorDialog( const wxString & message, const wxString & helpURL, const bool Close, const bool modal): - wxDialog(parent, (wxWindowID)-1, dlogTitle) + wxDialogWrapper(parent, (wxWindowID)-1, dlogTitle) { SetName(GetTitle()); diff --git a/src/widgets/ErrorDialog.h b/src/widgets/ErrorDialog.h index e0c759138..894b94482 100644 --- a/src/widgets/ErrorDialog.h +++ b/src/widgets/ErrorDialog.h @@ -15,10 +15,11 @@ #include "../Audacity.h" #include #include +#include "wxPanelWrapper.h" class AudacityProject; -class ErrorDialog /* not final */ : public wxDialog +class ErrorDialog /* not final */ : public wxDialogWrapper { public: // constructors and destructors diff --git a/src/widgets/ExpandingToolBar.cpp b/src/widgets/ExpandingToolBar.cpp index 796488159..6d94605e3 100644 --- a/src/widgets/ExpandingToolBar.cpp +++ b/src/widgets/ExpandingToolBar.cpp @@ -731,16 +731,16 @@ void ToolBarGrabber::OnSize(wxSizeEvent & WXUNUSED(event)) // ToolBarDialog // -BEGIN_EVENT_TABLE(ToolBarDialog, wxDialog) +BEGIN_EVENT_TABLE(ToolBarDialog, wxDialogWrapper) END_EVENT_TABLE() -IMPLEMENT_CLASS(ToolBarDialog, wxDialog) +IMPLEMENT_CLASS(ToolBarDialog, wxDialogWrapper) ToolBarDialog::ToolBarDialog(wxWindow* parent, wxWindowID id, const wxString& name, const wxPoint& pos): - wxDialog(parent, id, name, pos, wxSize(1, 1), + wxDialogWrapper(parent, id, name, pos, wxSize(1, 1), // Workaround for bug in __WXMSW__. No close box on a wxDialog unless wxSYSTEM_MENU is used. #ifdef __WXMSW__ wxSYSTEM_MENU | diff --git a/src/widgets/ExpandingToolBar.h b/src/widgets/ExpandingToolBar.h index 3696b0a81..355ffc8b2 100644 --- a/src/widgets/ExpandingToolBar.h +++ b/src/widgets/ExpandingToolBar.h @@ -145,7 +145,7 @@ class ToolBarGrabber final : public wxPanelWrapper DECLARE_EVENT_TABLE(); }; -class ToolBarDialog final : public wxDialog +class ToolBarDialog final : public wxDialogWrapper { public: DECLARE_DYNAMIC_CLASS(ToolBarDialog) diff --git a/src/widgets/HelpSystem.cpp b/src/widgets/HelpSystem.cpp index 750f20170..47fbe5b8f 100644 --- a/src/widgets/HelpSystem.cpp +++ b/src/widgets/HelpSystem.cpp @@ -57,7 +57,7 @@ void HelpSystem::ShowInfoDialog( wxWindow *parent, const wxString &message, const int xSize, const int ySize) { - wxDialog dlog(parent, wxID_ANY, + wxDialogWrapper dlog(parent, wxID_ANY, dlogTitle, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER | wxMAXIMIZE_BOX /*| wxDEFAULT_FRAME_STYLE */); diff --git a/src/widgets/LinkingHtmlWindow.cpp b/src/widgets/LinkingHtmlWindow.cpp index 88a5293c6..ab674fb3c 100644 --- a/src/widgets/LinkingHtmlWindow.cpp +++ b/src/widgets/LinkingHtmlWindow.cpp @@ -28,7 +28,7 @@ #include "ErrorDialog.h" #include "HelpSystem.h" -BEGIN_EVENT_TABLE(BrowserDialog, wxDialog) +BEGIN_EVENT_TABLE(BrowserDialog, wxDialogWrapper) EVT_BUTTON(wxID_FORWARD, BrowserDialog::OnForward) EVT_BUTTON(wxID_BACKWARD, BrowserDialog::OnBackward) EVT_BUTTON(wxID_CANCEL, BrowserDialog::OnClose) @@ -37,7 +37,7 @@ END_EVENT_TABLE() BrowserDialog::BrowserDialog(wxWindow *pParent, const wxString &title) - : wxDialog{ pParent, ID, title } + : wxDialogWrapper{ pParent, ID, title } { } diff --git a/src/widgets/LinkingHtmlWindow.h b/src/widgets/LinkingHtmlWindow.h index 851cb3310..c84fd7aff 100644 --- a/src/widgets/LinkingHtmlWindow.h +++ b/src/widgets/LinkingHtmlWindow.h @@ -16,11 +16,11 @@ #ifndef __AUDACITY_LINKINGHTMLWINDOW__ #define __AUDACITY_LINKINGHTMLWINDOW__ -#include #include #include #include "HtmlWindow.h" +#include "wxPanelWrapper.h" void OpenInDefaultBrowser(const wxHtmlLinkInfo& link); @@ -36,7 +36,7 @@ class AUDACITY_DLL_API LinkingHtmlWindow final : public HtmlWindow }; -class BrowserDialog /* not final */ : public wxDialog +class BrowserDialog /* not final */ : public wxDialogWrapper { public: enum { ID = 0 }; diff --git a/src/widgets/Meter.cpp b/src/widgets/Meter.cpp index 58ff19dc4..787a45f8c 100644 --- a/src/widgets/Meter.cpp +++ b/src/widgets/Meter.cpp @@ -1954,7 +1954,7 @@ void Meter::OnPreferences(wxCommandEvent & WXUNUSED(event)) // Dialog is a child of the project, rather than of the toolbar. // This determines where it pops up. - wxDialog dlg(GetActiveProject(), wxID_ANY, title); + wxDialogWrapper dlg(GetActiveProject(), wxID_ANY, title); dlg.SetName(dlg.GetTitle()); ShuttleGui S(&dlg, eIsCreating); S.StartVerticalLay(); diff --git a/src/widgets/MultiDialog.cpp b/src/widgets/MultiDialog.cpp index dae87af38..07bf9c642 100644 --- a/src/widgets/MultiDialog.cpp +++ b/src/widgets/MultiDialog.cpp @@ -33,7 +33,7 @@ for each problem encountered, since there can be many orphans. #include #include -class MultiDialog final : public wxDialog +class MultiDialog final : public wxDialogWrapper { public: MultiDialog(wxWindow * pParent, @@ -53,7 +53,7 @@ private: #define ID_SHOW_LOG_BUTTON 3333 -BEGIN_EVENT_TABLE(MultiDialog, wxDialog) +BEGIN_EVENT_TABLE(MultiDialog, wxDialogWrapper) EVT_BUTTON( wxID_OK, MultiDialog::OnOK ) EVT_BUTTON(ID_SHOW_LOG_BUTTON, MultiDialog::OnShowLog) END_EVENT_TABLE() @@ -62,7 +62,7 @@ MultiDialog::MultiDialog(wxWindow * pParent, wxString message, wxString title, const wxChar **buttons, wxString boxMsg, bool log) - : wxDialog(pParent, wxID_ANY, title, + : wxDialogWrapper(pParent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxCAPTION) // not wxDEFAULT_DIALOG_STYLE because we don't want wxCLOSE_BOX and wxSYSTEM_MENU { diff --git a/src/widgets/ProgressDialog.cpp b/src/widgets/ProgressDialog.cpp index df421bbf4..8766021c8 100644 --- a/src/widgets/ProgressDialog.cpp +++ b/src/widgets/ProgressDialog.cpp @@ -980,7 +980,7 @@ static const unsigned char beep[] = /// Methods for ProgressDialog //////////////////////////////////////////////////////////// -BEGIN_EVENT_TABLE(ProgressDialog, wxDialog) +BEGIN_EVENT_TABLE(ProgressDialog, wxDialogWrapper) EVT_BUTTON(wxID_CANCEL, ProgressDialog::OnCancel) EVT_BUTTON(wxID_OK, ProgressDialog::OnStop) EVT_CLOSE(ProgressDialog::OnCloseWindow) @@ -990,7 +990,7 @@ END_EVENT_TABLE() // Constructor // ProgressDialog::ProgressDialog() -: wxDialog() +: wxDialogWrapper() { Init(); } @@ -999,7 +999,7 @@ ProgressDialog::ProgressDialog(const wxString & title, const wxString & message /* = wxEmptyString*/, int flags /* = pdlgDefaultFlags */, const wxString & sRemainingLabelText /* = wxEmptyString */) -: wxDialog() +: wxDialogWrapper() { Init(); @@ -1082,7 +1082,7 @@ bool ProgressDialog::Create(const wxString & title, // Set this boolean to indicate if we confirm the Cancel/Stop actions m_bConfirmAction = (flags & pdlgConfirmStopCancel); - bool success = wxDialog::Create(parent, + bool success = wxDialogWrapper::Create(parent, wxID_ANY, title, wxDefaultPosition, @@ -1247,7 +1247,7 @@ bool ProgressDialog::Create(const wxString & title, SetTransparent(0); mIsTransparent = true; - wxDialog::Show(true); + wxDialogWrapper::Show(true); // Even though we won't necessarily show the dialog due to the 500ms // delay, we MUST disable other windows/menus anyway since we run the risk @@ -1335,7 +1335,7 @@ int ProgressDialog::Update(int value, const wxString & message) mLastUpdate = now; } - wxDialog::Update(); + wxDialogWrapper::Update(); // Copied from wx 3.0.2 generic progress dialog // @@ -1476,7 +1476,7 @@ void ProgressDialog::SetMessage(const wxString & message) // to the existing dimensions. ds.x = wxMax(wxMax(ds.x, mLastW), wxMax(ds.y, mLastH)); SetClientSize(ds); - wxDialog::Update(); + wxDialogWrapper::Update(); } } } diff --git a/src/widgets/ProgressDialog.h b/src/widgets/ProgressDialog.h index 092ab2e29..713f06e56 100644 --- a/src/widgets/ProgressDialog.h +++ b/src/widgets/ProgressDialog.h @@ -21,13 +21,14 @@ #include "../Audacity.h" #include -#include #include #include #include #include #include +#include "wxPanelWrapper.h" + enum { eProgressCancelled = 0, // #include #include -#include #include #include #include +#include "wxPanelWrapper.h" -class WarningDialog final : public wxDialog +class WarningDialog final : public wxDialogWrapper { public: // constructors and destructors @@ -47,12 +47,12 @@ class WarningDialog final : public wxDialog DECLARE_EVENT_TABLE() }; -BEGIN_EVENT_TABLE(WarningDialog, wxDialog) +BEGIN_EVENT_TABLE(WarningDialog, wxDialogWrapper) EVT_BUTTON(wxID_OK, WarningDialog::OnOK) END_EVENT_TABLE() WarningDialog::WarningDialog(wxWindow *parent, wxString message, bool showCancelButton) -: wxDialog(parent, wxID_ANY, (wxString)_("Warning"), +: wxDialogWrapper(parent, wxID_ANY, (wxString)_("Warning"), wxDefaultPosition, wxDefaultSize, (showCancelButton ? wxDEFAULT_DIALOG_STYLE : wxCAPTION | wxSYSTEM_MENU)) // Unlike wxDEFAULT_DIALOG_STYLE, no wxCLOSE_BOX. { diff --git a/src/widgets/wxPanelWrapper.h b/src/widgets/wxPanelWrapper.h index 106ea7384..f694d5655 100644 --- a/src/widgets/wxPanelWrapper.h +++ b/src/widgets/wxPanelWrapper.h @@ -11,6 +11,7 @@ #include #include +#include void wxTabTraversalWrapperCharHook(wxKeyEvent &event); @@ -34,5 +35,7 @@ public: class wxPanel; using wxPanelWrapper = wxTabTraversalWrapper; +class wxDialog; +using wxDialogWrapper = wxTabTraversalWrapper; #endif