[SCM] audacity/master: Compile audacity against wxWidgets 3.0

bdrung at users.alioth.debian.org bdrung at users.alioth.debian.org
Mon Oct 13 22:48:04 UTC 2014


The following commit has been merged in the master branch:
commit 6ae586349c1022d1ea011e2828db002100099b40
Author: Benjamin Drung <bdrung at debian.org>
Date:   Mon Oct 13 23:03:08 2014 +0200

    Compile audacity against wxWidgets 3.0
    
     Solved compilation issues:
     (1.) Allow wxWidgets 3.0 in various configure scripts.
     (2.) The file dialog was derived from an internal wx class that
     disappeared in wx3.0 (discussed in further detail below).
     (3.) In several places the types in interfaces changed between
     wxChar* and wxString. I've tried to modify the code so it works with
     both interfaces (thanks to implicit conversion; may look a bit weird
     in some places).
     (4.) Calls to "wxTheApp->SuspendIdleCallback()" are no longer
     supported. They were part of a workaround for a clipboard problem,
     which fortunately doesn't seem to be there any longer in wx3.0, so I
     deactivated it for wx3.0.
     (5.) AddPendingEvent() and ProcessEvent() now have the visibility
     "protected" in wxWindow. It has always been a bad idea to call them
     directly on a wxWindow object, but now it's explicitly forbidden.
     Instead, those functions should be called on the object returned by
     GetEventHandler().
     (6.) The class wxStandardPaths is now a singleton and has to be
     treated as such (no more explicit constructor calls).
     (7.) "wxLogWarning" is a macro now, so the "::" prefix doesn't work
     on it anymore.
     (8.) Several int types (which were actually used as enums) are now
     real enum types (e.g. wxRasterOperationMode, wxMouseButton) and have
     to be used as such.
     (9.) Apart from the FD constants (which have been fixed in Olly's
     patch already) there are some other constants which have received a
     prefix (e.g. wx* -> wxFONTFAMILY_*, wx* -> wxFONTSTYLE_*, wx* ->
     wxFONTWEIGHT_*).
     (10.) Signature changes in constructors of wxFlexGridSizer and wxIcon
     and wxSizeEvent
     (11.) Missing includes (missing header files were probably included
     indirectly in wx2.8 by chance)
     (12.) When deriving from the abstract class wxGridTableBase,
     different methods have to be implemented with wx3.0 (EndEdit with new
     signature and ApplyEdit) than before with wx2.8 (only EndEdit with
     old signature). Now both versions are implemented in parallel in the
     classes TimeEditor and ChoiceEditor (one version essentially being a
     wrapper of the other one).
     Solved runtime issues:
     (1.) Segmentation fault: The LadspaEffectDialog receives EVT_TEXT
     events before it's properly initialized. To prevent this, a
     workaround was already in place, but was only active on Windows. It
     looks like this happens now on more platforms (including GTK). As the
     workaround doesn't do any harm, even if activated unnecessarily, I've
     simply activated it for all environments.
     (2.) GTK critical warning "IA__gtk_range_set_range: assertion
     'min < max' failed" because of negative numbers as result of window
     size checking. Added a sanity check that straightens up the numbers
     in edge cases.
     (3.) GTK critical warning "IA__gdk_window_get_origin: assertion
     'GDK_IS_WINDOW (window)' failed": Received events of type wxSizeEvent
     on the main project window cause calls to "ClientToScreen" - which is
     not available until the window is first shown. So the class has to
     keep track of wxShowEvent events and inhibit those actions until the
     window is first shown.
     (4.) The functions wxString::Format and wxString::Printf have become
     stricter about parameter types that don't match (format string vs.
     function parameters). A systematic check of all occurrences was done
     to make sure all of them are fixed.
     (5.) Fix a segmentation fault that was due to an incorrect
     implementation of wxStaticCast. Use the C++ static_case as a
     workaround.
     (6.) Fix a segmentation fault due to double initialization of the
     classes wxNumberFormatter and wxNumValidator. Those classes had
     been copied from wxWidgets to audacity, but are included in
     wxWidgets 3.0, too. Use the original classes, if we compile
     against wxWidgets 3.0.
    
    Thanks: Martin Steghöfer <martin at steghoefer.eu>
    Closes: #749659

diff --git a/debian/control b/debian/control
index 46952c3..77ff236 100644
--- a/debian/control
+++ b/debian/control
@@ -30,7 +30,7 @@ Build-Depends: autoconf,
                libsoxr-dev (>= 0.0.5),
                libtwolame-dev (>= 0.3.9),
                libvorbis-dev (>= 1.0.0-3),
-               libwxgtk2.8-dev,
+               libwxgtk3.0-dev,
                portaudio19-dev (>= 19+svn20101113-3~),
                vamp-plugin-sdk (>= 2.0)
 Build-Conflicts: libwxbase2.6-dev, wx2.6-headers
diff --git a/debian/patches/backport-wx30-r13403.patch b/debian/patches/backport-wx30-r13403.patch
deleted file mode 100644
index 9b4c98b..0000000
--- a/debian/patches/backport-wx30-r13403.patch
+++ /dev/null
@@ -1,1419 +0,0 @@
-Description: Preliminary changes for wxWidgets 3.0.1
- We can't go to 3.0.1 yet as there are still build issues on
- Linux and OSX.  You can get Windows to build, but there's
- still some display issues.
- .
- These changes should work with wxWidgets 2.8.12 as well, so
- we can take our time to get things working properly before
- switching over.
-Origin: backport, https://code.google.com/p/audacity/source/detail?r=13403
-
---- a/configure.ac
-+++ b/configure.ac
-@@ -292,7 +292,7 @@
- AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
- 
- case "${wx_version}" in
--  2.8.*)
-+  2.8.* | 3.0.*)
-     echo "Great, you're using wxWidgets ${wx_version}!"
-     ;;
-   *)
---- a/lib-src/FileDialog/FileDialog.cpp
-+++ b/lib-src/FileDialog/FileDialog.cpp
-@@ -49,16 +49,16 @@
- // FileDialog convenience functions
- //----------------------------------------------------------------------------
- 
--wxString FileSelector(const wxChar *title,
--                      const wxChar *defaultDir,
--                      const wxChar *defaultFileName,
--                      const wxChar *defaultExtension,
--                      const wxChar *filter,
-+wxString FileSelector(const wxString & title,
-+                      const wxString & defaultDir,
-+                      const wxString & defaultFileName,
-+                      const wxString & defaultExtension,
-+                      const wxString & filter,
-                       int flags,
-                       wxWindow *parent,
-                       wxString label, fdCallback cb, void *cbdata)
- {
--   // The defaultExtension, if non-NULL, is
-+   // The defaultExtension, if non-empty, is
-    // appended to the filename if the user fails to type an extension. The new
-    // implementation (taken from wxFileSelectorEx) appends the extension
-    // automatically, by looking at the filter specification. In fact this
-@@ -70,21 +70,13 @@
-    // suitable filter.
- 
-    wxString filter2;
--   if (defaultExtension && !filter)
-+   if (!defaultExtension.empty() && filter.empty())
-       filter2 = wxString(wxT("*.")) + defaultExtension;
--   else if (filter)
-+   else if (!filter.empty())
-       filter2 = filter;
- 
--   wxString defaultDirString;
--   if (defaultDir)
--      defaultDirString = defaultDir;
--
--   wxString defaultFilenameString;
--   if (defaultFileName)
--      defaultFilenameString = defaultFileName;
--
--   FileDialog fileDialog(parent, title, defaultDirString,
--                         defaultFilenameString, filter2,
-+   FileDialog fileDialog(parent, title, defaultDir,
-+                         defaultFileName, filter2,
-                          flags);
- 
-    // Enable the extra button if desired
-@@ -94,7 +86,7 @@
-    }
- 
-    // if filter is of form "All files (*)|*|..." set correct filter index
--   if ((wxStrlen(defaultExtension) != 0) && (filter2.Find(wxT('|')) != wxNOT_FOUND))
-+   if (!defaultExtension.empty() && filter2.find(wxT('|')) != wxString::npos)
-    {
-       int filterIndex = 0;
-       
---- a/lib-src/FileDialog/FileDialog.h
-+++ b/lib-src/FileDialog/FileDialog.h
-@@ -43,11 +43,11 @@
- //----------------------------------------------------------------------------
- 
- wxString 
--FileSelector(const wxChar *message = wxFileSelectorPromptStr,
--             const wxChar *default_path = NULL,
--             const wxChar *default_filename = NULL,
--             const wxChar *default_extension = NULL,
--             const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
-+FileSelector(const wxString & message = wxFileSelectorPromptStr,
-+             const wxString & default_path = wxEmptyString,
-+             const wxString & default_filename = wxEmptyString,
-+             const wxString & default_extension = wxEmptyString,
-+             const wxString & wildcard = wxFileSelectorDefaultWildcardStr,
-              int flags = 0,
-              wxWindow *parent = NULL,
-              wxString label = wxEmptyString,
---- a/lib-src/FileDialog/win/FileDialogPrivate.cpp
-+++ b/lib-src/FileDialog/win/FileDialogPrivate.cpp
-@@ -209,7 +209,7 @@
-             {
-                CommDlg_OpenSave_SetControlText( hwndDialog,
-                                                pshHelp,
--                                               (LPTSTR)me->m_buttonlabel.c_str());
-+                                               (LPCTSTR)me->m_buttonlabel.c_str());
-             }
-          }
-          else if (CDN_HELP == (pNotifyCode->hdr).code)
-@@ -515,7 +515,7 @@
- void FileDialog::SetPath(const wxString& path)
- {
-    wxString ext;
--   wxSplitPath(path, &m_dir, &m_fileName, &ext);
-+   wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
-    if ( !ext.empty() )
-       m_fileName << wxT('.') << ext;
- }
-@@ -717,7 +717,7 @@
-       }
-    }
-    
--   of.lpstrFilter  = (LPTSTR)filterBuffer.c_str();
-+   of.lpstrFilter  = (LPCTSTR)filterBuffer.c_str();
-    of.nFilterIndex = m_filterIndex + 1;
-    
-    ParseFilter(of.nFilterIndex);
---- a/lib-src/lib-widget-extra/configure.ac
-+++ b/lib-src/lib-widget-extra/configure.ac
-@@ -131,7 +131,7 @@
- AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
- 
- case "${wx_version}" in
--  2.8.*)
-+  2.8.* | 3.0.*)
-     echo "Great, you're using wxWidgets ${wx_version}!"
-     ;;
-   *)
---- a/src/AudacityApp.cpp
-+++ b/src/AudacityApp.cpp
-@@ -606,7 +606,7 @@
-       if (!cmd.IsEmpty()) {
-          wxCommandEvent e(EVT_OPEN_AUDIO_FILE);
-          e.SetString(data);
--         project->AddPendingEvent(e);
-+         project->GetEventHandler()->AddPendingEvent(e);
-       }
- 
-       return true;
-@@ -1295,7 +1295,11 @@
-          }
- 
-          if (option < argc - 1 &&
--             argv[option + 1] &&
-+#if wxCHECK_VERSION(3,0,0)
-+            !argv[option + 1].IsEmpty() &&
-+#else
-+            argv[option + 1] &&
-+#endif
-              !wxString(wxT("-blocksize")).CmpNoCase(argv[option])) {
-             long theBlockSize;
-             if (wxString(argv[option + 1]).ToLong(&theBlockSize)) {
---- a/src/AudacityLogger.cpp
-+++ b/src/AudacityLogger.cpp
-@@ -286,7 +286,7 @@
-    wxString fName = _("log.txt");
- 
-    fName = FileSelector(_("Save log to:"),
--                        NULL,
-+                        wxEmptyString,
-                         fName,
-                         wxT("txt"),
-                         wxT("*.txt"),
---- a/src/Benchmark.cpp
-+++ b/src/Benchmark.cpp
-@@ -245,7 +245,7 @@
-    wxString fName = wxT("benchmark.txt");
- 
-    fName = FileSelector(wxT("Export Benchmark Data As:"),
--                        NULL, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
-+                        wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
- 
-    if (fName == wxT(""))
-       return;
---- a/src/FileIO.cpp
-+++ b/src/FileIO.cpp
-@@ -76,6 +76,7 @@
- void FileIO::SetCatalogInfo()
- {
- #ifdef __WXMAC__
-+#if !wxCHECK_VERSION(3, 0, 0)
-    if (!mOpen ) {
-       return;
-    }
-@@ -91,6 +92,7 @@
- 
-    SetCatalogInfo(type);
- #endif
-+#endif
- 
-    return;
- }
-@@ -98,6 +100,7 @@
- void FileIO::SetCatalogInfo(wxUint32 type)
- {
- #ifdef __WXMAC__
-+#if !wxCHECK_VERSION(3, 0, 0)
-    if (!mOpen ) {
-       return;
-    }
-@@ -106,6 +109,7 @@
- 
-    fn.MacSetTypeAndCreator(type, AUDACITY_CREATOR);
- #endif
-+#endif
- 
-    return;
- }
---- a/src/FreqWindow.cpp
-+++ b/src/FreqWindow.cpp
-@@ -43,10 +43,10 @@
- #pragma hdrstop
- #endif
- 
--#ifndef WX_PRECOMP
- #include <wx/brush.h>
- #include <wx/button.h>
- #include <wx/choice.h>
-+#include <wx/font.h>
- #include <wx/image.h>
- #include <wx/dcmemory.h>
- #include <wx/msgdlg.h>
-@@ -56,7 +56,6 @@
- #include <wx/sizer.h>
- #include <wx/stattext.h>
- #include <wx/statusbr.h>
--#endif
- 
- #include <wx/textfile.h>
- 
-@@ -124,7 +123,7 @@
-    if (!p)
-       return;
- 
--   mFreqFont = wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
-+   mFreqFont = wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-    mArrowCursor = new wxCursor(wxCURSOR_ARROW);
-    mCrossCursor = new wxCursor(wxCURSOR_CROSS);
- 
-@@ -1223,7 +1222,7 @@
-    wxString fName = _("spectrum.txt");
- 
-    fName = FileSelector(_("Export Spectral Data As:"),
--                        NULL, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
-+                        wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
- 
-    if (fName == wxT(""))
-       return;
---- a/src/Internat.cpp
-+++ b/src/Internat.cpp
-@@ -188,7 +188,7 @@
-          wxMessageBox(_("The specified filename could not be converted due to Unicode character use."));
- 
-          name = FileSelector(_("Specify New Filename:"),
--                             NULL,
-+                             wxEmptyString,
-                              name,
-                              f.GetExt(),
-                              wxT("*.") + f.GetExt(),
---- a/src/LabelDialog.cpp
-+++ b/src/LabelDialog.cpp
-@@ -565,7 +565,7 @@
-    wxString fName = mTrackNames[mTrackNames.GetCount() - 1].AfterFirst(wxT('-')).Mid(1);
- 
-    fName = FileSelector(_("Export Labels As:"),
--                        NULL,
-+                        wxEmptyString,
-                         fName.c_str(),
-                         wxT("txt"),
-                         wxT("*.txt"),
---- a/src/Lyrics.cpp
-+++ b/src/Lyrics.cpp
-@@ -230,12 +230,12 @@
- 
- void Lyrics::SetDrawnFont(wxDC *dc)
- {
--   dc->SetFont(wxFont(mKaraokeFontSize, wxSWISS, wxNORMAL, wxNORMAL));
-+   dc->SetFont(wxFont(mKaraokeFontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
- }
- 
- void Lyrics::SetHighlightFont() // for kHighlightLyrics
- {
--   wxFont newFont(mKaraokeFontSize, wxSWISS, wxNORMAL, wxNORMAL);
-+   wxFont newFont(mKaraokeFontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-    mHighlightTextCtrl->SetDefaultStyle(wxTextAttr(wxNullColour, wxNullColour, newFont));
-    mHighlightTextCtrl->SetStyle(0, mHighlightTextCtrl->GetLastPosition(),
-                                  wxTextAttr(wxNullColour, wxNullColour, newFont));
---- a/src/Menus.cpp
-+++ b/src/Menus.cpp
-@@ -2422,7 +2422,7 @@
-    //       The workaround is to queue a context menu event, allowing the key press
-    //       event to complete.
-    wxContextMenuEvent e(wxEVT_CONTEXT_MENU, GetId());
--   mTrackPanel->AddPendingEvent(e);
-+   mTrackPanel->GetEventHandler()->AddPendingEvent(e);
- }
- 
- void AudacityProject::OnTrackMute()
-@@ -2898,7 +2898,7 @@
-    }
- 
-    fName = FileSelector(_("Export Labels As:"),
--                        NULL,
-+                        wxEmptyString,
-                         fName,
-                         wxT("txt"),
-                         wxT("*.txt"),
-@@ -2979,7 +2979,7 @@
-       wxString fName = wxT("");
- 
-       fName = FileSelector(_("Export MIDI As:"),
--         NULL,
-+         wxEmptyString,
-          fName,
-          wxT(".mid|.gro"),
-          _("MIDI file (*.mid)|*.mid|Allegro file (*.gro)|*.gro"),
---- a/src/MixerBoard.cpp
-+++ b/src/MixerBoard.cpp
-@@ -331,8 +331,14 @@
-    #endif // wxUSE_TOOLTIPS
- 
-    #ifdef __WXMAC__
-+#if wxCHECK_VERSION(3, 0, 0)
-+      wxSizeEvent event(GetSize(), GetId());
-+      event.SetEventObject(this);
-+      GetEventHandler()->ProcessEvent(event);
-+#else
-       wxSizeEvent dummyEvent;
-       this->OnSize(dummyEvent);
-+#endif
-       UpdateGain();
-    #endif
- }
---- a/src/PitchName.h
-+++ b/src/PitchName.h
-@@ -18,7 +18,7 @@
- #ifndef __AUDACITY_PITCHNAME__
- #define __AUDACITY_PITCHNAME__
- 
--#include <wx/defs.h>
-+#include <wx/wx.h>
- 
- // FreqToMIDInote takes a frequency in Hz (exponential scale relative to
- // alphabetic pitch names) and returns a pitch ID number (linear
---- a/src/PlatformCompatibility.cpp
-+++ b/src/PlatformCompatibility.cpp
-@@ -37,9 +37,7 @@
-    static wxString path;
- 
-    if (!found) {
--      wxStandardPaths std;
--
--      path = std.GetExecutablePath();
-+      path = wxStandardPaths::Get().GetExecutablePath();
- 
-       found = true;
-    }
---- a/src/Project.cpp
-+++ b/src/Project.cpp
-@@ -85,9 +85,11 @@
- #include <wx/arrimpl.cpp>       // this allows for creation of wxObjArray
- 
- #if defined(__WXMAC__)
-+#if !wxCHECK_VERSION(3, 0, 0)
- #include <CoreServices/CoreServices.h>
- #include <wx/mac/private.h>
- #endif
-+#endif
- 
- #include "Project.h"
- 
-@@ -278,10 +280,12 @@
-       }
- 
- #if defined(__WXMAC__)
-+#if !wxCHECK_VERSION(3, 0, 0)
-       if (format.GetFormatId() == kDragPromisedFlavorFindFile) {
-          return true;
-       }
- #endif
-+#endif
- 
-       return false;
-    }
-@@ -305,6 +309,7 @@
-    bool GetData()
-    {
-       bool foundSupported = false;
-+#if !wxCHECK_VERSION(3, 0, 0)
-       bool firstFileAdded = false;
-       OSErr result;
- 
-@@ -356,13 +361,14 @@
-             break;
-          }
-       }
--
-+#endif
-       return foundSupported;
-    }
- 
-    bool OnDrop(wxCoord x, wxCoord y)
-    {
-       bool foundSupported = false;
-+#if !wxCHECK_VERSION(3, 0, 0)
-       bool firstFileAdded = false;
-       OSErr result;
- 
-@@ -387,7 +393,7 @@
-             return true;
-          }
-       }
--
-+#endif
-       return CurrentDragHasSupportedFormat();
-    }
- 
-@@ -1717,7 +1723,7 @@
-       wxCommandEvent e(EVT_CAPTURE_KEY);
-       e.SetEventObject(&event);
- 
--      if (w->ProcessEvent(e)) {
-+      if (w->GetEventHandler()->ProcessEvent(e)) {
-          return false;
-       }
-    }
-@@ -3261,9 +3267,11 @@
-    }
- 
- #ifdef __WXMAC__
-+#if !wxCHECK_VERSION(3, 0, 0)
-    wxFileName fn(mFileName);
-    fn.MacSetTypeAndCreator(AUDACITY_PROJECT_TYPE, AUDACITY_CREATOR);
- #endif
-+#endif
- 
-    if (bWantSaveCompressed)
-       mWantSaveCompressed = false; // Don't want this mode for AudacityProject::WriteXML() any more.
---- a/src/Sequence.cpp
-+++ b/src/Sequence.cpp
-@@ -1047,8 +1047,8 @@
-                _("Sequence has block file with length %s > mMaxSamples %s.\nTruncating to mMaxSamples."),
-                Internat::ToString(((wxLongLong)(bb->f->GetLength())).ToDouble(), 0).c_str(),
-                Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
--         ::wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
--         ::wxLogWarning(sMsg);
-+         wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
-+         wxLogWarning(sMsg);
-          bb->f->SetLength(mMaxSamples);
-       }
- 
---- a/src/Tags.cpp
-+++ b/src/Tags.cpp
-@@ -474,7 +474,7 @@
- 
-       while (*attrs) {
-          wxString attr = *attrs++;
--         if (!*attr)
-+         if (attr.IsEmpty())
-             break;
-          wxString value = *attrs++;
- 
---- a/src/TrackPanel.cpp
-+++ b/src/TrackPanel.cpp
-@@ -5124,7 +5124,7 @@
-       // The activate event is used to make the
-       // parent window 'come alive' if it didn't have focus.
-       wxActivateEvent e;
--      GetParent()->ProcessEvent(e);
-+      GetParent()->GetEventHandler()->ProcessEvent(e);
- 
-       // wxTimers seem to be a little unreliable, so this
-       // "primes" it to make sure it keeps going for a while...
-@@ -5562,7 +5562,7 @@
-    int trackKind = pTrack->GetKind();
-    currentTool = selectTool; // the default.
- 
--   if( event.ButtonIsDown(3) || event.RightUp()){
-+   if (event.ButtonIsDown(wxMOUSE_BTN_RIGHT) || event.RightUp()){
-       currentTool = zoomTool;
-    } else if( trackKind == Track::Time ){
-       currentTool = envelopeTool;
-@@ -8382,7 +8382,7 @@
-    mSliderOffset = 0;
- 
-    int fontSize = 10;
--   mFont.Create(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
-+   mFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
- 
-    int allowableWidth = GetTrackInfoWidth() - 2; // 2 to allow for left/right borders
-    int textWidth, textHeight;
---- a/src/TrackPanelAx.cpp
-+++ b/src/TrackPanelAx.cpp
-@@ -307,20 +307,20 @@
-          {
-             /* i18n-hint: This is for screen reader software and indicates that
-                on this track mute is on.*/
--            *name->Append( _( " Mute On" ) );
-+            name->Append( _( " Mute On" ) );
-          }
- 
-          if( t->GetSolo() )
-          {
-             /* i18n-hint: This is for screen reader software and indicates that
-                on this track solo is on.*/
--            *name->Append( _( " Solo On" ) );
-+            name->Append( _( " Solo On" ) );
-          }
-          if( t->GetSelected() )
-          {
-             /* i18n-hint: This is for screen reader software and indicates that
-                this track is selected.*/
--            *name->Append( _( " Select On" ) );
-+            name->Append( _( " Select On" ) );
-          }
-          if( t->IsSyncLockSelected() )
-          {
-@@ -328,7 +328,7 @@
-                this track is shown with a sync-locked icon.*/
-             // The absence of a dash between Sync and Locked is deliberate -
-             // if present, Jaws reads it as "dash".
--            *name->Append( _( " Sync Lock Selected" ) );
-+            name->Append( _( " Sync Lock Selected" ) );
-          }
-       }
-    }
---- a/src/commands/ScriptCommandRelay.cpp
-+++ b/src/commands/ScriptCommandRelay.cpp
-@@ -57,7 +57,7 @@
-    wxASSERT(cmd != NULL);
-    AppCommandEvent ev;
-    ev.SetCommand(cmd);
--   project->AddPendingEvent(ev);
-+   project->GetEventHandler()->AddPendingEvent(ev);
- }
- 
- /// This is the function which actually obeys one command.  Rather than applying
---- a/src/effects/BassTreble.cpp
-+++ b/src/effects/BassTreble.cpp
-@@ -35,6 +35,7 @@
- #include <wx/checkbox.h>
- #include <wx/slider.h>
- #include <wx/sizer.h>
-+#include <wx/textctrl.h>
- 
- // Used to communicate the type of the filter.
- static const int bassType = 0; //Low Shelf
---- a/src/effects/Compressor.h
-+++ b/src/effects/Compressor.h
-@@ -14,6 +14,8 @@
- class wxString;
- 
- #include <wx/defs.h>
-+#include <wx/dc.h>
-+#include <wx/dcclient.h>
- #include <wx/bitmap.h>
- #include <wx/button.h>
- #include <wx/checkbox.h>
---- a/src/effects/Contrast.cpp
-+++ b/src/effects/Contrast.cpp
-@@ -496,7 +496,7 @@
-    wxString fName = wxT("contrast.txt");
- 
-    fName = FileSelector(_("Export Contrast Result As:"),
--                        NULL, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
-+                        wxEmptyString, fName, wxT("txt"), wxT("*.txt"), wxFD_SAVE | wxRESIZE_BORDER, this);
- 
-    if (fName == wxT(""))
-       return;
---- a/src/effects/VST/VSTEffect.cpp
-+++ b/src/effects/VST/VSTEffect.cpp
-@@ -3579,7 +3579,7 @@
-       wxCommandEvent sw(EVT_SIZEWINDOW);
-       sw.SetInt(w);
-       sw.SetExtraLong(h);
--      mDlg->AddPendingEvent(sw);
-+      mDlg->GetEventHandler()->AddPendingEvent(sw);
-    }
- 
-    return;
-@@ -3590,7 +3590,7 @@
-    // Tell the dialog to refresh effect information
-    if (mDlg) {
-       wxCommandEvent ud(EVT_UPDATEDISPLAY);
--      mDlg->AddPendingEvent(ud);
-+      mDlg->GetEventHandler()->AddPendingEvent(ud);
-    }
- }
- 
---- a/src/effects/nyquist/Nyquist.cpp
-+++ b/src/effects/nyquist/Nyquist.cpp
-@@ -703,7 +703,7 @@
-          // See also http://bugzilla.audacityteam.org/show_bug.cgi?id=642#c9
-          // for further info about this thread safety question.
-          wxString prevlocale = wxSetlocale(LC_NUMERIC, NULL);
--         wxSetlocale(LC_NUMERIC, wxT("C"));
-+         wxSetlocale(LC_NUMERIC, wxString(wxT("C")));
- 
-          nyx_init();
-          nyx_set_os_callback(StaticOSCallback, (void *)this);
---- a/src/export/ExportPCM.cpp
-+++ b/src/export/ExportPCM.cpp
-@@ -587,10 +587,12 @@
-       AddID3Chunk(fName, metadata, sf_format);
- 
- #ifdef __WXMAC__
-+#if !wxCHECK_VERSION(3, 0, 0)
-    wxFileName fn(fName);
-    fn.MacSetTypeAndCreator(sf_header_mactype(sf_format & SF_FORMAT_TYPEMASK),
-                            AUDACITY_CREATOR);
- #endif
-+#endif
- 
-    return updateResult;
- }
---- a/src/import/ImportRaw.cpp
-+++ b/src/import/ImportRaw.cpp
-@@ -337,7 +337,7 @@
- 
-       if (sf_format_check(&info)) {
-          mEncodingSubtype[mNumEncodings] = subtype;
--         encodings.Add(LAT1CTOWX(sf_encoding_index_name(i)));
-+         encodings.Add(sf_encoding_index_name(i));
- 
-          if ((mEncoding & SF_FORMAT_SUBMASK) == subtype)
-             selection = mNumEncodings;
---- a/src/ondemand/ODManager.cpp
-+++ b/src/ondemand/ODManager.cpp
-@@ -311,7 +311,7 @@
-          AudacityProject::AllProjectsDeleteLock();
-          AudacityProject* proj = GetActiveProject();
-          if(proj)
--            proj->AddPendingEvent( event );
-+            proj->GetEventHandler()->AddPendingEvent(event);
-          AudacityProject::AllProjectsDeleteUnlock();
-       }
-       mTerminateMutex.Lock();
---- a/src/ondemand/ODTask.cpp
-+++ b/src/ondemand/ODTask.cpp
-@@ -158,7 +158,7 @@
-          if(IsTaskAssociatedWithProject(gAudacityProjects[i]))
-          {
-             //this assumes tasks are only associated with one project.
--            gAudacityProjects[i]->AddPendingEvent( event );
-+            gAudacityProjects[i]->GetEventHandler()->AddPendingEvent(event);
-             //mark the changes so that the project can be resaved.
-             gAudacityProjects[i]->GetUndoManager()->SetODChangesFlag();
-             break;
---- a/src/prefs/KeyConfigPrefs.cpp
-+++ b/src/prefs/KeyConfigPrefs.cpp
-@@ -420,7 +420,7 @@
-       nevent.SetDirection(!e.ShiftDown());
-       nevent.SetEventObject(t);
-       nevent.SetCurrentFocus(t);
--      t->GetParent()->ProcessEvent(nevent);
-+      t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
-       return;
-    }
- 
-@@ -465,7 +465,7 @@
-       nevent.SetDirection(!e.ShiftDown());
-       nevent.SetEventObject(t);
-       nevent.SetCurrentFocus(t);
--      t->GetParent()->ProcessEvent(nevent);
-+      t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
- 
-       return;
-    }
---- a/src/toolbars/ControlToolBar.cpp
-+++ b/src/toolbars/ControlToolBar.cpp
-@@ -607,9 +607,14 @@
-       }
-       else {
-          // msmeyer: Show error message if stream could not be opened
--         wxMessageBox(_(
--            "Error while opening sound device. "
-+         wxMessageBox(
-+#if wxCHECK_VERSION(3,0,0)
-+            _("Error while opening sound device. "
-+            "Please check the playback device settings and the project sample rate."),
-+#else
-+            _("Error while opening sound device. "
-             wxT("Please check the playback device settings and the project sample rate.")),
-+#endif
-             _("Error"), wxOK | wxICON_EXCLAMATION, this);
-       }
-    }
---- a/src/toolbars/DeviceToolBar.cpp
-+++ b/src/toolbars/DeviceToolBar.cpp
-@@ -72,8 +72,14 @@
-    ToolBar::Create(parent);
- 
-    // Simulate a size event to set initial meter placement/size
-+#if wxCHECK_VERSION(3, 0, 0)
-+   wxSizeEvent event(GetSize(), GetId());
-+   event.SetEventObject(this);
-+   GetEventHandler()->ProcessEvent(event);
-+#else
-    wxSizeEvent dummy;
-    OnSize(dummy);
-+#endif
- }
- 
- void DeviceToolBar::RecreateTipWindows()
---- a/src/toolbars/SelectionBar.cpp
-+++ b/src/toolbars/SelectionBar.cpp
-@@ -106,7 +106,7 @@
- void SelectionBar::Populate()
- {
-    // This will be inherited by all children:
--   SetFont(wxFont(9, wxSWISS, wxNORMAL, wxNORMAL));
-+   SetFont(wxFont(9, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
- 
-    wxFlexGridSizer *mainSizer;
-    wxBoxSizer *hSizer;
---- a/src/toolbars/ToolManager.cpp
-+++ b/src/toolbars/ToolManager.cpp
-@@ -47,10 +47,6 @@
- #include <wx/minifram.h>
- #include <wx/popupwin.h>
- 
--#if defined(__WXMAC__)
--#include <wx/mac/uma.h>
--#endif
--
- #include "ToolManager.h"
- #include "ControlToolBar.h"
- #include "DeviceToolBar.h"
-@@ -744,7 +740,7 @@
-       int bo = mBotDock->GetOrder( bar );
- 
-       // Save
--      gPrefs->Write( wxT("Dock"), to ? TopDockID : bo ? BotDockID : NoDockID );
-+      gPrefs->Write( wxT("Dock"), (int) (to ? TopDockID : bo ? BotDockID : NoDockID ));
-       gPrefs->Write( wxT("Order"), to + bo );
-       gPrefs->Write( wxT("Show"), IsVisible( ndx ) );
- 
---- a/src/toolbars/ToolsToolBar.cpp
-+++ b/src/toolbars/ToolsToolBar.cpp
-@@ -57,23 +57,6 @@
- 
- IMPLEMENT_CLASS(ToolsToolBar, ToolBar);
- 
--// Strings to convert a tool number into a status message
--// These MUST be in the same order as the ids above.
--static const wxChar * MessageOfTool[numTools] = {
--   wxTRANSLATE("Click and drag to select audio"),
--   wxTRANSLATE("Click and drag to edit the amplitude envelope"),
--   wxTRANSLATE("Click and drag to edit the samples"),
--#if defined( __WXMAC__ )
--   wxTRANSLATE("Click to Zoom In, Shift-Click to Zoom Out"),
--#elif defined( __WXMSW__ )
--   wxTRANSLATE("Drag to Zoom Into Region, Right-Click to Zoom Out"),
--#elif defined( __WXGTK__ )
--   wxTRANSLATE("Left=Zoom In, Right=Zoom Out, Middle=Normal"),
--#endif
--   wxTRANSLATE("Click and drag to move a track in time"),
--   wxT("") // multi-mode tool
--};
--
- ////////////////////////////////////////////////////////////
- /// Methods for ToolsToolBar
- ////////////////////////////////////////////////////////////
-@@ -96,6 +79,19 @@
-    wxASSERT( zoomTool     == zoomTool     - firstTool );
-    wxASSERT( drawTool     == drawTool     - firstTool );
-    wxASSERT( multiTool    == multiTool    - firstTool );
-+
-+   mMessageOfTool[selectTool] = _("Click and drag to select audio");
-+   mMessageOfTool[envelopeTool] = _("Click and drag to edit the amplitude envelope");
-+   mMessageOfTool[slideTool] = _("Click and drag to edit the samples");
-+#if defined( __WXMAC__ )
-+   mMessageOfTool[zoomTool] = _("Click to Zoom In, Shift-Click to Zoom Out");
-+#elif defined( __WXMSW__ )
-+   mMessageOfTool[zoomTool] = _("Drag to Zoom Into Region, Right-Click to Zoom Out");
-+#elif defined( __WXGTK__ )
-+   mMessageOfTool[zoomTool] = _("Left=Zoom In, Right=Zoom Out, Middle=Normal");
-+#endif
-+   mMessageOfTool[drawTool] = _("Click and drag to move a track in time");
-+   mMessageOfTool[multiTool] = wxT(""); // multi-mode tool
- }
- 
- ToolsToolBar::~ToolsToolBar()
-@@ -258,7 +254,8 @@
- {
-    wxASSERT( ToolNumber >= 0 );
-    wxASSERT( ToolNumber < numTools );
--   return wxGetTranslation(MessageOfTool[ ToolNumber ]);
-+
-+   return mMessageOfTool[ToolNumber];
- }
- 
- 
---- a/src/toolbars/ToolsToolBar.h
-+++ b/src/toolbars/ToolsToolBar.h
-@@ -79,6 +79,8 @@
-    wxGridSizer *mToolSizer;
-    int mCurrentTool;
- 
-+   const wxChar *mMessageOfTool[numTools];
-+
-  public:
- 
-    DECLARE_CLASS(ToolsToolBar);
---- a/src/widgets/ASlider.cpp
-+++ b/src/widgets/ASlider.cpp
-@@ -1191,7 +1191,7 @@
-                nevent.SetDirection( !event.ShiftDown() );
-                nevent.SetEventObject( mParent );
-                nevent.SetCurrentFocus( mParent );
--               mParent->GetParent()->ProcessEvent( nevent );
-+               mParent->GetParent()->GetEventHandler()->ProcessEvent(nevent);
-             }
-             break;
- 
-@@ -1203,7 +1203,7 @@
-                if (def && def->IsEnabled()) {
-                   wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
-                         def->GetId());
--                  mParent->ProcessEvent(cevent);
-+                  mParent->GetEventHandler()->ProcessEvent(cevent);
-                }
-             }
- 
-@@ -1228,7 +1228,7 @@
-    int intValue = (int)( ( mCurrentValue - mMinValue ) * 1000.0f /
-                          ( mMaxValue - mMinValue ) );
-    e.SetInt( intValue );
--   mParent->ProcessEvent( e );
-+   mParent->GetEventHandler()->ProcessEvent(e);
- }
- 
- int LWSlider::ValueToPosition(float val)
---- a/src/widgets/ExpandingToolBar.cpp
-+++ b/src/widgets/ExpandingToolBar.cpp
-@@ -72,6 +72,7 @@
- #include <wx/window.h>
- #endif
- 
-+#include <wx/wx.h>
- #include <wx/dcmemory.h>
- #include <wx/log.h>
- #include <wx/dragimag.h>
---- a/src/widgets/Grabber.cpp
-+++ b/src/widgets/Grabber.cpp
-@@ -89,7 +89,7 @@
-    e.SetEventObject(parent);
- 
-    // Queue the event
--   parent->AddPendingEvent(e);
-+   parent->GetEventHandler()->AddPendingEvent(e);
- }
- 
- //
---- a/src/widgets/Grid.cpp
-+++ b/src/widgets/Grid.cpp
-@@ -79,6 +79,28 @@
-    GetTimeCtrl()->SetFocus();
- }
- 
-+#if wxCHECK_VERSION(3,0,0)
-+
-+bool TimeEditor::EndEdit(int WXUNUSED(row), int WXUNUSED(col), const wxGrid *WXUNUSED(grid), const wxString & WXUNUSED(oldval), wxString *newval)
-+{
-+   double newtime = GetTimeCtrl()->GetTimeValue();
-+   bool changed = newtime != mOld;
-+
-+   if (changed) {
-+      mNew = newtime;
-+      *newval = wxString::Format(wxT("%g"), newtime);
-+   }
-+
-+   return changed;
-+}
-+
-+void TimeEditor::ApplyEdit(int row, int col, wxGrid *grid)
-+{
-+   grid->GetTable()->SetValue(row, col, wxString::Format(wxT("%g"), mNew));
-+}
-+
-+#else
-+
- bool TimeEditor::EndEdit(int row, int col, wxGrid *grid)
- {
-    double newtime = GetTimeCtrl()->GetTimeValue();
-@@ -91,6 +113,8 @@
-    return changed;
- }
- 
-+#endif
-+
- void TimeEditor::Reset()
- {
-    GetTimeCtrl()->SetTimeValue(mOld);
-@@ -295,8 +319,40 @@
-    Choice()->SetFocus();
- }
- 
-+#if wxCHECK_VERSION(3,0,0)
-+
-+bool ChoiceEditor::EndEdit(int WXUNUSED(row), int WXUNUSED(col), const wxGrid* WXUNUSED(grid), const wxString & WXUNUSED(oldval), wxString *newval)
-+{
-+   int sel = Choice()->GetSelection();
-+
-+   // This can happen if the wxChoice control is displayed and the list of choices get changed
-+   if ((sel < 0) || (sel >= (int)(mChoices.GetCount())))
-+   {
-+      return false;
-+   }
-+
-+   wxString val = mChoices[sel];
-+   if (val == mOld)
-+   {
-+      return false;
-+   }
-+
-+   *newval = val;
-+
-+   mNew = val;
-+
-+   return true;
-+}
-+
-+void ChoiceEditor::ApplyEdit(int row, int col, wxGrid *grid)
-+{
-+   grid->GetTable()->SetValue(row, col, mNew);
-+}
-+
-+#else
-+
- bool ChoiceEditor::EndEdit(int row, int col,
--                           wxGrid* grid)
-+   wxGrid* grid)
- {
-    int sel = Choice()->GetSelection();
- 
-@@ -315,6 +371,8 @@
-    return true;
- }
- 
-+#endif
-+
- void ChoiceEditor::Reset()
- {
-    Choice()->SetSelection(mChoices.Index(mOld));
-@@ -491,7 +549,7 @@
-             if (def && def->IsEnabled()) {
-                wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
-                                      def->GetId());
--               GetParent()->ProcessEvent(cevent);
-+               GetParent()->GetEventHandler()->ProcessEvent(cevent);
-             }
-          }
-          else {
---- a/src/widgets/Grid.h
-+++ b/src/widgets/Grid.h
-@@ -52,7 +52,14 @@
-    void SetSize(const wxRect &rect);
- 
-    void BeginEdit(int row, int col, wxGrid *grid);
-+
-+#if wxCHECK_VERSION(3,0,0)
-+   bool EndEdit(int row, int col, const wxGrid *grid,
-+      const wxString & oldval, wxString *newval);
-+   void ApplyEdit(int, int, wxGrid *);
-+#else
-    bool EndEdit(int row, int col, wxGrid *grid);
-+#endif
- 
-    void Reset();
- 
-@@ -71,6 +78,7 @@
-    wxString mFormat;
-    double mRate;
-    double mOld;
-+   double mNew;
- };
- 
- // ----------------------------------------------------------------------------
-@@ -124,7 +132,14 @@
-    void SetSize(const wxRect &rect);
- 
-    void BeginEdit(int row, int col, wxGrid *grid);
-+
-+#if wxCHECK_VERSION(3,0,0)
-+   bool EndEdit(int row, int col, const wxGrid *grid,
-+      const wxString & oldval, wxString *newval);
-+   void ApplyEdit(int, int, wxGrid *);
-+#else
-    bool EndEdit(int row, int col, wxGrid *grid);
-+#endif
- 
-    void Reset();
- 
-@@ -159,6 +174,7 @@
- 
-    wxArrayString mChoices;
-    wxString mOld;
-+   wxString mNew;
- };
- 
- // ----------------------------------------------------------------------------
---- a/src/widgets/ImageRoll.cpp
-+++ b/src/widgets/ImageRoll.cpp
-@@ -96,6 +96,7 @@
- 
- #include "ImageRoll.h"
- 
-+#include <wx/wx.h>
- #include <wx/arrimpl.cpp>
- #include <wx/bitmap.h>
- #include <wx/dcmemory.h>
-@@ -299,7 +300,7 @@
- }
- 
- void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
--                           int x, int y, int logicalFunc)
-+                           int x, int y, wxRasterOperationMode logicalFunc)
- {
-    if (logicalFunc == wxCOPY)
-       dc.DrawBitmap(bitmap, x, y);
---- a/src/widgets/ImageRoll.h
-+++ b/src/widgets/ImageRoll.h
-@@ -12,10 +12,15 @@
- #ifndef __AUDACITY_IMAGE_ROLL__
- #define __AUDACITY_IMAGE_ROLL__
- 
-+#include <wx/dc.h>
- #include <wx/defs.h>
- #include <wx/dynarray.h>
- #include <wx/panel.h>
- 
-+#if !wxCHECK_VERSION(3,0,0)
-+#define wxRasterOperationMode int
-+#endif
-+
- WX_DECLARE_OBJARRAY(wxBitmap, BitmapArray);
- WX_DECLARE_OBJARRAY(wxImage, ImageArray);
- 
-@@ -48,7 +53,7 @@
-  protected:
- 
-    void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
--                   int x, int y, int logicalFunc = wxCOPY);
-+                   int x, int y, wxRasterOperationMode logicalFunc = wxCOPY);
- 
-    void Init(RollType type, const wxImage &src, wxColour magicColor);
- 
---- a/src/widgets/Meter.cpp
-+++ b/src/widgets/Meter.cpp
-@@ -52,10 +52,6 @@
- #include <wx/tooltip.h>
- #include <wx/msgdlg.h>
- 
--#if defined(__WXMAC__)
--#include <wx/mac/uma.h>
--#endif
--
- #include <math.h>
- 
- #include "Meter.h"
-@@ -746,7 +742,7 @@
-    fontSize = 8;
- #endif
- 
--   return wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
-+   return wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
- }
- 
- void Meter::ResetBar(MeterBar *b, bool resetClipping)
---- a/src/widgets/Ruler.cpp
-+++ b/src/widgets/Ruler.cpp
-@@ -116,9 +116,9 @@
-    fontSize = 8;
- #endif
- 
--   mMinorMinorFont = new wxFont(fontSize-1, wxSWISS, wxNORMAL, wxNORMAL);
--   mMinorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
--   mMajorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD);
-+   mMinorMinorFont = new wxFont(fontSize - 1, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-+   mMinorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-+   mMajorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
-    mUserFonts = false;
- 
-    #ifdef __WXMAC__
-@@ -934,45 +934,45 @@
-    int j;
- 
-    if (!mUserFonts) {
--     int fontSize = 4;
--     wxCoord strW, strH, strD, strL;
--     wxString exampleText = wxT("0.9");   //ignored for height calcs on all platforms
--     int desiredPixelHeight;
--
--     if (mOrientation == wxHORIZONTAL)
--       desiredPixelHeight = mBottom-mTop-5; // height less ticks and 1px gap
--     else
-+      int fontSize = 4;
-+      wxCoord strW, strH, strD, strL;
-+      wxString exampleText = wxT("0.9");   //ignored for height calcs on all platforms
-+      int desiredPixelHeight;
-+
-+      if (mOrientation == wxHORIZONTAL)
-+         desiredPixelHeight = mBottom - mTop - 5; // height less ticks and 1px gap
-+      else
-          desiredPixelHeight = 12;   // why 12?  10 -> 12 seems to be max/min
- 
--     if (desiredPixelHeight < 10)//8)
--       desiredPixelHeight = 10;//8;
--     if (desiredPixelHeight > 12)
--       desiredPixelHeight = 12;
-+      if (desiredPixelHeight < 10)//8)
-+         desiredPixelHeight = 10;//8;
-+      if (desiredPixelHeight > 12)
-+         desiredPixelHeight = 12;
- 
-       // Keep making the font bigger until it's too big, then subtract one.
--      mDC->SetFont(wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD));
-+      mDC->SetFont(wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
-       mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL);
--      while( (strH-strD-strL) <= desiredPixelHeight && fontSize < 40) {
-+      while ((strH - strD - strL) <= desiredPixelHeight && fontSize < 40) {
-          fontSize++;
--         mDC->SetFont(wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD));
--         mDC->GetTextExtent(exampleText, &strW, &strH, &strD, & strL);
-+         mDC->SetFont(wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
-+         mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL);
-       }
-       fontSize--;
--      mDC->SetFont(wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL));
-+      mDC->SetFont(wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
-       mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL);
-       mLead = strL;
- 
--     if (mMajorFont)
--        delete mMajorFont;
--     mMajorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD);
--
--     if (mMinorFont)
--        delete mMinorFont;
--     mMinorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
--
--     if (mMinorMinorFont)
--        delete mMinorMinorFont;
--     mMinorMinorFont = new wxFont(fontSize-1, wxSWISS, wxNORMAL, wxNORMAL);
-+      if (mMajorFont)
-+         delete mMajorFont;
-+      mMajorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
-+
-+      if (mMinorFont)
-+         delete mMinorFont;
-+      mMinorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-+
-+      if (mMinorMinorFont)
-+         delete mMinorMinorFont;
-+      mMinorMinorFont = new wxFont(fontSize - 1, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-    }
- 
-    // If ruler is being resized, we could end up with it being too small.
---- a/src/widgets/TimeTextCtrl.cpp
-+++ b/src/widgets/TimeTextCtrl.cpp
-@@ -168,6 +168,7 @@
- 
- #include <math.h>
- 
-+#include <wx/wx.h>
- #include <wx/dcmemory.h>
- #include <wx/font.h>
- #include <wx/intl.h>
-@@ -1055,18 +1056,18 @@
-    wxString exampleText = wxT("0");
- 
-    // Keep making the font bigger until it's too big, then subtract one.
--   memDC.SetFont(wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL));
-+   memDC.SetFont(wxFont(fontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
-    memDC.GetTextExtent(exampleText, &strW, &strH);
-    while(strW <= mDigitBoxW && strH <= mDigitBoxH) {
-       fontSize++;
--      memDC.SetFont(wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL));
-+      memDC.SetFont(wxFont(fontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
-       memDC.GetTextExtent(exampleText, &strW, &strH);
-    }
-    fontSize--;
- 
-    if (mDigitFont)
-       delete mDigitFont;
--   mDigitFont = new wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL);
-+   mDigitFont = new wxFont(fontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
-    memDC.SetFont(*mDigitFont);
-    memDC.GetTextExtent(exampleText, &strW, &strH);
-    mDigitW = strW;
-@@ -1076,7 +1077,7 @@
-    fontSize--;
-    if (mLabelFont)
-       delete mLabelFont;
--   mLabelFont = new wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL);
-+   mLabelFont = new wxFont(fontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
- 
-    // Figure out the x-position of each field and label in the box
-    x = mBorderLeft;
-@@ -1435,7 +1436,7 @@
-       nevent.SetDirection(!event.ShiftDown());
-       nevent.SetEventObject(parent);
-       nevent.SetCurrentFocus(parent);
--      GetParent()->ProcessEvent(nevent);
-+      GetParent()->GetEventHandler()->ProcessEvent(nevent);
-       event.Skip(false);
-    }
- 
-@@ -1445,7 +1446,7 @@
-       if (def && def->IsEnabled()) {
-          wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
-                                def->GetId());
--         GetParent()->ProcessEvent(cevent);
-+         GetParent()->GetEventHandler()->ProcessEvent(cevent);
-          event.Skip(false);
-       }
-    }
---- a/src/widgets/numformatter.cpp
-+++ b/src/widgets/numformatter.cpp
-@@ -242,8 +242,13 @@
- 
- wxString wxNumberFormatter::ToString(wxLongLong_t val, int style)
- {
--    return PostProcessIntString(wxString::Format(wxT("%") wxLongLongFmtSpec wxT("d"), val),
-+#if wxCHECK_VERSION(3,0,0)
-+   return PostProcessIntString(wxString::Format("%" wxLongLongFmtSpec "d", val),
-                                 style);
-+#else
-+   return PostProcessIntString(wxString::Format(wxT("%") wxLongLongFmtSpec wxT("d"), val),
-+      style);
-+#endif
- }
- 
- #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
---- a/src/xml/XMLWriter.cpp
-+++ b/src/xml/XMLWriter.cpp
-@@ -124,21 +124,11 @@
-       XMLEsc(value).c_str()));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, const wxChar *value)
--{
--   WriteAttr(wxString(name), wxString(value));
--}
--
- void XMLWriter::WriteAttr(const wxString &name, const wxChar *value)
- {
-    WriteAttr(name, wxString(value));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, const wxString &value)
--{
--   WriteAttr(wxString(name), value);
--}
--
- void XMLWriter::WriteAttr(const wxString &name, int value)
- {
-    Write(wxString::Format(wxT(" %s=\"%d\""),
-@@ -146,11 +136,6 @@
-       value));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, int value)
--{
--   WriteAttr(wxString(name), value);
--}
--
- void XMLWriter::WriteAttr(const wxString &name, bool value)
- {
-    Write(wxString::Format(wxT(" %s=\"%d\""),
-@@ -158,11 +143,6 @@
-       value));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, bool value)
--{
--   WriteAttr(wxString(name), value);
--}
--
- void XMLWriter::WriteAttr(const wxString &name, long value)
- {
-    Write(wxString::Format(wxT(" %s=\"%ld\""),
-@@ -170,11 +150,6 @@
-       value));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, long value)
--{
--   WriteAttr(wxString(name), value);
--}
--
- void XMLWriter::WriteAttr(const wxString &name, long long value)
- {
-    Write(wxString::Format(wxT(" %s=\"%lld\""),
-@@ -182,11 +157,6 @@
-       value));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, long long value)
--{
--   WriteAttr(wxString(name), value);
--}
--
- void XMLWriter::WriteAttr(const wxString &name, size_t value)
- {
-    Write(wxString::Format(wxT(" %s=\"%ld\""),
-@@ -194,11 +164,6 @@
-       value));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, size_t value)
--{
--   WriteAttr(wxString(name), value);
--}
--
- void XMLWriter::WriteAttr(const wxString &name, float value, int digits)
- {
-    Write(wxString::Format(wxT(" %s=\"%s\""),
-@@ -206,11 +171,6 @@
-       Internat::ToString(value, digits).c_str()));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, float value, int digits)
--{
--   WriteAttr(wxString(name), value, digits);
--}
--
- void XMLWriter::WriteAttr(const wxString &name, double value, int digits)
- {
-    Write(wxString::Format(wxT(" %s=\"%s\""),
-@@ -218,11 +178,6 @@
-       Internat::ToString(value, digits).c_str()));
- }
- 
--void XMLWriter::WriteAttr(const wxChar *name, double value, int digits)
--{
--   WriteAttr(wxString(name), value, digits);
--}
--
- void XMLWriter::WriteData(const wxString &value)
- {
-    int i;
-@@ -234,11 +189,6 @@
-    Write(XMLEsc(value));
- }
- 
--void XMLWriter::WriteData(const wxChar *value)
--{
--   WriteData(wxString(value));
--}
--
- void XMLWriter::WriteSubTree(const wxString &value)
- {
-    if (mInTag) {
-@@ -250,16 +200,6 @@
-    Write(value.c_str());
- }
- 
--void XMLWriter::WriteSubTree(const wxChar *value)
--{
--   WriteSubTree(wxString(value));
--}
--
--void XMLWriter::Write(const wxChar *value)
--{
--   Write(wxString(value));
--}
--
- // See http://www.w3.org/TR/REC-xml for reference
- wxString XMLWriter::XMLEsc(const wxString & s)
- {
---- a/src/xml/XMLWriter.h
-+++ b/src/xml/XMLWriter.h
-@@ -27,32 +27,19 @@
-    void EndTag(const wxString &name);
- 
-    void WriteAttr(const wxString &name, const wxString &value);
--   void WriteAttr(const wxChar *name, const wxChar *value);
-    void WriteAttr(const wxString &name, const wxChar *value);
--   void WriteAttr(const wxChar *name, const wxString &value);
- 
-    void WriteAttr(const wxString &name, int value);
--   void WriteAttr(const wxChar *name, int value);
-    void WriteAttr(const wxString &name, bool value);
--   void WriteAttr(const wxChar *name, bool value);
-    void WriteAttr(const wxString &name, long value);
--   void WriteAttr(const wxChar *name, long value);
-    void WriteAttr(const wxString &name, long long value);
--   void WriteAttr(const wxChar *name, long long value);
-    void WriteAttr(const wxString &name, size_t value);
--   void WriteAttr(const wxChar *name, size_t value);
-    void WriteAttr(const wxString &name, float value, int digits = -1);
--   void WriteAttr(const wxChar *name, float value, int digits = -1);
-    void WriteAttr(const wxString &name, double value, int digits = -1);
--   void WriteAttr(const wxChar *name, double value, int digits = -1);
- 
-    void WriteData(const wxString &value);
--   void WriteData(const wxChar *value);
- 
-    void WriteSubTree(const wxString &value);
--   void WriteSubTree(const wxChar *value);
--
--   void Write(const wxChar *data);
- 
-    virtual void Write(const wxString &data) = 0;
- 
diff --git a/debian/patches/series b/debian/patches/series
index 743f4c4..5fab31b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,2 @@
 fix-minsrc-autoreconf.patch
-backport-wx30-r13403.patch
+wxWidgets-3.0.patch
diff --git a/debian/patches/wxWidgets-3.0.patch b/debian/patches/wxWidgets-3.0.patch
new file mode 100644
index 0000000..20d0a30
--- /dev/null
+++ b/debian/patches/wxWidgets-3.0.patch
@@ -0,0 +1,1802 @@
+Description: Compile audacity against wxWidgets 3.0
+ Solved compilation issues:
+ (1.) Allow wxWidgets 3.0 in various configure scripts.
+ (2.) The file dialog was derived from an internal wx class that
+ disappeared in wx3.0 (discussed in further detail below).
+ (3.) In several places the types in interfaces changed between
+ wxChar* and wxString. I've tried to modify the code so it works with
+ both interfaces (thanks to implicit conversion; may look a bit weird
+ in some places).
+ (4.) Calls to "wxTheApp->SuspendIdleCallback()" are no longer
+ supported. They were part of a workaround for a clipboard problem,
+ which fortunately doesn't seem to be there any longer in wx3.0, so I
+ deactivated it for wx3.0.
+ (5.) AddPendingEvent() and ProcessEvent() now have the visibility
+ "protected" in wxWindow. It has always been a bad idea to call them
+ directly on a wxWindow object, but now it's explicitly forbidden.
+ Instead, those functions should be called on the object returned by
+ GetEventHandler().
+ (6.) The class wxStandardPaths is now a singleton and has to be
+ treated as such (no more explicit constructor calls).
+ (7.) "wxLogWarning" is a macro now, so the "::" prefix doesn't work
+ on it anymore.
+ (8.) Several int types (which were actually used as enums) are now
+ real enum types (e.g. wxRasterOperationMode, wxMouseButton) and have
+ to be used as such.
+ (9.) Apart from the FD constants (which have been fixed in Olly's
+ patch already) there are some other constants which have received a
+ prefix (e.g. wx* -> wxFONTFAMILY_*, wx* -> wxFONTSTYLE_*, wx* ->
+ wxFONTWEIGHT_*).
+ (10.) Signature changes in constructors of wxFlexGridSizer and wxIcon
+ and wxSizeEvent
+ (11.) Missing includes (missing header files were probably included
+ indirectly in wx2.8 by chance)
+ (12.) When deriving from the abstract class wxGridTableBase,
+ different methods have to be implemented with wx3.0 (EndEdit with new
+ signature and ApplyEdit) than before with wx2.8 (only EndEdit with
+ old signature). Now both versions are implemented in parallel in the
+ classes TimeEditor and ChoiceEditor (one version essentially being a
+ wrapper of the other one).
+ Solved runtime issues:
+ (1.) Segmentation fault: The LadspaEffectDialog receives EVT_TEXT
+ events before it's properly initialized. To prevent this, a
+ workaround was already in place, but was only active on Windows. It
+ looks like this happens now on more platforms (including GTK). As the
+ workaround doesn't do any harm, even if activated unnecessarily, I've
+ simply activated it for all environments.
+ (2.) GTK critical warning "IA__gtk_range_set_range: assertion
+ 'min < max' failed" because of negative numbers as result of window
+ size checking. Added a sanity check that straightens up the numbers
+ in edge cases.
+ (3.) GTK critical warning "IA__gdk_window_get_origin: assertion
+ 'GDK_IS_WINDOW (window)' failed": Received events of type wxSizeEvent
+ on the main project window cause calls to "ClientToScreen" - which is
+ not available until the window is first shown. So the class has to
+ keep track of wxShowEvent events and inhibit those actions until the
+ window is first shown.
+ (4.) The functions wxString::Format and wxString::Printf have become
+ stricter about parameter types that don't match (format string vs.
+ function parameters). A systematic check of all occurrences was done
+ to make sure all of them are fixed.
+ (5.) Fix a segmentation fault that was due to an incorrect
+ implementation of wxStaticCast. Use the C++ static_case as a
+ workaround.
+ (6.) Fix a segmentation fault due to double initialization of the
+ classes wxNumberFormatter and wxNumValidator. Those classes had
+ been copied from wxWidgets to audacity, but are included in
+ wxWidgets 3.0, too. Use the original classes, if we compile
+ against wxWidgets 3.0.
+Author: Martin Steghöfer <martin at steghoefer.eu>
+Bug-Debian: https://bugs.debian.org/749659
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -184,13 +184,11 @@
+             [dynamic_loading="$enableval"],
+             [dynamic_loading="yes"])
+ 
+-dnl AC_ARG_WITH(wx-version,
+-dnl            [AS_HELP_STRING([--with-wx-version],
+-dnl                            [select wxWidgets version (if both installed) [2.8,]])],
+-dnl            wx_preference="--version=$withval",
+-dnl            wx_preference="")
+-dnl At the moment we only support wx2.8. If we start supporting 3.0 when it
+-dnl comes out, we'll want it back again.
++AC_ARG_WITH(wx-version,
++           [AS_HELP_STRING([--with-wx-version],
++                           [select wxWidgets version (if both installed) [2.8, 3.0]])],
++           wx_preference="--version=$withval",
++           wx_preference="")
+ 
+ dnl ----------------------------------------------------
+ dnl If user asked for debug, put debug in compiler flags
+@@ -289,19 +287,21 @@
+ wxconfigargs="$static_wx_preference $unicode_preference  $wxconfigargs $wx_preference"
+ wx_version=`${WX_CONFIG} $wxconfigargs --version`
+ 
+-AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
++AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x or 3.0.x])
+ 
+ case "${wx_version}" in
+   2.8.*)
+     echo "Great, you're using wxWidgets ${wx_version}!"
+     ;;
++  3.0.*)
++    echo "Great, you're using wxWidgets ${wx_version}!"
++    ;;
+   *)
+   wx_list=`${WX_CONFIG} --list`
+-  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
+-The currently available configurations are listed below.  If necessary, either
+-install the package for your distribution or download the latest version of
+-wxWidgets
+-from http://wxwidgets.org.
++  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x
++or v3.0.x. The currently available configurations are listed below. If
++necessary, either install the package for your distribution or download a
++suitable version of wxWidgets from http://wxwidgets.org.
+ ${wx_list}])
+ esac
+ 
+--- a/lib-src/FileDialog/FileDialog.h
++++ b/lib-src/FileDialog/FileDialog.h
+@@ -43,11 +43,11 @@
+ //----------------------------------------------------------------------------
+ 
+ wxString 
+-FileSelector(const wxChar *message = wxFileSelectorPromptStr,
++FileSelector(const wxChar *message = wxString(wxFileSelectorPromptStr, wxConvUTF8).wc_str(),
+              const wxChar *default_path = NULL,
+              const wxChar *default_filename = NULL,
+              const wxChar *default_extension = NULL,
+-             const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
++             const wxChar *wildcard = wxString(wxFileSelectorDefaultWildcardStr, wxConvUTF8).wc_str(),
+              int flags = 0,
+              wxWindow *parent = NULL,
+              wxString label = wxEmptyString,
+--- a/lib-src/FileDialog/Makefile.am
++++ b/lib-src/FileDialog/Makefile.am
+@@ -32,3 +32,7 @@
+ if WINDOWS
+ libFileDialog_la_SOURCES += win/FileDialogPrivate.cpp win/FileDialogPrivate.h
+ endif
++
++if WX30
++libFileDialog_la_SOURCES += wx30/FileDialogPrivate.cpp wx30/FileDialogPrivate.h
++endif
+--- a/lib-src/FileDialog/configure.ac
++++ b/lib-src/FileDialog/configure.ac
+@@ -42,7 +42,7 @@
+             debug_preference="")
+ 
+ AC_ARG_WITH(wx-version,
+-            [AS_HELP_STRING([--with-wx-version],[override default wxWidgets version [2.6,2.8]])],
++            [AS_HELP_STRING([--with-wx-version],[override default wxWidgets version [2.8, 3.0]])],
+             wx_preference="--version=$withval",
+             wx_preference="")
+ 
+@@ -67,27 +67,48 @@
+ 
+ PKG_CHECK_MODULES(GTK, gtk+-2.0, have_gtk="yes", have_gtk="no")
+ 
+-dnl OS-specific configuration
++dnl Get wx version
++wx_version=`${WX_CONFIG} $wxconfigargs --version`
++
++dnl OS- and wx-version-specific configuration
+ 
+ AC_CANONICAL_HOST
+ 
+ IMPLEMENTATION="generic"
+-case "${host_os}" in
+-   darwin*)
+-      dnl Mac OS X configuration
+-      IMPLEMENTATION="mac"
++case "${wx_version}" in
++   2.8.*)
++      case "${host_os}" in
++         darwin*)
++            dnl Mac OS X configuration
++            IMPLEMENTATION="mac"
++         ;;
++
++         cygwin*)
++            dnl Windows/CygWin configuration
++            IMPLEMENTATION="win"
++         ;;
++
++         *)
++            if test "$have_gtk" = "yes"; then
++               AC_DEFINE(HAVE_GTK, 1, [Define to 1 if GTK+ is available.])
++               IMPLEMENTATION="gtk"
++            fi
++         ;;
++      esac
+    ;;
+ 
+-   cygwin*)
+-      dnl Windows/CygWin configuration
+-      IMPLEMENTATION="win"
++   3.0.*)
++      dnl wx3.0 version for all platforms
++      IMPLEMENTATION="wx30"
+    ;;
+ 
+    *)
+-      if test "$have_gtk" = "yes"; then
+-         AC_DEFINE(HAVE_GTK, 1, [Define to 1 if GTK+ is available.])
+-         IMPLEMENTATION="gtk"
+-      fi
++      wx_list=`${WX_CONFIG} --list`
++      AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x
++      or v3.0.x. The currently available configurations are listed below. If
++      necessary, either install the package for your distribution or download a
++      suitable version of wxWidgets from http://wxwidgets.org.
++      ${wx_list}])
+    ;;
+ esac
+ 
+@@ -96,6 +117,7 @@
+ AM_CONDITIONAL([GTK], test "$IMPLEMENTATION" = "gtk")
+ AM_CONDITIONAL([MAC], test "$IMPLEMENTATION" = "mac")
+ AM_CONDITIONAL([WINDOWS], test "$IMPLEMENTATION" = "win")
++AM_CONDITIONAL([WX30], test "$IMPLEMENTATION" = "wx30")
+ 
+ echo "Implementation to use: $IMPLEMENTATION"
+ 
+--- /dev/null
++++ b/lib-src/FileDialog/wx30/FileDialogPrivate.cpp
+@@ -0,0 +1,61 @@
++#include <wx/wxprec.h>
++#ifndef WX_PRECOMP
++#  include <wx/wx.h>
++#endif
++
++#include "../FileDialog.h"
++
++#include <cassert>
++
++#include "wx/event.h"
++#include "wx/filedlg.h"
++#include "wx/window.h"
++
++
++FileDialog::FileDialog(wxWindow *parent,
++        const wxString& message,
++        const wxString& defaultDir,
++        const wxString& defaultFile,
++        const wxString& wildCard,
++        long style,
++        const wxPoint& pos,
++        const wxSize& sz,
++        const wxString& name)
++: wxFileDialog(parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name)
++{
++}
++
++
++FileDialog::~FileDialog()
++{
++   // intentionally left blank; it's just there to make sure
++   // we have a virtual destructor (in case of subclassing)
++}
++
++
++int FileDialog::ShowModal()
++{
++   assert (SupportsExtraControl());
++
++   if (!m_buttonlabel.IsEmpty()) {
++      SetExtraControlCreator(&FileDialog::CreateButton);
++   }
++
++   return wxFileDialog::ShowModal();
++}
++
++
++wxWindow * FileDialog::CreateButton(wxWindow *fileDialogGeneric)
++{
++   FileDialog *fileDialog = (FileDialog *) fileDialogGeneric;
++   wxButton *button = new wxButton(fileDialog, wxID_ANY, fileDialog->m_buttonlabel);
++   fileDialog->Bind(wxEVT_BUTTON, &FileDialog::OnButton, fileDialog, button->GetId());
++   return button;
++}
++
++void FileDialog::OnButton(wxCommandEvent& WXUNUSED(event))
++{
++   ClickButton(GetFilterIndex());
++}
++
++
+--- /dev/null
++++ b/lib-src/FileDialog/wx30/FileDialogPrivate.h
+@@ -0,0 +1,47 @@
++#ifndef __FILEDIALOGWX30H__
++#define __FILEDIALOGWX30H__
++
++
++#include "wx/filedlg.h"
++
++
++class FileDialog : public wxFileDialog
++{
++public: // constructors/destructors
++   FileDialog() { }
++
++   FileDialog(wxWindow *parent,
++              const wxString& message = wxFileSelectorPromptStr,
++              const wxString& defaultDir = wxEmptyString,
++              const wxString& defaultFile = wxEmptyString,
++              const wxString& wildCard = wxFileSelectorDefaultWildcardStr,
++              long style = wxFD_DEFAULT_STYLE,
++              const wxPoint& pos = wxDefaultPosition,
++              const wxSize& sz = wxDefaultSize,
++              const wxString& name = wxFileDialogNameStr);
++
++   virtual ~FileDialog();
++
++public: // public methods
++   virtual void EnableButton(wxString label, fdCallback cb, void *cbdata);
++
++   virtual void ClickButton(int index);
++
++   virtual int ShowModal();
++
++   void OnButton(wxCommandEvent& event);
++
++private: // private methods
++    static wxWindow * CreateButton(wxWindow *fileDialog);
++
++private: // attributes
++   wxString m_buttonlabel;
++
++   fdCallback m_callback;
++
++   void *m_cbdata;
++};
++
++
++#endif
++
+--- a/lib-src/lib-widget-extra/configure.ac
++++ b/lib-src/lib-widget-extra/configure.ac
+@@ -63,12 +63,11 @@
+             debug_preference="$enableval",
+             debug_preference="no")
+ 
+-dnl AC_ARG_WITH(wx-version,
+-dnl             [AS_HELP_STRING([--with-wx-version],
+-dnl                            [select wxWidgets version (if both installed) [2.8,]])],
+-dnl            wx_preference="--version=$withval",
+-dnl            wx_preference="")
+-dnl Right now only support wx 2.8
++AC_ARG_WITH(wx-version,
++           [AS_HELP_STRING([--with-wx-version],
++                           [select wxWidgets version (if both installed) [2.8, 3.0]])],
++           wx_preference="--version=$withval",
++           wx_preference="")
+ 
+ dnl ----------------------------------------------------
+ dnl If user asked for debug, put debug in compiler flags
+@@ -128,19 +127,21 @@
+ 
+ wx_version=`${WX_CONFIG} $wxconfigargs --version`
+ 
+-AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x])
++AC_MSG_NOTICE([Checking that the chosen version of wxWidgets is 2.8.x or 3.0.x])
+ 
+ case "${wx_version}" in
+   2.8.*)
+     echo "Great, you're using wxWidgets ${wx_version}!"
+     ;;
++  3.0.*)
++    echo "Great, you're using wxWidgets ${wx_version}!"
++    ;;
+   *)
+   wx_list=`${WX_CONFIG} --list`
+-  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x or higher.
+-The currently available configurations are listed below.  If necessary, either
+-install the package for your distribution or download the latest version of
+-wxWidgets
+-from http://wxwidgets.org.
++  AC_MSG_ERROR([Unable to locate a suitable configuration of wxWidgets v2.8.x
++or v3.0.x. The currently available configurations are listed below. If
++necessary, either install the package for your distribution or download a
++suitable version of wxWidgets from http://wxwidgets.org.
+ ${wx_list}])
+ esac
+ 
+--- a/src/AudacityApp.cpp
++++ b/src/AudacityApp.cpp
+@@ -924,7 +924,7 @@
+ 
+ AudacityLogger *AudacityApp::GetLogger()
+ {
+-   return wxStaticCast(wxLog::GetActiveTarget(), AudacityLogger);
++   return static_cast<AudacityLogger *>(wxLog::GetActiveTarget());
+ }
+ 
+ void AudacityApp::InitLang( const wxString & lang )
+@@ -1295,7 +1295,7 @@
+          }
+ 
+          if (option < argc - 1 &&
+-             argv[option + 1] &&
++             !wxString(argv[option + 1]).IsEmpty() && // *argv is of type wxChar* in wx28 and wxString in wx30
+              !wxString(wxT("-blocksize")).CmpNoCase(argv[option])) {
+             long theBlockSize;
+             if (wxString(argv[option + 1]).ToLong(&theBlockSize)) {
+--- a/src/AudacityLogger.cpp
++++ b/src/AudacityLogger.cpp
+@@ -170,9 +170,9 @@
+    // loads either the XPM or the windows resource, depending on the platform
+ #if !defined(__WXMAC__) && !defined(__WXX11__)
+    #if defined(__WXMSW__)
+-      wxIcon ic(wxICON(AudacityLogo));
++      wxIcon ic = wxICON(AudacityLogo);
+    #elif defined(__WXGTK__)
+-      wxIcon ic(wxICON(AudacityLogoAlpha));
++      wxIcon ic = wxICON(AudacityLogoAlpha);
+    #else
+       wxIcon ic;
+       ic.CopyFromBitmap(theTheme.Bitmap(bmpAudacityLogo48x48));
+--- a/src/Benchmark.cpp
++++ b/src/Benchmark.cpp
+@@ -394,8 +394,8 @@
+    t->GetEndTime();
+ 
+    if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() != (sampleCount)nChunks * chunkSize) {
+-      Printf(wxT("Expected len %d, track len %d.\n"), nChunks * chunkSize,
+-             t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
++      Printf(wxT("Expected len %d, track len %lld.\n"), nChunks * chunkSize,
++             (long long) t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
+       goto fail;
+    }
+ 
+@@ -415,8 +415,8 @@
+          Printf(wxT("Trial %d\n"), z);
+          Printf(wxT("Cut (%d, %d) failed.\n"), (x0 * chunkSize),
+                 (x0 + xlen) * chunkSize);
+-         Printf(wxT("Expected len %d, track len %d.\n"), nChunks * chunkSize,
+-                t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
++         Printf(wxT("Expected len %d, track len %lld.\n"), nChunks * chunkSize,
++                (long long) t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
+          goto fail;
+       }
+ 
+@@ -432,8 +432,8 @@
+ 
+       if (t->GetClipByIndex(0)->GetSequence()->GetNumSamples() != (sampleCount) nChunks * chunkSize) {
+          Printf(wxT("Trial %d\n"), z);
+-         Printf(wxT("Expected len %d, track len %d.\n"), nChunks * chunkSize,
+-                t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
++         Printf(wxT("Expected len %d, track len %lld.\n"), nChunks * chunkSize,
++                (long long) t->GetClipByIndex(0)->GetSequence()->GetNumSamples());
+          goto fail;
+       }
+       // Copy
+--- a/src/CaptureEvents.cpp
++++ b/src/CaptureEvents.cpp
+@@ -17,7 +17,7 @@
+ #include "Audacity.h"
+ #include "CaptureEvents.h"
+ 
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+ // As of wxGTK 2.8.9, there is a problem in the wxClipboard class that
+ // allows recursive event processing.  This problem has been corrected
+ // by wxWidgets 2.9+.  However, this han't made it into a release yet,
+--- a/src/CaptureEvents.h
++++ b/src/CaptureEvents.h
+@@ -17,7 +17,7 @@
+ #ifndef _AUDACITY_CAPTURE_EVENTS_
+ #define _AUDACITY_CAPTURE_EVENTS_
+ 
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+ // As of wxGTK 2.8.9, there is a problem in the wxClipboard class that
+ // allows recursive event processing.  This problem has been corrected
+ // by wxWidgets 2.9+.  However, this han't made it into a release yet,
+--- a/src/DirManager.cpp
++++ b/src/DirManager.cpp
+@@ -1417,7 +1417,7 @@
+       {
+          wxString msgA =
+ _("Project check of \"%s\" folder \
+-\ndetected %d missing external audio file(s) \
++\ndetected %lld missing external audio file(s) \
+ \n('aliased files'). There is no way for Audacity \
+ \nto recover these files automatically. \
+ \n\nIf you choose the first or second option below, \
+@@ -1429,7 +1429,7 @@
+ \nproject in its current state, unless you \"Close \
+ \nproject immediately\" on further error alerts.");
+          wxString msg;
+-         msg.Printf(msgA, this->projName.c_str(), missingAliasedFilePathHash.size());
++         msg.Printf(msgA, this->projName.c_str(), (long long) missingAliasedFilePathHash.size());
+          const wxChar *buttons[] =
+             {_("Close project immediately with no changes"),
+                _("Treat missing audio as silence (this session only)"),
+@@ -1487,11 +1487,11 @@
+       {
+          wxString msgA =
+ _("Project check of \"%s\" folder \
+-\ndetected %d missing alias (.auf) blockfile(s). \
++\ndetected %lld missing alias (.auf) blockfile(s). \
+ \nAudacity can fully regenerate these files \
+ \nfrom the current audio in the project.");
+          wxString msg;
+-         msg.Printf(msgA, this->projName.c_str(), missingAUFHash.size());
++         msg.Printf(msgA, this->projName.c_str(), (long long) missingAUFHash.size());
+          const wxChar *buttons[] = {_("Regenerate alias summary files (safe and recommended)"),
+                                     _("Fill in silence for missing display data (this session only)"),
+                                     _("Close project immediately with no further changes"),
+@@ -1538,7 +1538,7 @@
+       {
+          wxString msgA =
+ _("Project check of \"%s\" folder \
+-\ndetected %d missing audio data (.au) blockfile(s), \
++\ndetected %lld missing audio data (.au) blockfile(s), \
+ \nprobably due to a bug, system crash, or accidental \
+ \ndeletion. There is no way for Audacity to recover \
+ \nthese missing files automatically. \
+@@ -1548,7 +1548,7 @@
+ \n\nNote that for the second option, the waveform \
+ \nmay not show silence.");
+          wxString msg;
+-         msg.Printf(msgA, this->projName.c_str(), missingAUHash.size());
++         msg.Printf(msgA, this->projName.c_str(), (long long) missingAUHash.size());
+          const wxChar *buttons[] =
+             {_("Close project immediately with no further changes"),
+                _("Treat missing audio as silence (this session only)"),
+--- a/src/LabelTrack.cpp
++++ b/src/LabelTrack.cpp
+@@ -957,7 +957,7 @@
+ 
+    // copy data onto clipboard
+    if (wxTheClipboard->Open()) {
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+       CaptureEvents capture;
+ #endif
+       wxTheClipboard->SetData(new wxTextDataObject(data));
+@@ -992,7 +992,7 @@
+ 
+    // copy the data on clipboard
+    if (wxTheClipboard->Open()) {
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+       CaptureEvents capture;
+ #endif
+       wxTheClipboard->SetData(new wxTextDataObject(data));
+@@ -1017,7 +1017,7 @@
+    // if text data is available
+    if (IsTextClipSupported()) {
+       if (wxTheClipboard->Open()) {
+-#if defined(__WXGTK__) && HAVE_GTK
++#if defined(__WXGTK__) && HAVE_GTK && wxMAJOR_VERSION < 3
+          CaptureEvents capture;
+ #endif
+          wxTextDataObject data;
+@@ -1074,7 +1074,7 @@
+ /// @return true if the text data is available in the clipboard, false otherwise
+ bool LabelTrack::IsTextClipSupported()
+ {
+-#if defined(__WXGTK__) && defined(HAVE_GTK)
++#if defined(__WXGTK__) && defined(HAVE_GTK) && wxMAJOR_VERSION < 3
+    CaptureEvents capture;
+ #endif
+ 
+--- a/src/LyricsWindow.cpp
++++ b/src/LyricsWindow.cpp
+@@ -68,9 +68,9 @@
+    // loads either the XPM or the windows resource, depending on the platform
+    #if !defined(__WXMAC__) && !defined(__WXX11__)
+       #ifdef __WXMSW__
+-         wxIcon ic(wxICON(AudacityLogo));
++         wxIcon ic = wxICON(AudacityLogo);
+       #else
+-         wxIcon ic(wxICON(AudacityLogo48x48));
++         wxIcon ic = wxICON(AudacityLogo48x48);
+       #endif
+       SetIcon(ic);
+    #endif
+--- a/src/Menus.cpp
++++ b/src/Menus.cpp
+@@ -2422,7 +2422,7 @@
+    //       The workaround is to queue a context menu event, allowing the key press
+    //       event to complete.
+    wxContextMenuEvent e(wxEVT_CONTEXT_MENU, GetId());
+-   mTrackPanel->AddPendingEvent(e);
++   mTrackPanel->GetEventHandler()->AddPendingEvent(e);
+ }
+ 
+ void AudacityProject::OnTrackMute()
+@@ -5871,7 +5871,7 @@
+       wxArrayString rates;
+       wxComboBox *cb;
+ 
+-      rate.Printf(wxT("%d"), lrint(mRate));
++      rate.Printf(wxT("%ld"), lrint(mRate));
+ 
+       rates.Add(wxT("8000"));
+       rates.Add(wxT("11025"));
+--- a/src/MixerBoard.cpp
++++ b/src/MixerBoard.cpp
+@@ -1723,9 +1723,9 @@
+    // loads either the XPM or the windows resource, depending on the platform
+    #if !defined(__WXMAC__) && !defined(__WXX11__)
+       #ifdef __WXMSW__
+-         wxIcon ic(wxICON(AudacityLogo));
++         wxIcon ic = wxICON(AudacityLogo);
+       #else
+-         wxIcon ic(wxICON(AudacityLogo48x48));
++         wxIcon ic = wxICON(AudacityLogo48x48);
+       #endif
+       SetIcon(ic);
+    #endif
+--- a/src/PitchName.cpp
++++ b/src/PitchName.cpp
+@@ -20,6 +20,10 @@
+ #include <math.h>
+ #include <stdio.h>
+ 
++#ifndef WX_PRECOMP
++#  include "wx/wx.h"
++#endif
++
+ #include "PitchName.h"
+ 
+ 
+--- a/src/PlatformCompatibility.cpp
++++ b/src/PlatformCompatibility.cpp
+@@ -20,6 +20,7 @@
+ #include <wx/filename.h>
+ #include <wx/stdpaths.h>
+ #include <wx/app.h>
++#include <wx/version.h>
+ 
+ #include "AudacityApp.h"
+ #include "PlatformCompatibility.h"
+@@ -37,7 +38,11 @@
+    static wxString path;
+ 
+    if (!found) {
++#if wxMAJOR_VERSION < 3
+       wxStandardPaths std;
++#else
++      wxStandardPaths std(wxStandardPaths::Get());
++#endif
+ 
+       path = std.GetExecutablePath();
+ 
+@@ -65,4 +70,4 @@
+ #else
+    return filePath;
+ #endif
+-}
+\ No newline at end of file
++}
+--- a/src/Profiler.cpp
++++ b/src/Profiler.cpp
+@@ -22,6 +22,9 @@
+ 
+ #include "Profiler.h"
+ 
++#include <cstdio>
++#include <cstring>
++
+ ///write to a profile at the end of the test.
+ Profiler::~Profiler()
+ {
+--- a/src/Project.cpp
++++ b/src/Project.cpp
+@@ -79,7 +79,6 @@
+ #include <wx/string.h>
+ #include <wx/textfile.h>
+ #include <wx/timer.h>
+-#include <wx/generic/filedlgg.h>
+ #include <wx/display.h>
+ 
+ #include <wx/arrimpl.cpp>       // this allows for creation of wxObjArray
+@@ -704,6 +703,7 @@
+    EVT_MOUSE_EVENTS(AudacityProject::OnMouseEvent)
+    EVT_CLOSE(AudacityProject::OnCloseWindow)
+    EVT_SIZE(AudacityProject::OnSize)
++   EVT_SHOW(AudacityProject::OnShow)
+    EVT_MOVE(AudacityProject::OnMove)
+    EVT_ACTIVATE(AudacityProject::OnActivate)
+    EVT_COMMAND_SCROLL_LINEUP(HSBarID, AudacityProject::OnScrollLeftButton)
+@@ -763,7 +763,8 @@
+      mLastEffect(NULL),
+      mLastEffectType(0),
+      mTimerRecordCanceled(false),
+-     mMenuClose(false)
++     mMenuClose(false),
++     mShownOnce(false)
+ {
+    int widths[] = {-2, -1};
+    mStatusBar = CreateStatusBar(2);
+@@ -985,9 +986,9 @@
+    // loads either the XPM or the windows resource, depending on the platform
+ #if !defined(__WXMAC__) && !defined(__WXX11__)
+    #if defined(__WXMSW__)
+-      wxIcon ic(wxICON(AudacityLogo));
++      wxIcon ic = wxICON(AudacityLogo);
+    #elif defined(__WXGTK__)
+-      wxIcon ic(wxICON(AudacityLogoAlpha));
++      wxIcon ic = wxICON(AudacityLogoAlpha);
+    #else
+       wxIcon ic;
+       ic.CopyFromBitmap(theTheme.Bitmap(bmpAudacityLogo48x48));
+@@ -1392,6 +1393,12 @@
+ 
+    int panelWidth, panelHeight;
+    mTrackPanel->GetTracksUsableArea(&panelWidth, &panelHeight);
++   if (panelWidth < 0) {
++      panelWidth = 0;
++   }
++   if (panelHeight < 0) {
++      panelHeight = 0;
++   }
+ 
+    // Add 1/4 of a screen of blank space to the end of the longest track
+    mViewInfo.screen = ((double) panelWidth) / mViewInfo.zoom;
+@@ -1603,9 +1610,26 @@
+ 
+ void AudacityProject::OnSize(wxSizeEvent & event)
+ {
+-   HandleResize();
+-   if (!this->IsMaximized() && !this->IsIconized())
+-      SetNormalizedWindowState(this->GetRect());
++   if (mShownOnce) {
++      HandleResize();
++      if (!this->IsMaximized() && !this->IsIconized())
++         SetNormalizedWindowState(this->GetRect());
++   }
++   event.Skip();
++}
++
++void AudacityProject::OnShow(wxShowEvent & event)
++{
++   // Remember that the window has been shown at least once
++   mShownOnce = true;
++
++   // Call "OnSize" again (the previous calls to "OnSize" might not
++   // have succeeded because some methods are not available before
++   // the actual creation/showing of the window)
++   wxSizeEvent sizeEvent(GetSize());
++   OnSize(sizeEvent);
++
++   // Further processing by default handlers
+    event.Skip();
+ }
+ 
+@@ -1717,7 +1741,7 @@
+       wxCommandEvent e(EVT_CAPTURE_KEY);
+       e.SetEventObject(&event);
+ 
+-      if (w->ProcessEvent(e)) {
++      if (w->GetEventHandler()->ProcessEvent(e)) {
+          return false;
+       }
+    }
+--- a/src/Project.h
++++ b/src/Project.h
+@@ -254,6 +254,7 @@
+    void OnMouseEvent(wxMouseEvent & event);
+    void OnIconize(wxIconizeEvent &event);
+    void OnSize(wxSizeEvent & event);
++   void OnShow(wxShowEvent & event);
+    void OnMove(wxMoveEvent & event);
+    void OnScroll(wxScrollEvent & event);
+    void OnCloseWindow(wxCloseEvent & event);
+@@ -499,6 +500,8 @@
+    // dialog for missing alias warnings
+    wxDialog            *mAliasMissingWarningDialog;
+ 
++   bool mShownOnce;
++
+  public:
+    ToolManager *mToolManager;
+    bool mShowSplashScreen;
+--- a/src/Sequence.cpp
++++ b/src/Sequence.cpp
+@@ -1048,7 +1048,7 @@
+                Internat::ToString(((wxLongLong)(bb->f->GetLength())).ToDouble(), 0).c_str(),
+                Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
+          ::wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
+-         ::wxLogWarning(sMsg);
++         wxLogWarning(sMsg);
+          bb->f->SetLength(mMaxSamples);
+       }
+ 
+@@ -1843,10 +1843,10 @@
+    for (i = 0; i < mBlock->GetCount(); i++) {
+       SeqBlock* pSeqBlock = mBlock->Item(i);
+       *dest += wxString::Format
+-         (wxT("   Block %3d: start %8d, len %8d, refs %d, "),
++         (wxT("   Block %3u: start %8lld, len %8lld, refs %d, "),
+           i,
+-          pSeqBlock->start,
+-          pSeqBlock->f ? pSeqBlock->f->GetLength() : 0,
++          (long long) pSeqBlock->start,
++          pSeqBlock->f ? (long long) pSeqBlock->f->GetLength() : 0,
+           pSeqBlock->f ? mDirManager->GetRefCount(pSeqBlock->f) : 0);
+ 
+       if (pSeqBlock->f)
+@@ -1864,7 +1864,7 @@
+    }
+    if (pos != mNumSamples)
+       *dest += wxString::Format
+-         (wxT("ERROR mNumSamples = %d\n"), mNumSamples);
++         (wxT("ERROR mNumSamples = %lld\n"), (long long) mNumSamples);
+ }
+ 
+ // static
+--- a/src/Shuttle.cpp
++++ b/src/Shuttle.cpp
+@@ -189,7 +189,7 @@
+    else
+    {
+       /// \todo Fix for long long values.
+-      mValueString = wxString::Format(wxT("%d"),iValue);
++      mValueString = wxString::Format(wxT("%lld"), (long long) iValue);
+       return ExchangeWithMaster( Name );
+    }
+    return true;
+--- a/src/Tags.cpp
++++ b/src/Tags.cpp
+@@ -474,7 +474,7 @@
+ 
+       while (*attrs) {
+          wxString attr = *attrs++;
+-         if (!*attr)
++         if (attr.IsEmpty())
+             break;
+          wxString value = *attrs++;
+ 
+--- a/src/TrackPanel.cpp
++++ b/src/TrackPanel.cpp
+@@ -5124,7 +5124,7 @@
+       // The activate event is used to make the
+       // parent window 'come alive' if it didn't have focus.
+       wxActivateEvent e;
+-      GetParent()->ProcessEvent(e);
++      GetParent()->GetEventHandler()->ProcessEvent(e);
+ 
+       // wxTimers seem to be a little unreliable, so this
+       // "primes" it to make sure it keeps going for a while...
+@@ -5562,7 +5562,7 @@
+    int trackKind = pTrack->GetKind();
+    currentTool = selectTool; // the default.
+ 
+-   if( event.ButtonIsDown(3) || event.RightUp()){
++   if( event.ButtonIsDown(wxMOUSE_BTN_RIGHT) || event.RightUp()){
+       currentTool = zoomTool;
+    } else if( trackKind == Track::Time ){
+       currentTool = envelopeTool;
+@@ -7583,7 +7583,7 @@
+    Track *partner = mTracks->GetLink(pTrack);
+    if (partner)
+       ((WaveTrack *) partner)->SetRate(rate);
+-   MakeParentPushState(wxString::Format(_("Changed '%s' to %d Hz"),
++   MakeParentPushState(wxString::Format(_("Changed '%s' to %f Hz"),
+                                         pTrack->GetName().c_str(), rate),
+                        _("Rate Change"));
+ }
+@@ -7723,7 +7723,7 @@
+       wxArrayString rates;
+       wxComboBox *cb;
+ 
+-      rate.Printf(wxT("%d"), lrint(((WaveTrack *) mPopupMenuTarget)->GetRate()));
++      rate.Printf(wxT("%ld"), lrint(((WaveTrack *) mPopupMenuTarget)->GetRate()));
+ 
+       rates.Add(wxT("8000"));
+       rates.Add(wxT("11025"));
+@@ -7810,7 +7810,7 @@
+       if( lower >= 10 && upper <= 1000 && lower < upper ) {
+          t->SetRangeLower((double)lower / 100.0);
+          t->SetRangeUpper((double)upper / 100.0);
+-         MakeParentPushState(wxString::Format(_("Set range to '%d' - '%d'"),
++         MakeParentPushState(wxString::Format(_("Set range to '%ld' - '%ld'"),
+                                               lower,
+                                               upper),
+       /* i18n-hint: (verb)*/
+@@ -8065,7 +8065,7 @@
+          /* i18n-hint: (noun) The size of the typeface*/
+          S.AddPrompt(_("Face size"));
+          sc = new wxSpinCtrl(&dlg, wxID_ANY,
+-                             wxString::Format(wxT("%d"), fontsize),
++                             wxString::Format(wxT("%ld"), fontsize),
+                              wxDefaultPosition,
+                              wxDefaultSize,
+                              wxSP_ARROW_KEYS,
+@@ -8382,7 +8382,7 @@
+    mSliderOffset = 0;
+ 
+    int fontSize = 10;
+-   mFont.Create(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
++   mFont.Create(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
+ 
+    int allowableWidth = GetTrackInfoWidth() - 2; // 2 to allow for left/right borders
+    int textWidth, textHeight;
+--- a/src/blockfile/SimpleBlockFile.cpp
++++ b/src/blockfile/SimpleBlockFile.cpp
+@@ -207,7 +207,7 @@
+    size_t nBytesWritten = file.Write(&header, nBytesToWrite);
+    if (nBytesWritten != nBytesToWrite)
+    {
+-      wxLogDebug(wxT("Wrote %d bytes, expected %d."), nBytesWritten, nBytesToWrite);
++      wxLogDebug(wxT("Wrote %lld bytes, expected %lld."), (long long) nBytesWritten, (long long) nBytesToWrite);
+       return false;
+    }
+ 
+@@ -215,7 +215,7 @@
+    nBytesWritten = file.Write(summaryData, nBytesToWrite);
+    if (nBytesWritten != nBytesToWrite)
+    {
+-      wxLogDebug(wxT("Wrote %d bytes, expected %d."), nBytesWritten, nBytesToWrite);
++      wxLogDebug(wxT("Wrote %lld bytes, expected %lld."), (long long) nBytesWritten, (long long) nBytesToWrite);
+       return false;
+    }
+ 
+@@ -237,7 +237,7 @@
+             #endif
+          if (nBytesWritten != nBytesToWrite)
+          {
+-            wxLogDebug(wxT("Wrote %d bytes, expected %d."), nBytesWritten, nBytesToWrite);
++            wxLogDebug(wxT("Wrote %lld bytes, expected %lld."), (long long) nBytesWritten, (long long) nBytesToWrite);
+             return false;
+          }
+       }
+@@ -250,7 +250,7 @@
+       nBytesWritten = file.Write(sampleData, nBytesToWrite);
+       if (nBytesWritten != nBytesToWrite)
+       {
+-         wxLogDebug(wxT("Wrote %d bytes, expected %d."), nBytesWritten, nBytesToWrite);
++         wxLogDebug(wxT("Wrote %lld bytes, expected %lld."), (long long) nBytesWritten, (long long) nBytesToWrite);
+          return false;
+       }
+    }
+--- a/src/commands/CompareAudioCommand.cpp
++++ b/src/commands/CompareAudioCommand.cpp
+@@ -135,8 +135,8 @@
+ 
+    // Output the results
+    double errorSeconds = mTrack0->LongSamplesToTime(errorCount);
+-   Status(wxString::Format(wxT("%i"), errorCount));
++   Status(wxString::Format(wxT("%li"), errorCount));
+    Status(wxString::Format(wxT("%.4f"), errorSeconds));
+-   Status(wxString::Format(wxT("Finished comparison: %i samples (%.3f seconds) exceeded the error threshold of %f."), errorCount, errorSeconds, errorThreshold));
++   Status(wxString::Format(wxT("Finished comparison: %li samples (%.3f seconds) exceeded the error threshold of %f."), errorCount, errorSeconds, errorThreshold));
+    return true;
+ }
+--- a/src/commands/ScriptCommandRelay.cpp
++++ b/src/commands/ScriptCommandRelay.cpp
+@@ -57,7 +57,7 @@
+    wxASSERT(cmd != NULL);
+    AppCommandEvent ev;
+    ev.SetCommand(cmd);
+-   project->AddPendingEvent(ev);
++   project->GetEventHandler()->AddPendingEvent(ev);
+ }
+ 
+ /// This is the function which actually obeys one command.  Rather than applying
+--- a/src/commands/Validators.h
++++ b/src/commands/Validators.h
+@@ -201,7 +201,7 @@
+    }
+    virtual wxString GetDescription() const
+    {
+-      return wxString::Format(wxT("between %d and %d"), mLower, mUpper);
++      return wxString::Format(wxT("between %f and %f"), mLower, mUpper);
+    }
+    virtual Validator *GetClone() const
+    {
+--- a/src/effects/BassTreble.cpp
++++ b/src/effects/BassTreble.cpp
+@@ -35,6 +35,7 @@
+ #include <wx/checkbox.h>
+ #include <wx/slider.h>
+ #include <wx/sizer.h>
++#include <wx/textctrl.h>
+ 
+ // Used to communicate the type of the filter.
+ static const int bassType = 0; //Low Shelf
+--- a/src/effects/Compressor.cpp
++++ b/src/effects/Compressor.cpp
+@@ -38,6 +38,7 @@
+ #include <wx/textdlg.h>
+ #include <wx/brush.h>
+ #include <wx/image.h>
++#include <wx/dcclient.h>
+ #include <wx/dcmemory.h>
+ 
+ #include "Compressor.h"
+--- a/src/effects/FindClipping.cpp
++++ b/src/effects/FindClipping.cpp
+@@ -183,7 +183,7 @@
+             if (stoprun >= mStop) {
+                l->AddLabel(startTime,
+                            t->LongSamplesToTime(start + s - mStop),
+-                           wxString::Format(wxT("%lld of %lld"), startrun, samps - mStop));
++                           wxString::Format(wxT("%lld of %lld"), (long long) startrun, (long long) (samps - mStop)));
+                startrun = 0;
+                stoprun = 0;
+                samps = 0;
+--- a/src/effects/ladspa/LadspaEffect.cpp
++++ b/src/effects/ladspa/LadspaEffect.cpp
+@@ -518,16 +518,14 @@
+    this->mData = data;
+    this->inputControls = inputControls;
+    this->sampleRate = sampleRate;
+-   #ifdef __WXMSW__
+-      // On Windows, for some reason, wxWidgets calls OnTextCtrl during creation
+-      // of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText,
+-      // which assumes all the fields have been initialized.
+-      // This can give us a bad pointer crash, so manipulate inSlider to
+-      // no-op HandleText during creation.
+-      inSlider = true;
+-   #else
+-      inSlider = false;
+-   #endif
++
++   // wxWidgets calls OnTextCtrl during creation
++   // of the text control, and LadspaEffectDialog::OnTextCtrl calls HandleText,
++   // which assumes all the fields have been initialized.
++   // This can give us a bad pointer crash, so manipulate inSlider to
++   // no-op HandleText during creation.
++   inSlider = true;
++
+    inText = false;
+ 
+    toggles = new wxCheckBox*[mData->PortCount];
+--- a/src/effects/ladspa/LoadLadspa.cpp
++++ b/src/effects/ladspa/LoadLadspa.cpp
+@@ -147,7 +147,7 @@
+       data = mainFn(index);
+       while(data) {
+ 
+-         wxString uniqid = wxString::Format(wxT("%08x-%s"), data->UniqueID, LAT1CTOWX(data->Label).c_str());
++         wxString uniqid = wxString::Format(wxT("%08x-%s"), (unsigned int) data->UniqueID, LAT1CTOWX(data->Label).c_str());
+          if (uniq.Index(uniqid) == wxNOT_FOUND) {
+             uniq.Add(uniqid);
+             std::set<wxString> categories;
+--- a/src/effects/nyquist/Nyquist.cpp
++++ b/src/effects/nyquist/Nyquist.cpp
+@@ -703,7 +703,7 @@
+          // See also http://bugzilla.audacityteam.org/show_bug.cgi?id=642#c9
+          // for further info about this thread safety question.
+          wxString prevlocale = wxSetlocale(LC_NUMERIC, NULL);
+-         wxSetlocale(LC_NUMERIC, wxT("C"));
++         wxSetlocale(LC_NUMERIC, wxString(wxT("C")));
+ 
+          nyx_init();
+          nyx_set_os_callback(StaticOSCallback, (void *)this);
+@@ -1242,13 +1242,7 @@
+             wxFloatingPointValidator<double> vld(12, &ctrl->val);
+             vld.SetRange(-FLT_MAX, FLT_MAX);
+             // Set number of decimal places
+-            if (ctrl->high - ctrl->low < 10) {
+-               vld.SetStyle(wxNUM_VAL_THREE_TRAILING_ZEROES);
+-            } else if (ctrl->high - ctrl->low < 100) {
+-               vld.SetStyle(wxNUM_VAL_TWO_TRAILING_ZEROES);
+-            } else {
+-               vld.SetStyle(wxNUM_VAL_ONE_TRAILING_ZERO);
+-            }
++            vld.SetStyle(wxNUM_VAL_NO_TRAILING_ZEROES);
+             item->SetValidator(vld);
+          }
+          else {
+--- a/src/export/ExportFFmpeg.cpp
++++ b/src/export/ExportFFmpeg.cpp
+@@ -452,7 +452,7 @@
+    if (codec == NULL)
+    {
+       wxLogError(wxT("FFmpeg : ERROR - Can't find audio codec 0x%x."),mEncAudioCodecCtx->codec_id);
+-      wxMessageBox(wxString::Format(_("FFmpeg cannot find audio codec 0x%x.\nSupport for this codec is probably not compiled in."),mEncAudioCodecCtx->codec_id));
++      wxMessageBox(wxString::Format(_("FFmpeg cannot find audio codec 0x%x.\nSupport for this codec is probably not compiled in."), (unsigned int) mEncAudioCodecCtx->codec_id));
+       return false;
+    }
+ 
+--- a/src/export/ExportFFmpegDialogs.cpp
++++ b/src/export/ExportFFmpegDialogs.cpp
+@@ -1846,7 +1846,7 @@
+       mCodecName->SetLabel(wxString(_("Failed to find the codec")));
+       return;
+    }
+-   mCodecName->SetLabel(wxString::Format(wxT("[%d] %s"),cdc->id,selcdclong->c_str()));
++   mCodecName->SetLabel(wxString::Format(wxT("[%d] %s"), (int) cdc->id,selcdclong->c_str()));
+ 
+    if (selfmt != NULL)
+    {
+--- a/src/export/ExportMP2.cpp
++++ b/src/export/ExportMP2.cpp
+@@ -276,8 +276,8 @@
+ 
+    ProgressDialog *progress = new ProgressDialog(wxFileName(fName).GetName(),
+       selectionOnly ?
+-      wxString::Format(_("Exporting selected audio at %d kbps"), bitrate) :
+-      wxString::Format(_("Exporting entire file at %d kbps"), bitrate));
++      wxString::Format(_("Exporting selected audio at %ld kbps"), bitrate) :
++      wxString::Format(_("Exporting entire file at %ld kbps"), bitrate));
+ 
+    int updateResult = eProgressSuccess;
+    while(updateResult == eProgressSuccess) {
+--- a/src/export/ExportMP3.cpp
++++ b/src/export/ExportMP3.cpp
+@@ -1799,7 +1799,7 @@
+ 
+       if (bytes < 0) {
+          wxString msg;
+-         msg.Printf(_("Error %d returned from MP3 encoder"), bytes);
++         msg.Printf(_("Error %ld returned from MP3 encoder"), bytes);
+          wxMessageBox(msg);
+          break;
+       }
+--- a/src/export/ExportMultiple.cpp
++++ b/src/export/ExportMultiple.cpp
+@@ -535,14 +535,14 @@
+    {
+       wxString msg;
+       msg.Printf(
+-         ok == eProgressSuccess ? _("Successfully exported the following %ld file(s).")
+-           : (ok == eProgressFailed ? _("Something went wrong after exporting the following %ld file(s).")
+-             : (ok == eProgressCancelled ? _("Export canceled after exporting the following %ld file(s).")
+-               : (ok == eProgressStopped ? _("Export stopped after exporting the following %ld file(s).")
+-                 : _("Something went really wrong after exporting the following %ld file(s).")
++         ok == eProgressSuccess ? _("Successfully exported the following %lld file(s).")
++           : (ok == eProgressFailed ? _("Something went wrong after exporting the following %lld file(s).")
++             : (ok == eProgressCancelled ? _("Export canceled after exporting the following %lld file(s).")
++               : (ok == eProgressStopped ? _("Export stopped after exporting the following %lld file(s).")
++                 : _("Something went really wrong after exporting the following %lld file(s).")
+                  )
+                )
+-             ), mExported.GetCount());
++             ), (long long) mExported.GetCount());
+ 
+       wxString FileList;
+       for (size_t i = 0; i < mExported.GetCount(); i++) {
+--- a/src/import/Import.cpp
++++ b/src/import/Import.cpp
+@@ -279,7 +279,7 @@
+                val.Append (wxT(":"));
+          }
+       }
+-      name.Printf (wxT("/ExtImportItems/Item%d"), i);
++      name.Printf (wxT("/ExtImportItems/Item%lld"), (long long) i);
+       gPrefs->Write (name, val);
+       gPrefs->Flush();
+    }
+@@ -288,7 +288,7 @@
+    more to delete.*/
+    i = this->mExtImportItems->Count();
+    do {
+-     name.Printf (wxT("/ExtImportItems/Item%d"), i);
++     name.Printf (wxT("/ExtImportItems/Item%lld"), (long long) i);
+      // No item to delete?  Then it's time to finish.
+      if (!gPrefs->Read(name, &val))
+         break;
+--- a/src/import/ImportFFmpeg.cpp
++++ b/src/import/ImportFFmpeg.cpp
+@@ -440,7 +440,7 @@
+          {
+             lang.FromUTF8(tag->value);
+          }
+-         strinfo.Printf(_("Index[%02x] Codec[%S], Language[%S], Bitrate[%S], Channels[%d], Duration[%d]"),sc->m_stream->id,codec->name,lang.c_str(),bitrate.c_str(),sc->m_stream->codec->channels, duration);
++         strinfo.Printf(_("Index[%02x] Codec[%s], Language[%s], Bitrate[%s], Channels[%d], Duration[%d]"),sc->m_stream->id,codec->name,lang.c_str(),bitrate.c_str(),sc->m_stream->codec->channels, duration);
+          mStreamInfo->Add(strinfo);
+          mScs[mNumStreams++] = sc;
+       }
+@@ -541,7 +541,7 @@
+       if (mScs[s]->m_stream->start_time != int64_t(AV_NOPTS_VALUE) && mScs[s]->m_stream->start_time > 0)
+       {
+          stream_delay = mScs[s]->m_stream->start_time;
+-         wxLogDebug(wxT("Stream %d start_time = %d, that would be %f milliseconds."), s, mScs[s]->m_stream->start_time, double(mScs[s]->m_stream->start_time)/AV_TIME_BASE*1000);
++         wxLogDebug(wxT("Stream %d start_time = %lld, that would be %f milliseconds."), s, (long long) mScs[s]->m_stream->start_time, double(mScs[s]->m_stream->start_time)/AV_TIME_BASE*1000);
+       }
+       if (stream_delay != 0)
+       {
+--- a/src/import/ImportGStreamer.cpp
++++ b/src/import/ImportGStreamer.cpp
+@@ -983,9 +983,9 @@
+       // Create stream info string
+       wxString strinfo;
+       strinfo.Printf(wxT("Index[%02d], Type[%s], Channels[%d], Rate[%d]"),
+-                     i,
++                     (unsigned int) i,
+                      wxString::FromUTF8(c->mType).c_str(),
+-                     c->mNumChannels,
++                     (int) c->mNumChannels,
+                      (int) c->mSampleRate);
+       mStreamInfo.Add(strinfo);
+    }
+@@ -1371,7 +1371,7 @@
+          }
+          else if (G_VALUE_HOLDS_UINT(val))
+          {
+-            string.Printf(wxT("%u"), g_value_get_uint(val));
++            string.Printf(wxT("%u"), (unsigned int) g_value_get_uint(val));
+          }
+          else if (G_VALUE_HOLDS_DOUBLE(val))
+          {
+--- a/src/import/ImportOGG.cpp
++++ b/src/import/ImportOGG.cpp
+@@ -109,7 +109,7 @@
+       for (int i = 0; i < vorbisFile->links; i++)
+       {
+          wxString strinfo;
+-         strinfo.Printf(wxT("Index[%02x] Version[%d], Channels[%d], Rate[%d]"),i,vorbisFile->vi[i].version,vorbisFile->vi[i].channels,vorbisFile->vi[i].rate);
++         strinfo.Printf(wxT("Index[%02x] Version[%d], Channels[%d], Rate[%ld]"), (unsigned int) i,vorbisFile->vi[i].version,vorbisFile->vi[i].channels,vorbisFile->vi[i].rate);
+          mStreamInfo->Add(strinfo);
+          mStreamUsage[i] = 0;
+       }
+--- a/src/import/ImportRaw.cpp
++++ b/src/import/ImportRaw.cpp
+@@ -337,7 +337,7 @@
+ 
+       if (sf_format_check(&info)) {
+          mEncodingSubtype[mNumEncodings] = subtype;
+-         encodings.Add(LAT1CTOWX(sf_encoding_index_name(i)));
++         encodings.Add(sf_encoding_index_name(i));
+ 
+          if ((mEncoding & SF_FORMAT_SUBMASK) == subtype)
+             selection = mNumEncodings;
+--- a/src/ondemand/ODManager.cpp
++++ b/src/ondemand/ODManager.cpp
+@@ -311,7 +311,7 @@
+          AudacityProject::AllProjectsDeleteLock();
+          AudacityProject* proj = GetActiveProject();
+          if(proj)
+-            proj->AddPendingEvent( event );
++            proj->GetEventHandler()->AddPendingEvent( event );
+          AudacityProject::AllProjectsDeleteUnlock();
+       }
+       mTerminateMutex.Lock();
+--- a/src/ondemand/ODTask.cpp
++++ b/src/ondemand/ODTask.cpp
+@@ -158,7 +158,7 @@
+          if(IsTaskAssociatedWithProject(gAudacityProjects[i]))
+          {
+             //this assumes tasks are only associated with one project.
+-            gAudacityProjects[i]->AddPendingEvent( event );
++            gAudacityProjects[i]->GetEventHandler()->AddPendingEvent( event );
+             //mark the changes so that the project can be resaved.
+             gAudacityProjects[i]->GetUndoManager()->SetODChangesFlag();
+             break;
+--- a/src/prefs/KeyConfigPrefs.cpp
++++ b/src/prefs/KeyConfigPrefs.cpp
+@@ -420,7 +420,7 @@
+       nevent.SetDirection(!e.ShiftDown());
+       nevent.SetEventObject(t);
+       nevent.SetCurrentFocus(t);
+-      t->GetParent()->ProcessEvent(nevent);
++      t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
+       return;
+    }
+ 
+@@ -465,7 +465,7 @@
+       nevent.SetDirection(!e.ShiftDown());
+       nevent.SetEventObject(t);
+       nevent.SetCurrentFocus(t);
+-      t->GetParent()->ProcessEvent(nevent);
++      t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
+ 
+       return;
+    }
+@@ -996,7 +996,7 @@
+       nevent.SetDirection(!e.ShiftDown());
+       nevent.SetEventObject(t);
+       nevent.SetCurrentFocus(t);
+-      t->GetParent()->ProcessEvent(nevent);
++      t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
+ 
+       return;
+    }
+--- a/src/prefs/PrefsDialog.cpp
++++ b/src/prefs/PrefsDialog.cpp
+@@ -185,8 +185,6 @@
+    Fit();
+    wxSize sz = GetSize();
+ 
+-   wxASSERT_MSG(sz.x <= 800 && sz.y <= 600, wxT("Preferences dialog exceeds max size"));
+-
+    if (sz.x > 800) {
+       sz.x = 800;
+    }
+--- a/src/prefs/QualityPrefs.cpp
++++ b/src/prefs/QualityPrefs.cpp
+@@ -162,13 +162,13 @@
+    {
+       S.StartMultiColumn(2, wxEXPAND);
+       {
+-         S.SetStretchyCol(2);
++         S.SetStretchyCol(1); // 2nd column (= index 1) is stretchy
+ 
+          S.TieChoice(_("Sample Rate Con&verter:"),
+                      Resample::GetFastMethodKey(),
+                      Resample::GetFastMethodDefault(),
+                      mConverterNames,
+-                     mConverterLabels),
++                     mConverterLabels);
+          S.SetSizeHints(mConverterNames);
+ 
+          S.TieChoice(_("&Dither:"),
+--- a/src/toolbars/DeviceToolBar.cpp
++++ b/src/toolbars/DeviceToolBar.cpp
+@@ -71,9 +71,7 @@
+ {
+    ToolBar::Create(parent);
+ 
+-   // Simulate a size event to set initial meter placement/size
+-   wxSizeEvent dummy;
+-   OnSize(dummy);
++   Layout();
+ }
+ 
+ void DeviceToolBar::RecreateTipWindows()
+@@ -618,7 +616,7 @@
+                name = _("2 (Stereo) Recording Channels");
+             }
+             else {
+-               name = wxString::Format(wxT("%d"), j + 1);
++               name = wxString::Format(wxT("%lld"), (long long) (j + 1));
+             }
+             mInputChannels->Append(name);
+          }
+--- a/src/toolbars/ToolsToolBar.cpp
++++ b/src/toolbars/ToolsToolBar.cpp
+@@ -59,7 +59,7 @@
+ 
+ // Strings to convert a tool number into a status message
+ // These MUST be in the same order as the ids above.
+-static const wxChar * MessageOfTool[numTools] = {
++static const wxString MessageOfTool[numTools] = {
+    wxTRANSLATE("Click and drag to select audio"),
+    wxTRANSLATE("Click and drag to edit the amplitude envelope"),
+    wxTRANSLATE("Click and drag to edit the samples"),
+--- a/src/widgets/ASlider.cpp
++++ b/src/widgets/ASlider.cpp
+@@ -1191,7 +1191,7 @@
+                nevent.SetDirection( !event.ShiftDown() );
+                nevent.SetEventObject( mParent );
+                nevent.SetCurrentFocus( mParent );
+-               mParent->GetParent()->ProcessEvent( nevent );
++               mParent->GetParent()->GetEventHandler()->ProcessEvent( nevent );
+             }
+             break;
+ 
+@@ -1203,7 +1203,7 @@
+                if (def && def->IsEnabled()) {
+                   wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
+                         def->GetId());
+-                  mParent->ProcessEvent(cevent);
++                  mParent->GetEventHandler()->ProcessEvent(cevent);
+                }
+             }
+ 
+@@ -1228,7 +1228,7 @@
+    int intValue = (int)( ( mCurrentValue - mMinValue ) * 1000.0f /
+                          ( mMaxValue - mMinValue ) );
+    e.SetInt( intValue );
+-   mParent->ProcessEvent( e );
++   mParent->GetEventHandler()->ProcessEvent( e );
+ }
+ 
+ int LWSlider::ValueToPosition(float val)
+--- a/src/widgets/ExpandingToolBar.cpp
++++ b/src/widgets/ExpandingToolBar.cpp
+@@ -72,6 +72,7 @@
+ #include <wx/window.h>
+ #endif
+ 
++#include <wx/dcclient.h>
+ #include <wx/dcmemory.h>
+ #include <wx/log.h>
+ #include <wx/dragimag.h>
+--- a/src/widgets/FileHistory.cpp
++++ b/src/widgets/FileHistory.cpp
+@@ -142,7 +142,7 @@
+    // Stored in reverse order
+    int n = mHistory.GetCount() - 1;
+    for (size_t i = 1; i <= mHistory.GetCount(); i++) {
+-      config.Write(wxString::Format(wxT("file%02d"), i), mHistory[n--]);
++      config.Write(wxString::Format(wxT("file%02d"), (int) i), mHistory[n--]);
+    }
+ 
+    config.SetPath(wxT(".."));
+--- a/src/widgets/Grabber.cpp
++++ b/src/widgets/Grabber.cpp
+@@ -89,7 +89,7 @@
+    e.SetEventObject(parent);
+ 
+    // Queue the event
+-   parent->AddPendingEvent(e);
++   parent->GetEventHandler()->AddPendingEvent(e);
+ }
+ 
+ //
+--- a/src/widgets/Grid.cpp
++++ b/src/widgets/Grid.cpp
+@@ -71,7 +71,8 @@
+ {
+    wxGridTableBase *table = grid->GetTable();
+ 
+-   table->GetValue(row, col).ToDouble(&mOld);
++   mOldString = table->GetValue(row, col);
++   mOldString.ToDouble(&mOld);
+ 
+    GetTimeCtrl()->SetTimeValue(mOld);
+    GetTimeCtrl()->EnableMenu();
+@@ -81,16 +82,32 @@
+ 
+ bool TimeEditor::EndEdit(int row, int col, wxGrid *grid)
+ {
++    wxString newvalue;
++    bool changed = EndEdit(row, col, grid, mOldString, &newvalue);
++    if (changed) {
++        ApplyEdit(row, col, grid);
++    }
++    return changed;
++}
++
++bool TimeEditor::EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval)
++{
+    double newtime = GetTimeCtrl()->GetTimeValue();
+    bool changed = newtime != mOld;
+ 
+    if (changed) {
+-      grid->GetTable()->SetValue(row, col, wxString::Format(wxT("%g"), newtime));
++      mValueAsString = wxString::Format(wxT("%g"), newtime);
++      *newval = mValueAsString;
+    }
+ 
+    return changed;
+ }
+ 
++void TimeEditor::ApplyEdit(int row, int col, wxGrid *grid)
++{
++   grid->GetTable()->SetValue(row, col, mValueAsString);
++}
++
+ void TimeEditor::Reset()
+ {
+    GetTimeCtrl()->SetTimeValue(mOld);
+@@ -295,8 +312,19 @@
+    Choice()->SetFocus();
+ }
+ 
++bool ChoiceEditor::EndEdit(int row, int col, wxGrid *grid)
++{
++    wxString newvalue;
++    bool changed = EndEdit(row, col, grid, mOld, &newvalue);
++    if (changed) {
++        ApplyEdit(row, col, grid);
++    }
++    return changed;
++}
++
+ bool ChoiceEditor::EndEdit(int row, int col,
+-                           wxGrid* grid)
++                           const wxGrid* grid,
++                           const wxString &oldval, wxString *newval)
+ {
+    int sel = Choice()->GetSelection();
+ 
+@@ -307,12 +335,20 @@
+    }
+ 
+    wxString val = mChoices[sel];
+-   if (val == mOld)
+-      return false;
++   bool changed = val != mOld;
++
++   if (changed)
++   {
++      mValueAsString = val;
++      *newval = val;
++   }
+ 
+-   grid->GetTable()->SetValue(row, col, val);
++   return changed;
++}
+ 
+-   return true;
++void ChoiceEditor::ApplyEdit(int row, int col, wxGrid *grid)
++{
++   grid->GetTable()->SetValue(row, col, mValueAsString);
+ }
+ 
+ void ChoiceEditor::Reset()
+@@ -491,7 +527,7 @@
+             if (def && def->IsEnabled()) {
+                wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
+                                      def->GetId());
+-               GetParent()->ProcessEvent(cevent);
++               GetParent()->GetEventHandler()->ProcessEvent(cevent);
+             }
+          }
+          else {
+--- a/src/widgets/Grid.h
++++ b/src/widgets/Grid.h
+@@ -52,8 +52,13 @@
+    void SetSize(const wxRect &rect);
+ 
+    void BeginEdit(int row, int col, wxGrid *grid);
++
+    bool EndEdit(int row, int col, wxGrid *grid);
+ 
++   bool EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval);
++
++   void ApplyEdit(int row, int col, wxGrid *grid);
++
+    void Reset();
+ 
+    wxString GetFormat();
+@@ -71,6 +76,8 @@
+    wxString mFormat;
+    double mRate;
+    double mOld;
++   wxString mOldString;
++   wxString mValueAsString;
+ };
+ 
+ // ----------------------------------------------------------------------------
+@@ -124,8 +131,13 @@
+    void SetSize(const wxRect &rect);
+ 
+    void BeginEdit(int row, int col, wxGrid *grid);
++
+    bool EndEdit(int row, int col, wxGrid *grid);
+ 
++   bool EndEdit(int row, int col, const wxGrid *grid, const wxString &oldval, wxString *newval);
++
++   void ApplyEdit(int row, int col, wxGrid *grid);
++
+    void Reset();
+ 
+    wxGridCellEditor *Clone() const;
+@@ -159,6 +171,7 @@
+ 
+    wxArrayString mChoices;
+    wxString mOld;
++   wxString mValueAsString;
+ };
+ 
+ // ----------------------------------------------------------------------------
+--- a/src/widgets/ImageRoll.cpp
++++ b/src/widgets/ImageRoll.cpp
+@@ -299,7 +299,7 @@
+ }
+ 
+ void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
+-                           int x, int y, int logicalFunc)
++                           int x, int y, wxRasterOperationMode logicalFunc)
+ {
+    if (logicalFunc == wxCOPY)
+       dc.DrawBitmap(bitmap, x, y);
+@@ -311,7 +311,7 @@
+    }
+ }
+ 
+-void ImageRoll::Draw(wxDC &dc, wxRect rect, int WXUNUSED(logicalFunc))
++void ImageRoll::Draw(wxDC &dc, wxRect rect, wxRasterOperationMode WXUNUSED(logicalFunc))
+ {
+    int width = rect.width;
+    int height = rect.height;
+@@ -434,7 +434,7 @@
+                 mImageRoll.GetMaxSize());
+ }
+ 
+-void ImageRollPanel::SetLogicalFunction(int func)
++void ImageRollPanel::SetLogicalFunction(wxRasterOperationMode func)
+ {
+    mLogicalFunction = func;
+ }
+--- a/src/widgets/ImageRoll.h
++++ b/src/widgets/ImageRoll.h
+@@ -12,9 +12,18 @@
+ #ifndef __AUDACITY_IMAGE_ROLL__
+ #define __AUDACITY_IMAGE_ROLL__
+ 
++#include <wx/dc.h>
++#include <wx/dcclient.h>
+ #include <wx/defs.h>
+ #include <wx/dynarray.h>
+ #include <wx/panel.h>
++#include <wx/version.h>
++
++
++#if wxMAJOR_VERSION < 3
++#  define wxRasterOperationMode int
++#endif
++
+ 
+ WX_DECLARE_OBJARRAY(wxBitmap, BitmapArray);
+ WX_DECLARE_OBJARRAY(wxImage, ImageArray);
+@@ -40,7 +49,7 @@
+    wxSize GetMaxSize() const { return mMaxSize; }
+ 
+    void Draw(wxDC &dc, wxRect rect,
+-             int logicalFunc = wxCOPY);
++             wxRasterOperationMode logicalFunc = wxCOPY);
+ 
+    static ImageArray SplitH(const wxImage &src, wxColour magicColor);
+    static ImageArray SplitV(const wxImage &src, wxColour magicColor);
+@@ -48,7 +57,7 @@
+  protected:
+ 
+    void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
+-                   int x, int y, int logicalFunc = wxCOPY);
++                   int x, int y, wxRasterOperationMode logicalFunc = wxCOPY);
+ 
+    void Init(RollType type, const wxImage &src, wxColour magicColor);
+ 
+@@ -72,7 +81,7 @@
+                   const wxSize& size = wxDefaultSize,
+                   long style = wxTAB_TRAVERSAL);
+ 
+-   void SetLogicalFunction(int func);
++   void SetLogicalFunction(wxRasterOperationMode func);
+ 
+    void OnPaint(wxPaintEvent &evt);
+    void OnSize(wxSizeEvent &evt);
+@@ -80,7 +89,7 @@
+  protected:
+    ImageRoll mImageRoll;
+ 
+-   int mLogicalFunction;
++   wxRasterOperationMode mLogicalFunction;
+ 
+    DECLARE_EVENT_TABLE();
+ 
+--- a/src/widgets/KeyView.cpp
++++ b/src/widgets/KeyView.cpp
+@@ -1576,7 +1576,7 @@
+    else
+    {
+       // A "menu" node, so prepend the line number
+-      k1.Printf(wxT("%08x%s"), t1->line, t1->label.c_str());
++      k1.Printf(wxT("%08x%s"), (unsigned int) t1->line, t1->label.c_str());
+    }
+ 
+    // See above for explanation
+@@ -1588,7 +1588,7 @@
+    else
+    {
+       // A "menu" node, so prepend the line number
+-      k2.Printf(wxT("%08x%s"), t2->line, t2->label.c_str());
++      k2.Printf(wxT("%08x%s"), (unsigned int) t2->line, t2->label.c_str());
+    }
+ 
+    // See wxWidgets documentation for explanation of comparison results.
+--- a/src/widgets/TimeTextCtrl.cpp
++++ b/src/widgets/TimeTextCtrl.cpp
+@@ -168,6 +168,7 @@
+ 
+ #include <math.h>
+ 
++#include <wx/dcclient.h>
+ #include <wx/dcmemory.h>
+ #include <wx/font.h>
+ #include <wx/intl.h>
+@@ -1435,7 +1436,7 @@
+       nevent.SetDirection(!event.ShiftDown());
+       nevent.SetEventObject(parent);
+       nevent.SetCurrentFocus(parent);
+-      GetParent()->ProcessEvent(nevent);
++      GetParent()->GetEventHandler()->ProcessEvent(nevent);
+       event.Skip(false);
+    }
+ 
+@@ -1445,7 +1446,7 @@
+       if (def && def->IsEnabled()) {
+          wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
+                                def->GetId());
+-         GetParent()->ProcessEvent(cevent);
++         GetParent()->GetEventHandler()->ProcessEvent(cevent);
+          event.Skip(false);
+       }
+    }
+--- a/src/widgets/numformatter.cpp
++++ b/src/widgets/numformatter.cpp
+@@ -11,6 +11,11 @@
+ // Licence:     wxWindows licence
+ /////////////////////////////////////////////////////////////////////////////
+ 
++#include "wx/version.h"
++
++// on wx >= 3.0 we should use the real numformatter (instead of a backported copy)
++#if !wxCHECK_VERSION(3,0,0)
++
+ // ----------------------------------------------------------------------------
+ // headers
+ // ----------------------------------------------------------------------------
+@@ -367,3 +372,6 @@
+     RemoveThousandsSeparators(s);
+     return s.ToDouble(val);
+ }
++
++#endif // !wxCHECK_VERSION(3,0,0)
++
+--- a/src/widgets/numformatter.h
++++ b/src/widgets/numformatter.h
+@@ -11,8 +11,15 @@
+ // Licence:     wxWindows licence
+ /////////////////////////////////////////////////////////////////////////////
+ 
+-#ifndef _WX_NUMFORMATTER_H_
+-#define _WX_NUMFORMATTER_H_
++#ifndef _NUMFORMATTER_H_
++#define _NUMFORMATTER_H_
++
++#include "wx/version.h"
++
++// on wx >= 3.0 we should use the real numformatter (instead of a backported copy)
++#if wxCHECK_VERSION(3,0,0)
++#  include "wx/numformatter.h"
++#else // wxCHECK_VERSION(3,0,0)
+ 
+ #include "wx/string.h"
+ 
+@@ -84,4 +91,6 @@
+     static void RemoveThousandsSeparators(wxString& s);
+ };
+ 
+-#endif // _WX_NUMFORMATTER_H_
++#endif // wxCHECK_VERSION(3,0,0)
++
++#endif // _NUMFORMATTER_H_
+--- a/src/widgets/valnum.cpp
++++ b/src/widgets/valnum.cpp
+@@ -11,6 +11,11 @@
+ // Licence:     wxWindows licence
+ /////////////////////////////////////////////////////////////////////////////
+ 
++#include "wx/version.h"
++
++// on wx >= 3.0 we should use the real valnum (instead of a backported copy)
++#if !wxCHECK_VERSION(3,0,0)
++
+ // ============================================================================
+ // Declarations
+ // ============================================================================
+@@ -310,3 +315,6 @@
+ }
+ 
+ #endif // wxUSE_VALIDATORS && wxUSE_TEXTCTRL
++
++#endif // !wxCHECK_VERSION(3,0,0)
++
+--- a/src/widgets/valnum.h
++++ b/src/widgets/valnum.h
+@@ -8,8 +8,15 @@
+ // Licence:     wxWindows licence
+ /////////////////////////////////////////////////////////////////////////////
+ 
+-#ifndef _WX_VALNUM_H_
+-#define _WX_VALNUM_H_
++#ifndef _VALNUM_H_
++#define _VALNUM_H_
++
++#include "wx/version.h"
++
++// on wx >= 3.0 we should use the real valnum (instead of a backported copy)
++#if wxCHECK_VERSION(3,0,0)
++#  include "wx/valnum.h"
++#else // wxCHECK_VERSION(3,0,0)
+ 
+ #include "wx/defs.h"
+ 
+@@ -471,4 +478,6 @@
+ 
+ #endif // wxUSE_VALIDATORS
+ 
+-#endif // _WX_VALNUM_H_
++#endif // wxCHECK_VERSION(3,0,0)
++
++#endif // _VALNUM_H_
+--- a/src/xml/XMLWriter.cpp
++++ b/src/xml/XMLWriter.cpp
+@@ -189,9 +189,9 @@
+ 
+ void XMLWriter::WriteAttr(const wxString &name, size_t value)
+ {
+-   Write(wxString::Format(wxT(" %s=\"%ld\""),
++   Write(wxString::Format(wxT(" %s=\"%lld\""),
+       name.c_str(),
+-      value));
++      (long long) value));
+ }
+ 
+ void XMLWriter::WriteAttr(const wxChar *name, size_t value)
+@@ -247,7 +247,7 @@
+       mHasKids[0] = true;
+    }
+ 
+-   Write(value.c_str());
++   Write(value);
+ }
+ 
+ void XMLWriter::WriteSubTree(const wxChar *value)

-- 
Audacity debian packaging



More information about the pkg-multimedia-commits mailing list