From 7fb4652c884cdbbfc7aa3d24c026f5fc70358fe9 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sat, 23 May 2020 05:16:27 -0400 Subject: [PATCH] Remove some unused functions and forward declarations --- src/AudacityException.h | 2 - src/ProjectStatus.h | 1 - src/ShuttleGui.cpp | 60 ------------------------------ src/ShuttleGui.h | 9 ----- src/TrackInfo.h | 1 - src/commands/ScreenshotCommand.cpp | 38 ------------------- src/effects/Contrast.h | 1 - src/effects/NoiseRemoval.h | 1 - src/effects/ScoreAlignDialog.h | 1 - src/import/ImportMIDI.h | 1 - src/widgets/PopupMenuTable.h | 2 +- 11 files changed, 1 insertion(+), 116 deletions(-) diff --git a/src/AudacityException.h b/src/AudacityException.h index c7b97985d..eb70bc7ac 100644 --- a/src/AudacityException.h +++ b/src/AudacityException.h @@ -22,8 +22,6 @@ #include "Internat.h" -class wxString; - class AudacityException /* not final */ { public: diff --git a/src/ProjectStatus.h b/src/ProjectStatus.h index 8d6f52e35..8cd8921c4 100644 --- a/src/ProjectStatus.h +++ b/src/ProjectStatus.h @@ -18,7 +18,6 @@ Paul Licameli #include "ClientData.h" // to inherit class AudacityProject; -class wxString; class wxWindow; enum StatusBarField : int { diff --git a/src/ShuttleGui.cpp b/src/ShuttleGui.cpp index 447911f4b..c7a91fc00 100644 --- a/src/ShuttleGui.cpp +++ b/src/ShuttleGui.cpp @@ -851,25 +851,6 @@ ShuttleGuiBase & ShuttleGuiBase::Prop( int iProp ) return *this; } -wxMenuBar * ShuttleGuiBase::AddMenuBar( ) -{ - auto menuBar = std::make_unique(); - mpMenuBar = menuBar.get(); - - wxFrame * pFrame = (wxFrame*)mpParent; - pFrame->SetThemeEnabled( true ); - mpMenuBar->SetThemeEnabled( true ); - pFrame->SetMenuBar(menuBar.release()); - - return mpMenuBar; -} - -wxMenu * ShuttleGuiBase::AddMenu( const TranslatableString & Title ) -{ - mpMenuBar->Append( (mpMenu = safenew wxMenu), Title.Translation() ); - return mpMenu; -} - /// Starts a static box around a number of controls. /// @param Str The text of the title for the box. /// @param iProp The resizing proportion value. @@ -2239,47 +2220,6 @@ ShuttleGui & ShuttleGui::Optional( bool &bVar ){ }; -GuiWaveTrack * ShuttleGui::AddGuiWaveTrack( const wxString & WXUNUSED(Name)) -{ -#ifdef EXPERIMENTAL_TRACK_PANEL - UseUpId(); - if( mShuttleMode != eIsCreating ) - return (GuiWaveTrack*)NULL; -// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), GuiWaveTrack); - GuiWaveTrack * pGuiWaveTrack; - miProp=1; - mpWind = pGuiWaveTrack = safenew GuiWaveTrack(mpParent, miId, Name); - mpWind->SetMinSize(wxSize(100,50)); - UpdateSizers(); - return pGuiWaveTrack; -#else - return NULL; -#endif -} - -//#include "./widgets/AttachableScrollBar.h" -#if 0 -AttachableScrollBar * ShuttleGui::AddAttachableScrollBar( long style ) -{ - UseUpId(); - if( mShuttleMode != eIsCreating ) - return (AttachableScrollBar*)NULL; -// return wxDynamicCast(wxWindow::FindWindowById( miId, mpDlg), AttachableScrollBar); - AttachableScrollBar * pAttachableScrollBar; - miProp=0; - mpWind = pAttachableScrollBar = safenew AttachableScrollBar( - mpParent, - miId, - wxDefaultPosition, - wxDefaultSize, - style - ); - mpWind->SetMinSize(wxSize(10,20)); - UpdateSizers(); - return pAttachableScrollBar; -} -#endif - std::unique_ptr CreateStdButtonSizer(wxWindow *parent, long buttons, wxWindow *extra) { wxASSERT(parent != NULL); // To justify safenew diff --git a/src/ShuttleGui.h b/src/ShuttleGui.h index cfa1f8de1..cb820b5f3 100644 --- a/src/ShuttleGui.h +++ b/src/ShuttleGui.h @@ -66,8 +66,6 @@ class wxPanel; class wxSizer; class wxSizerItem; class wxStaticBox; -class wxMenuBar; -class wxMenu; class wxSpinCtrl; class wxListBox; class wxGrid; @@ -348,8 +346,6 @@ public: const TranslatableStrings &choices, int Selected = -1 ); wxChoice * AddChoice( const TranslatableString &Prompt, const TranslatableStrings &choices, const TranslatableString &selected ); - wxMenuBar * AddMenuBar( ); - wxMenu * AddMenu( const TranslatableString & Title ); void AddIcon( wxBitmap * pBmp); void AddFixedText( const TranslatableString & Str, bool bCenter = false, int wrapWidth = 0 ); @@ -558,8 +554,6 @@ protected: wxSizer * mpSizer; wxWindow * mpParent; wxWindow * mpWind; - wxMenuBar * mpMenuBar; - wxMenu * mpMenu; private: void DoDataShuttle( const wxString &Name, WrappedType & WrappedRef ); @@ -741,9 +735,6 @@ public: ShuttleGui &MinSize( wxSize sz ) { std::move( mItem ).MinSize( sz ); return *this; } - GuiWaveTrack * AddGuiWaveTrack( const wxString & Name); - AttachableScrollBar * AddAttachableScrollBar( long style = wxSB_HORIZONTAL ); - // The first of these buttons, if any, that is included will be default: // Apply, Yes, OK void AddStandardButtons( diff --git a/src/TrackInfo.h b/src/TrackInfo.h index ff6fcdf92..405ff9544 100644 --- a/src/TrackInfo.h +++ b/src/TrackInfo.h @@ -19,7 +19,6 @@ Paul Licameli split from TrackPanel.cpp class wxDC; class wxPoint; class wxRect; -class wxString; class wxWindow; class ButtonHandle; diff --git a/src/commands/ScreenshotCommand.cpp b/src/commands/ScreenshotCommand.cpp index 0891681a4..f28b34901 100644 --- a/src/commands/ScreenshotCommand.cpp +++ b/src/commands/ScreenshotCommand.cpp @@ -27,7 +27,6 @@ small calculations of rectangles. #include #include #include -#include #include #include #include @@ -363,43 +362,6 @@ bool ScreenshotCommand::CaptureDock( return Capture(context, FileName, win, wxRect(x, y, width, height)); } -void ExploreMenu( - const CommandContext & context, - wxMenu * pMenu, int Id, int depth ){ - static_cast(Id);//compiler food. - - if( !pMenu ) - return; - - wxMenuItemList list = pMenu->GetMenuItems(); - size_t lcnt = list.size(); - wxMenuItem * item; - wxString Label; - wxString Accel; - - for (size_t lndx = 0; lndx < lcnt; lndx++) { - item = list.Item(lndx)->GetData(); - Label = item->GetItemLabelText(); - Accel = item->GetItemLabel(); - if( Accel.Contains("\t") ) - Accel = Accel.AfterLast('\t'); - else - Accel = ""; - if( item->IsSeparator() ) - Label = "----"; - int flags = 0; - if (item->IsSubMenu()) - flags +=1; - if (item->IsCheck() && item->IsChecked()) - flags +=2; - - if (item->IsSubMenu()) { - pMenu = item->GetSubMenu(); - ExploreMenu( context, pMenu, item->GetId(), depth+1 ); - } - } -} - // Handed a dialog, which it is given the option to capture. bool ScreenshotCommand::MayCapture( wxDialog * pDlg ) { diff --git a/src/effects/Contrast.h b/src/effects/Contrast.h index f651912b7..423cc52b5 100644 --- a/src/effects/Contrast.h +++ b/src/effects/Contrast.h @@ -12,7 +12,6 @@ #include "../widgets/wxPanelWrapper.h" // to inherit class wxButton; -class wxString; class wxTextCtrl; class Envelope; diff --git a/src/effects/NoiseRemoval.h b/src/effects/NoiseRemoval.h index 5419e6a84..86e8845c7 100644 --- a/src/effects/NoiseRemoval.h +++ b/src/effects/NoiseRemoval.h @@ -24,7 +24,6 @@ class wxButton; class wxSizer; class wxSlider; -class wxString; class Envelope; class WaveTrack; diff --git a/src/effects/ScoreAlignDialog.h b/src/effects/ScoreAlignDialog.h index 79dc747aa..23965aaaf 100644 --- a/src/effects/ScoreAlignDialog.h +++ b/src/effects/ScoreAlignDialog.h @@ -55,7 +55,6 @@ extern int scorealign( class wxButton; class wxCheckBox; -class wxString; class wxSlider; class wxStaticText; diff --git a/src/import/ImportMIDI.h b/src/import/ImportMIDI.h index 3acb86c94..1cafd1f06 100644 --- a/src/import/ImportMIDI.h +++ b/src/import/ImportMIDI.h @@ -23,7 +23,6 @@ into a NoteTrack. #if defined(USE_MIDI) -class wxString; class AudacityProject; class NoteTrack; diff --git a/src/widgets/PopupMenuTable.h b/src/widgets/PopupMenuTable.h index eba8637ea..3e102e4f4 100644 --- a/src/widgets/PopupMenuTable.h +++ b/src/widgets/PopupMenuTable.h @@ -19,7 +19,7 @@ tables, and automatically attaches and detaches the event handlers. #define __AUDACITY_POPUP_MENU_TABLE__ class wxCommandEvent; -class wxString; + #include #include #include // to inherit wxMenu