mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-16 08:34:10 +02:00
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.
This commit is contained in:
parent
0933da5b60
commit
bdcefb4850
2
configure
vendored
2
configure
vendored
@ -19723,7 +19723,7 @@ wx_version=`${WX_CONFIG} $wxconfigargs --version`
|
|||||||
$as_echo "$as_me: Checking that the chosen version of wxWidgets is 2.8.x" >&6;}
|
$as_echo "$as_me: Checking that the chosen version of wxWidgets is 2.8.x" >&6;}
|
||||||
|
|
||||||
case "${wx_version}" in
|
case "${wx_version}" in
|
||||||
2.8.*)
|
2.8.* | 3.0.*)
|
||||||
echo "Great, you're using wxWidgets ${wx_version}!"
|
echo "Great, you're using wxWidgets ${wx_version}!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -292,7 +292,7 @@ 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])
|
||||||
|
|
||||||
case "${wx_version}" in
|
case "${wx_version}" in
|
||||||
2.8.*)
|
2.8.* | 3.0.*)
|
||||||
echo "Great, you're using wxWidgets ${wx_version}!"
|
echo "Great, you're using wxWidgets ${wx_version}!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -49,16 +49,16 @@ void FileDialog::ClickButton(int index)
|
|||||||
// FileDialog convenience functions
|
// FileDialog convenience functions
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
wxString FileSelector(const wxChar *title,
|
wxString FileSelector(const wxString & title,
|
||||||
const wxChar *defaultDir,
|
const wxString & defaultDir,
|
||||||
const wxChar *defaultFileName,
|
const wxString & defaultFileName,
|
||||||
const wxChar *defaultExtension,
|
const wxString & defaultExtension,
|
||||||
const wxChar *filter,
|
const wxString & filter,
|
||||||
int flags,
|
int flags,
|
||||||
wxWindow *parent,
|
wxWindow *parent,
|
||||||
wxString label, fdCallback cb, void *cbdata)
|
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
|
// appended to the filename if the user fails to type an extension. The new
|
||||||
// implementation (taken from wxFileSelectorEx) appends the extension
|
// implementation (taken from wxFileSelectorEx) appends the extension
|
||||||
// automatically, by looking at the filter specification. In fact this
|
// automatically, by looking at the filter specification. In fact this
|
||||||
@ -70,21 +70,13 @@ wxString FileSelector(const wxChar *title,
|
|||||||
// suitable filter.
|
// suitable filter.
|
||||||
|
|
||||||
wxString filter2;
|
wxString filter2;
|
||||||
if (defaultExtension && !filter)
|
if (!defaultExtension.empty() && filter.empty())
|
||||||
filter2 = wxString(wxT("*.")) + defaultExtension;
|
filter2 = wxString(wxT("*.")) + defaultExtension;
|
||||||
else if (filter)
|
else if (!filter.empty())
|
||||||
filter2 = filter;
|
filter2 = filter;
|
||||||
|
|
||||||
wxString defaultDirString;
|
FileDialog fileDialog(parent, title, defaultDir,
|
||||||
if (defaultDir)
|
defaultFileName, filter2,
|
||||||
defaultDirString = defaultDir;
|
|
||||||
|
|
||||||
wxString defaultFilenameString;
|
|
||||||
if (defaultFileName)
|
|
||||||
defaultFilenameString = defaultFileName;
|
|
||||||
|
|
||||||
FileDialog fileDialog(parent, title, defaultDirString,
|
|
||||||
defaultFilenameString, filter2,
|
|
||||||
flags);
|
flags);
|
||||||
|
|
||||||
// Enable the extra button if desired
|
// Enable the extra button if desired
|
||||||
@ -94,7 +86,7 @@ wxString FileSelector(const wxChar *title,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// if filter is of form "All files (*)|*|..." set correct filter index
|
// 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;
|
int filterIndex = 0;
|
||||||
|
|
||||||
|
@ -43,11 +43,11 @@ typedef void (*fdCallback)(void *, int);
|
|||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
|
|
||||||
wxString
|
wxString
|
||||||
FileSelector(const wxChar *message = wxFileSelectorPromptStr,
|
FileSelector(const wxString & message = wxFileSelectorPromptStr,
|
||||||
const wxChar *default_path = NULL,
|
const wxString & default_path = wxEmptyString,
|
||||||
const wxChar *default_filename = NULL,
|
const wxString & default_filename = wxEmptyString,
|
||||||
const wxChar *default_extension = NULL,
|
const wxString & default_extension = wxEmptyString,
|
||||||
const wxChar *wildcard = wxFileSelectorDefaultWildcardStr,
|
const wxString & wildcard = wxFileSelectorDefaultWildcardStr,
|
||||||
int flags = 0,
|
int flags = 0,
|
||||||
wxWindow *parent = NULL,
|
wxWindow *parent = NULL,
|
||||||
wxString label = wxEmptyString,
|
wxString label = wxEmptyString,
|
||||||
|
@ -209,7 +209,7 @@ FileDialogHookFunction(HWND hDlg,
|
|||||||
{
|
{
|
||||||
CommDlg_OpenSave_SetControlText( hwndDialog,
|
CommDlg_OpenSave_SetControlText( hwndDialog,
|
||||||
pshHelp,
|
pshHelp,
|
||||||
(LPTSTR)me->m_buttonlabel.c_str());
|
(LPCTSTR)me->m_buttonlabel.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (CDN_HELP == (pNotifyCode->hdr).code)
|
else if (CDN_HELP == (pNotifyCode->hdr).code)
|
||||||
@ -515,7 +515,7 @@ void FileDialog::GetFilenames(wxArrayString& files) const
|
|||||||
void FileDialog::SetPath(const wxString& path)
|
void FileDialog::SetPath(const wxString& path)
|
||||||
{
|
{
|
||||||
wxString ext;
|
wxString ext;
|
||||||
wxSplitPath(path, &m_dir, &m_fileName, &ext);
|
wxFileName::SplitPath(path, &m_dir, &m_fileName, &ext);
|
||||||
if ( !ext.empty() )
|
if ( !ext.empty() )
|
||||||
m_fileName << wxT('.') << ext;
|
m_fileName << wxT('.') << ext;
|
||||||
}
|
}
|
||||||
@ -717,7 +717,7 @@ int FileDialog::ShowModal()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
of.lpstrFilter = (LPTSTR)filterBuffer.c_str();
|
of.lpstrFilter = (LPCTSTR)filterBuffer.c_str();
|
||||||
of.nFilterIndex = m_filterIndex + 1;
|
of.nFilterIndex = m_filterIndex + 1;
|
||||||
|
|
||||||
ParseFilter(of.nFilterIndex);
|
ParseFilter(of.nFilterIndex);
|
||||||
|
2
lib-src/lib-widget-extra/configure
vendored
2
lib-src/lib-widget-extra/configure
vendored
@ -16447,7 +16447,7 @@ wx_version=`${WX_CONFIG} $wxconfigargs --version`
|
|||||||
$as_echo "$as_me: Checking that the chosen version of wxWidgets is 2.8.x" >&6;}
|
$as_echo "$as_me: Checking that the chosen version of wxWidgets is 2.8.x" >&6;}
|
||||||
|
|
||||||
case "${wx_version}" in
|
case "${wx_version}" in
|
||||||
2.8.*)
|
2.8.* | 3.0.*)
|
||||||
echo "Great, you're using wxWidgets ${wx_version}!"
|
echo "Great, you're using wxWidgets ${wx_version}!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -131,7 +131,7 @@ 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])
|
||||||
|
|
||||||
case "${wx_version}" in
|
case "${wx_version}" in
|
||||||
2.8.*)
|
2.8.* | 3.0.*)
|
||||||
echo "Great, you're using wxWidgets ${wx_version}!"
|
echo "Great, you're using wxWidgets ${wx_version}!"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
@ -606,7 +606,7 @@ public:
|
|||||||
if (!cmd.IsEmpty()) {
|
if (!cmd.IsEmpty()) {
|
||||||
wxCommandEvent e(EVT_OPEN_AUDIO_FILE);
|
wxCommandEvent e(EVT_OPEN_AUDIO_FILE);
|
||||||
e.SetString(data);
|
e.SetString(data);
|
||||||
project->AddPendingEvent(e);
|
project->GetEventHandler()->AddPendingEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1295,7 +1295,11 @@ bool AudacityApp::OnInit()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (option < argc - 1 &&
|
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])) {
|
!wxString(wxT("-blocksize")).CmpNoCase(argv[option])) {
|
||||||
long theBlockSize;
|
long theBlockSize;
|
||||||
if (wxString(argv[option + 1]).ToLong(&theBlockSize)) {
|
if (wxString(argv[option + 1]).ToLong(&theBlockSize)) {
|
||||||
|
@ -286,7 +286,7 @@ void AudacityLogger::OnSave(wxCommandEvent & WXUNUSED(e))
|
|||||||
wxString fName = _("log.txt");
|
wxString fName = _("log.txt");
|
||||||
|
|
||||||
fName = FileSelector(_("Save log to:"),
|
fName = FileSelector(_("Save log to:"),
|
||||||
NULL,
|
wxEmptyString,
|
||||||
fName,
|
fName,
|
||||||
wxT("txt"),
|
wxT("txt"),
|
||||||
wxT("*.txt"),
|
wxT("*.txt"),
|
||||||
|
@ -245,7 +245,7 @@ void BenchmarkDialog::OnSave( wxCommandEvent & WXUNUSED(event))
|
|||||||
wxString fName = wxT("benchmark.txt");
|
wxString fName = wxT("benchmark.txt");
|
||||||
|
|
||||||
fName = FileSelector(wxT("Export Benchmark Data As:"),
|
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(""))
|
if (fName == wxT(""))
|
||||||
return;
|
return;
|
||||||
|
@ -76,6 +76,7 @@ void FileIO::Close()
|
|||||||
void FileIO::SetCatalogInfo()
|
void FileIO::SetCatalogInfo()
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
if (!mOpen ) {
|
if (!mOpen ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -90,6 +91,7 @@ void FileIO::SetCatalogInfo()
|
|||||||
(ext[3] & 0xff);
|
(ext[3] & 0xff);
|
||||||
|
|
||||||
SetCatalogInfo(type);
|
SetCatalogInfo(type);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -98,6 +100,7 @@ void FileIO::SetCatalogInfo()
|
|||||||
void FileIO::SetCatalogInfo(wxUint32 type)
|
void FileIO::SetCatalogInfo(wxUint32 type)
|
||||||
{
|
{
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
if (!mOpen ) {
|
if (!mOpen ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -105,6 +108,7 @@ void FileIO::SetCatalogInfo(wxUint32 type)
|
|||||||
wxFileName fn(mName);
|
wxFileName fn(mName);
|
||||||
|
|
||||||
fn.MacSetTypeAndCreator(type, AUDACITY_CREATOR);
|
fn.MacSetTypeAndCreator(type, AUDACITY_CREATOR);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
@ -43,10 +43,10 @@ the mouse around.
|
|||||||
#pragma hdrstop
|
#pragma hdrstop
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef WX_PRECOMP
|
|
||||||
#include <wx/brush.h>
|
#include <wx/brush.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/choice.h>
|
#include <wx/choice.h>
|
||||||
|
#include <wx/font.h>
|
||||||
#include <wx/image.h>
|
#include <wx/image.h>
|
||||||
#include <wx/dcmemory.h>
|
#include <wx/dcmemory.h>
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
@ -56,7 +56,6 @@ the mouse around.
|
|||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/statusbr.h>
|
#include <wx/statusbr.h>
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <wx/textfile.h>
|
#include <wx/textfile.h>
|
||||||
|
|
||||||
@ -124,7 +123,7 @@ FreqWindow::FreqWindow(wxWindow * parent, wxWindowID id,
|
|||||||
if (!p)
|
if (!p)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
mFreqFont = wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
|
mFreqFont = wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||||
mArrowCursor = new wxCursor(wxCURSOR_ARROW);
|
mArrowCursor = new wxCursor(wxCURSOR_ARROW);
|
||||||
mCrossCursor = new wxCursor(wxCURSOR_CROSS);
|
mCrossCursor = new wxCursor(wxCURSOR_CROSS);
|
||||||
|
|
||||||
@ -1223,7 +1222,7 @@ void FreqWindow::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||||||
wxString fName = _("spectrum.txt");
|
wxString fName = _("spectrum.txt");
|
||||||
|
|
||||||
fName = FileSelector(_("Export Spectral Data As:"),
|
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(""))
|
if (fName == wxT(""))
|
||||||
return;
|
return;
|
||||||
|
@ -188,7 +188,7 @@ char *Internat::VerifyFilename(const wxString &s, bool input)
|
|||||||
wxMessageBox(_("The specified filename could not be converted due to Unicode character use."));
|
wxMessageBox(_("The specified filename could not be converted due to Unicode character use."));
|
||||||
|
|
||||||
name = FileSelector(_("Specify New Filename:"),
|
name = FileSelector(_("Specify New Filename:"),
|
||||||
NULL,
|
wxEmptyString,
|
||||||
name,
|
name,
|
||||||
f.GetExt(),
|
f.GetExt(),
|
||||||
wxT("*.") + f.GetExt(),
|
wxT("*.") + f.GetExt(),
|
||||||
|
@ -567,7 +567,7 @@ void LabelDialog::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||||||
wxString fName = mTrackNames[mTrackNames.GetCount() - 1].AfterFirst(wxT('-')).Mid(1);
|
wxString fName = mTrackNames[mTrackNames.GetCount() - 1].AfterFirst(wxT('-')).Mid(1);
|
||||||
|
|
||||||
fName = FileSelector(_("Export Labels As:"),
|
fName = FileSelector(_("Export Labels As:"),
|
||||||
NULL,
|
wxEmptyString,
|
||||||
fName.c_str(),
|
fName.c_str(),
|
||||||
wxT("txt"),
|
wxT("txt"),
|
||||||
wxT("*.txt"),
|
wxT("*.txt"),
|
||||||
|
@ -230,12 +230,12 @@ unsigned int Lyrics::GetDefaultFontSize() const
|
|||||||
|
|
||||||
void Lyrics::SetDrawnFont(wxDC *dc)
|
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
|
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->SetDefaultStyle(wxTextAttr(wxNullColour, wxNullColour, newFont));
|
||||||
mHighlightTextCtrl->SetStyle(0, mHighlightTextCtrl->GetLastPosition(),
|
mHighlightTextCtrl->SetStyle(0, mHighlightTextCtrl->GetLastPosition(),
|
||||||
wxTextAttr(wxNullColour, wxNullColour, newFont));
|
wxTextAttr(wxNullColour, wxNullColour, newFont));
|
||||||
|
@ -2399,7 +2399,7 @@ void AudacityProject::OnTrackMenu()
|
|||||||
// The workaround is to queue a context menu event, allowing the key press
|
// The workaround is to queue a context menu event, allowing the key press
|
||||||
// event to complete.
|
// event to complete.
|
||||||
wxContextMenuEvent e(wxEVT_CONTEXT_MENU, GetId());
|
wxContextMenuEvent e(wxEVT_CONTEXT_MENU, GetId());
|
||||||
mTrackPanel->AddPendingEvent(e);
|
mTrackPanel->GetEventHandler()->AddPendingEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
void AudacityProject::OnTrackMute()
|
void AudacityProject::OnTrackMute()
|
||||||
@ -2873,7 +2873,7 @@ void AudacityProject::OnExportLabels()
|
|||||||
}
|
}
|
||||||
|
|
||||||
fName = FileSelector(_("Export Labels As:"),
|
fName = FileSelector(_("Export Labels As:"),
|
||||||
NULL,
|
wxEmptyString,
|
||||||
fName,
|
fName,
|
||||||
wxT("txt"),
|
wxT("txt"),
|
||||||
wxT("*.txt"),
|
wxT("*.txt"),
|
||||||
@ -2954,7 +2954,7 @@ void AudacityProject::OnExportMIDI(){
|
|||||||
wxString fName = wxT("");
|
wxString fName = wxT("");
|
||||||
|
|
||||||
fName = FileSelector(_("Export MIDI As:"),
|
fName = FileSelector(_("Export MIDI As:"),
|
||||||
NULL,
|
wxEmptyString,
|
||||||
fName,
|
fName,
|
||||||
wxT(".mid|.gro"),
|
wxT(".mid|.gro"),
|
||||||
_("MIDI file (*.mid)|*.mid|Allegro file (*.gro)|*.gro"),
|
_("MIDI file (*.mid)|*.mid|Allegro file (*.gro)|*.gro"),
|
||||||
|
@ -331,8 +331,14 @@ MixerTrackCluster::MixerTrackCluster(wxWindow* parent,
|
|||||||
#endif // wxUSE_TOOLTIPS
|
#endif // wxUSE_TOOLTIPS
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
#if wxCHECK_VERSION(3, 0, 0)
|
||||||
|
wxSizeEvent event(GetSize(), GetId());
|
||||||
|
event.SetEventObject(this);
|
||||||
|
GetEventHandler()->ProcessEvent(event);
|
||||||
|
#else
|
||||||
wxSizeEvent dummyEvent;
|
wxSizeEvent dummyEvent;
|
||||||
this->OnSize(dummyEvent);
|
this->OnSize(dummyEvent);
|
||||||
|
#endif
|
||||||
UpdateGain();
|
UpdateGain();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#ifndef __AUDACITY_PITCHNAME__
|
#ifndef __AUDACITY_PITCHNAME__
|
||||||
#define __AUDACITY_PITCHNAME__
|
#define __AUDACITY_PITCHNAME__
|
||||||
|
|
||||||
#include <wx/defs.h>
|
#include <wx/wx.h>
|
||||||
|
|
||||||
// FreqToMIDInote takes a frequency in Hz (exponential scale relative to
|
// FreqToMIDInote takes a frequency in Hz (exponential scale relative to
|
||||||
// alphabetic pitch names) and returns a pitch ID number (linear
|
// alphabetic pitch names) and returns a pitch ID number (linear
|
||||||
|
@ -37,9 +37,7 @@ wxString PlatformCompatibility::GetExecutablePath()
|
|||||||
static wxString path;
|
static wxString path;
|
||||||
|
|
||||||
if (!found) {
|
if (!found) {
|
||||||
wxStandardPaths std;
|
path = wxStandardPaths::Get().GetExecutablePath();
|
||||||
|
|
||||||
path = std.GetExecutablePath();
|
|
||||||
|
|
||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
@ -85,9 +85,11 @@ scroll information. It also has some status flags.
|
|||||||
#include <wx/arrimpl.cpp> // this allows for creation of wxObjArray
|
#include <wx/arrimpl.cpp> // this allows for creation of wxObjArray
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
#include <CoreServices/CoreServices.h>
|
#include <CoreServices/CoreServices.h>
|
||||||
#include <wx/mac/private.h>
|
#include <wx/mac/private.h>
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Project.h"
|
#include "Project.h"
|
||||||
|
|
||||||
@ -278,9 +280,11 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
#if defined(__WXMAC__)
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
if (format.GetFormatId() == kDragPromisedFlavorFindFile) {
|
if (format.GetFormatId() == kDragPromisedFlavorFindFile) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -305,6 +309,7 @@ public:
|
|||||||
bool GetData()
|
bool GetData()
|
||||||
{
|
{
|
||||||
bool foundSupported = false;
|
bool foundSupported = false;
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
bool firstFileAdded = false;
|
bool firstFileAdded = false;
|
||||||
OSErr result;
|
OSErr result;
|
||||||
|
|
||||||
@ -356,13 +361,14 @@ public:
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return foundSupported;
|
return foundSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OnDrop(wxCoord x, wxCoord y)
|
bool OnDrop(wxCoord x, wxCoord y)
|
||||||
{
|
{
|
||||||
bool foundSupported = false;
|
bool foundSupported = false;
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
bool firstFileAdded = false;
|
bool firstFileAdded = false;
|
||||||
OSErr result;
|
OSErr result;
|
||||||
|
|
||||||
@ -387,7 +393,7 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return CurrentDragHasSupportedFormat();
|
return CurrentDragHasSupportedFormat();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1715,7 +1721,7 @@ bool AudacityProject::HandleKeyDown(wxKeyEvent & event)
|
|||||||
wxCommandEvent e(EVT_CAPTURE_KEY);
|
wxCommandEvent e(EVT_CAPTURE_KEY);
|
||||||
e.SetEventObject(&event);
|
e.SetEventObject(&event);
|
||||||
|
|
||||||
if (w->ProcessEvent(e)) {
|
if (w->GetEventHandler()->ProcessEvent(e)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3268,8 +3274,10 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
wxFileName fn(mFileName);
|
wxFileName fn(mFileName);
|
||||||
fn.MacSetTypeAndCreator(AUDACITY_PROJECT_TYPE, AUDACITY_CREATOR);
|
fn.MacSetTypeAndCreator(AUDACITY_PROJECT_TYPE, AUDACITY_CREATOR);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (bWantSaveCompressed)
|
if (bWantSaveCompressed)
|
||||||
|
@ -1047,8 +1047,8 @@ void Sequence::WriteXML(XMLWriter &xmlFile)
|
|||||||
_("Sequence has block file with length %s > mMaxSamples %s.\nTruncating to mMaxSamples."),
|
_("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)(bb->f->GetLength())).ToDouble(), 0).c_str(),
|
||||||
Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
|
Internat::ToString(((wxLongLong)mMaxSamples).ToDouble(), 0).c_str());
|
||||||
::wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
|
wxMessageBox(sMsg, _("Warning - Length in Writing Sequence"), wxICON_EXCLAMATION | wxOK);
|
||||||
::wxLogWarning(sMsg);
|
wxLogWarning(sMsg);
|
||||||
bb->f->SetLength(mMaxSamples);
|
bb->f->SetLength(mMaxSamples);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -474,7 +474,7 @@ bool Tags::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
|
|||||||
|
|
||||||
while (*attrs) {
|
while (*attrs) {
|
||||||
wxString attr = *attrs++;
|
wxString attr = *attrs++;
|
||||||
if (!*attr)
|
if (attr.IsEmpty())
|
||||||
break;
|
break;
|
||||||
wxString value = *attrs++;
|
wxString value = *attrs++;
|
||||||
|
|
||||||
|
@ -5127,7 +5127,7 @@ void TrackPanel::OnMouseEvent(wxMouseEvent & event)
|
|||||||
// The activate event is used to make the
|
// The activate event is used to make the
|
||||||
// parent window 'come alive' if it didn't have focus.
|
// parent window 'come alive' if it didn't have focus.
|
||||||
wxActivateEvent e;
|
wxActivateEvent e;
|
||||||
GetParent()->ProcessEvent(e);
|
GetParent()->GetEventHandler()->ProcessEvent(e);
|
||||||
|
|
||||||
// wxTimers seem to be a little unreliable, so this
|
// wxTimers seem to be a little unreliable, so this
|
||||||
// "primes" it to make sure it keeps going for a while...
|
// "primes" it to make sure it keeps going for a while...
|
||||||
@ -5564,7 +5564,7 @@ int TrackPanel::DetermineToolToUse( ToolsToolBar * pTtb, wxMouseEvent & event)
|
|||||||
int trackKind = pTrack->GetKind();
|
int trackKind = pTrack->GetKind();
|
||||||
currentTool = selectTool; // the default.
|
currentTool = selectTool; // the default.
|
||||||
|
|
||||||
if( event.ButtonIsDown(3) || event.RightUp()){
|
if (event.ButtonIsDown(wxMOUSE_BTN_RIGHT) || event.RightUp()){
|
||||||
currentTool = zoomTool;
|
currentTool = zoomTool;
|
||||||
} else if( trackKind == Track::Time ){
|
} else if( trackKind == Track::Time ){
|
||||||
currentTool = envelopeTool;
|
currentTool = envelopeTool;
|
||||||
@ -8360,7 +8360,7 @@ TrackInfo::TrackInfo(wxWindow * pParentIn)
|
|||||||
mSliderOffset = 0;
|
mSliderOffset = 0;
|
||||||
|
|
||||||
int fontSize = 10;
|
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 allowableWidth = GetTrackInfoWidth() - 2; // 2 to allow for left/right borders
|
||||||
int textWidth, textHeight;
|
int textWidth, textHeight;
|
||||||
|
@ -307,20 +307,20 @@ wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
|
|||||||
{
|
{
|
||||||
/* i18n-hint: This is for screen reader software and indicates that
|
/* i18n-hint: This is for screen reader software and indicates that
|
||||||
on this track mute is on.*/
|
on this track mute is on.*/
|
||||||
*name->Append( _( " Mute On" ) );
|
name->Append( _( " Mute On" ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
if( t->GetSolo() )
|
if( t->GetSolo() )
|
||||||
{
|
{
|
||||||
/* i18n-hint: This is for screen reader software and indicates that
|
/* i18n-hint: This is for screen reader software and indicates that
|
||||||
on this track solo is on.*/
|
on this track solo is on.*/
|
||||||
*name->Append( _( " Solo On" ) );
|
name->Append( _( " Solo On" ) );
|
||||||
}
|
}
|
||||||
if( t->GetSelected() )
|
if( t->GetSelected() )
|
||||||
{
|
{
|
||||||
/* i18n-hint: This is for screen reader software and indicates that
|
/* i18n-hint: This is for screen reader software and indicates that
|
||||||
this track is selected.*/
|
this track is selected.*/
|
||||||
*name->Append( _( " Select On" ) );
|
name->Append( _( " Select On" ) );
|
||||||
}
|
}
|
||||||
if( t->IsSyncLockSelected() )
|
if( t->IsSyncLockSelected() )
|
||||||
{
|
{
|
||||||
@ -328,7 +328,7 @@ wxAccStatus TrackPanelAx::GetName( int childId, wxString* name )
|
|||||||
this track is shown with a sync-locked icon.*/
|
this track is shown with a sync-locked icon.*/
|
||||||
// The absence of a dash between Sync and Locked is deliberate -
|
// The absence of a dash between Sync and Locked is deliberate -
|
||||||
// if present, Jaws reads it as "dash".
|
// if present, Jaws reads it as "dash".
|
||||||
*name->Append( _( " Sync Lock Selected" ) );
|
name->Append( _( " Sync Lock Selected" ) );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -57,7 +57,7 @@ void ScriptCommandRelay::PostCommand(AudacityProject *project, Command *cmd)
|
|||||||
wxASSERT(cmd != NULL);
|
wxASSERT(cmd != NULL);
|
||||||
AppCommandEvent ev;
|
AppCommandEvent ev;
|
||||||
ev.SetCommand(cmd);
|
ev.SetCommand(cmd);
|
||||||
project->AddPendingEvent(ev);
|
project->GetEventHandler()->AddPendingEvent(ev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// This is the function which actually obeys one command. Rather than applying
|
/// This is the function which actually obeys one command. Rather than applying
|
||||||
|
@ -35,6 +35,7 @@
|
|||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
#include <wx/slider.h>
|
#include <wx/slider.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/textctrl.h>
|
||||||
|
|
||||||
// Used to communicate the type of the filter.
|
// Used to communicate the type of the filter.
|
||||||
static const int bassType = 0; //Low Shelf
|
static const int bassType = 0; //Low Shelf
|
||||||
|
@ -14,6 +14,8 @@
|
|||||||
class wxString;
|
class wxString;
|
||||||
|
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
|
#include <wx/dc.h>
|
||||||
|
#include <wx/dcclient.h>
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/checkbox.h>
|
#include <wx/checkbox.h>
|
||||||
|
@ -496,7 +496,7 @@ void ContrastDialog::OnExport(wxCommandEvent & WXUNUSED(event))
|
|||||||
wxString fName = wxT("contrast.txt");
|
wxString fName = wxT("contrast.txt");
|
||||||
|
|
||||||
fName = FileSelector(_("Export Contrast Result As:"),
|
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(""))
|
if (fName == wxT(""))
|
||||||
return;
|
return;
|
||||||
|
@ -3579,7 +3579,7 @@ void VSTEffect::SizeWindow(int w, int h)
|
|||||||
wxCommandEvent sw(EVT_SIZEWINDOW);
|
wxCommandEvent sw(EVT_SIZEWINDOW);
|
||||||
sw.SetInt(w);
|
sw.SetInt(w);
|
||||||
sw.SetExtraLong(h);
|
sw.SetExtraLong(h);
|
||||||
mDlg->AddPendingEvent(sw);
|
mDlg->GetEventHandler()->AddPendingEvent(sw);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -3590,7 +3590,7 @@ void VSTEffect::UpdateDisplay()
|
|||||||
// Tell the dialog to refresh effect information
|
// Tell the dialog to refresh effect information
|
||||||
if (mDlg) {
|
if (mDlg) {
|
||||||
wxCommandEvent ud(EVT_UPDATEDISPLAY);
|
wxCommandEvent ud(EVT_UPDATEDISPLAY);
|
||||||
mDlg->AddPendingEvent(ud);
|
mDlg->GetEventHandler()->AddPendingEvent(ud);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -716,7 +716,7 @@ bool EffectNyquist::Process()
|
|||||||
// See also http://bugzilla.audacityteam.org/show_bug.cgi?id=642#c9
|
// See also http://bugzilla.audacityteam.org/show_bug.cgi?id=642#c9
|
||||||
// for further info about this thread safety question.
|
// for further info about this thread safety question.
|
||||||
wxString prevlocale = wxSetlocale(LC_NUMERIC, NULL);
|
wxString prevlocale = wxSetlocale(LC_NUMERIC, NULL);
|
||||||
wxSetlocale(LC_NUMERIC, wxT("C"));
|
wxSetlocale(LC_NUMERIC, wxString(wxT("C")));
|
||||||
|
|
||||||
nyx_init();
|
nyx_init();
|
||||||
nyx_set_os_callback(StaticOSCallback, (void *)this);
|
nyx_set_os_callback(StaticOSCallback, (void *)this);
|
||||||
|
@ -587,9 +587,11 @@ int ExportPCM::Export(AudacityProject *project,
|
|||||||
AddID3Chunk(fName, metadata, sf_format);
|
AddID3Chunk(fName, metadata, sf_format);
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
#if !wxCHECK_VERSION(3, 0, 0)
|
||||||
wxFileName fn(fName);
|
wxFileName fn(fName);
|
||||||
fn.MacSetTypeAndCreator(sf_header_mactype(sf_format & SF_FORMAT_TYPEMASK),
|
fn.MacSetTypeAndCreator(sf_header_mactype(sf_format & SF_FORMAT_TYPEMASK),
|
||||||
AUDACITY_CREATOR);
|
AUDACITY_CREATOR);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return updateResult;
|
return updateResult;
|
||||||
|
@ -337,7 +337,7 @@ ImportRawDialog::ImportRawDialog(wxWindow * parent,
|
|||||||
|
|
||||||
if (sf_format_check(&info)) {
|
if (sf_format_check(&info)) {
|
||||||
mEncodingSubtype[mNumEncodings] = subtype;
|
mEncodingSubtype[mNumEncodings] = subtype;
|
||||||
encodings.Add(LAT1CTOWX(sf_encoding_index_name(i)));
|
encodings.Add(sf_encoding_index_name(i));
|
||||||
|
|
||||||
if ((mEncoding & SF_FORMAT_SUBMASK) == subtype)
|
if ((mEncoding & SF_FORMAT_SUBMASK) == subtype)
|
||||||
selection = mNumEncodings;
|
selection = mNumEncodings;
|
||||||
|
@ -311,7 +311,7 @@ void ODManager::Start()
|
|||||||
AudacityProject::AllProjectsDeleteLock();
|
AudacityProject::AllProjectsDeleteLock();
|
||||||
AudacityProject* proj = GetActiveProject();
|
AudacityProject* proj = GetActiveProject();
|
||||||
if(proj)
|
if(proj)
|
||||||
proj->AddPendingEvent( event );
|
proj->GetEventHandler()->AddPendingEvent(event);
|
||||||
AudacityProject::AllProjectsDeleteUnlock();
|
AudacityProject::AllProjectsDeleteUnlock();
|
||||||
}
|
}
|
||||||
mTerminateMutex.Lock();
|
mTerminateMutex.Lock();
|
||||||
|
@ -158,7 +158,7 @@ void ODTask::DoSome(float amountWork)
|
|||||||
if(IsTaskAssociatedWithProject(gAudacityProjects[i]))
|
if(IsTaskAssociatedWithProject(gAudacityProjects[i]))
|
||||||
{
|
{
|
||||||
//this assumes tasks are only associated with one project.
|
//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.
|
//mark the changes so that the project can be resaved.
|
||||||
gAudacityProjects[i]->GetUndoManager()->SetODChangesFlag();
|
gAudacityProjects[i]->GetUndoManager()->SetODChangesFlag();
|
||||||
break;
|
break;
|
||||||
|
@ -420,7 +420,7 @@ void KeyConfigPrefs::OnHotkeyKeyDown(wxKeyEvent & e)
|
|||||||
nevent.SetDirection(!e.ShiftDown());
|
nevent.SetDirection(!e.ShiftDown());
|
||||||
nevent.SetEventObject(t);
|
nevent.SetEventObject(t);
|
||||||
nevent.SetCurrentFocus(t);
|
nevent.SetCurrentFocus(t);
|
||||||
t->GetParent()->ProcessEvent(nevent);
|
t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -465,7 +465,7 @@ void KeyConfigPrefs::OnFilterKeyDown(wxKeyEvent & e)
|
|||||||
nevent.SetDirection(!e.ShiftDown());
|
nevent.SetDirection(!e.ShiftDown());
|
||||||
nevent.SetEventObject(t);
|
nevent.SetEventObject(t);
|
||||||
nevent.SetCurrentFocus(t);
|
nevent.SetCurrentFocus(t);
|
||||||
t->GetParent()->ProcessEvent(nevent);
|
t->GetParent()->GetEventHandler()->ProcessEvent(nevent);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -607,9 +607,14 @@ void ControlToolBar::PlayPlayRegion(double t0, double t1,
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// msmeyer: Show error message if stream could not be opened
|
// msmeyer: Show error message if stream could not be opened
|
||||||
wxMessageBox(_(
|
wxMessageBox(
|
||||||
"Error while opening sound device. "
|
#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.")),
|
wxT("Please check the playback device settings and the project sample rate.")),
|
||||||
|
#endif
|
||||||
_("Error"), wxOK | wxICON_EXCLAMATION, this);
|
_("Error"), wxOK | wxICON_EXCLAMATION, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,8 +72,14 @@ void DeviceToolBar::Create(wxWindow *parent)
|
|||||||
ToolBar::Create(parent);
|
ToolBar::Create(parent);
|
||||||
|
|
||||||
// Simulate a size event to set initial meter placement/size
|
// 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;
|
wxSizeEvent dummy;
|
||||||
OnSize(dummy);
|
OnSize(dummy);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void DeviceToolBar::RecreateTipWindows()
|
void DeviceToolBar::RecreateTipWindows()
|
||||||
|
@ -106,7 +106,7 @@ void SelectionBar::Create(wxWindow * parent)
|
|||||||
void SelectionBar::Populate()
|
void SelectionBar::Populate()
|
||||||
{
|
{
|
||||||
// This will be inherited by all children:
|
// This will be inherited by all children:
|
||||||
SetFont(wxFont(9, wxSWISS, wxNORMAL, wxNORMAL));
|
SetFont(wxFont(9, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||||
|
|
||||||
wxFlexGridSizer *mainSizer;
|
wxFlexGridSizer *mainSizer;
|
||||||
wxBoxSizer *hSizer;
|
wxBoxSizer *hSizer;
|
||||||
|
@ -47,10 +47,6 @@
|
|||||||
#include <wx/minifram.h>
|
#include <wx/minifram.h>
|
||||||
#include <wx/popupwin.h>
|
#include <wx/popupwin.h>
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
|
||||||
#include <wx/mac/uma.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ToolManager.h"
|
#include "ToolManager.h"
|
||||||
#include "ControlToolBar.h"
|
#include "ControlToolBar.h"
|
||||||
#include "DeviceToolBar.h"
|
#include "DeviceToolBar.h"
|
||||||
@ -744,7 +740,7 @@ void ToolManager::WriteConfig()
|
|||||||
int bo = mBotDock->GetOrder( bar );
|
int bo = mBotDock->GetOrder( bar );
|
||||||
|
|
||||||
// Save
|
// 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("Order"), to + bo );
|
||||||
gPrefs->Write( wxT("Show"), IsVisible( ndx ) );
|
gPrefs->Write( wxT("Show"), IsVisible( ndx ) );
|
||||||
|
|
||||||
|
@ -57,23 +57,6 @@
|
|||||||
|
|
||||||
IMPLEMENT_CLASS(ToolsToolBar, ToolBar);
|
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
|
/// Methods for ToolsToolBar
|
||||||
////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////
|
||||||
@ -96,6 +79,19 @@ ToolsToolBar::ToolsToolBar()
|
|||||||
wxASSERT( zoomTool == zoomTool - firstTool );
|
wxASSERT( zoomTool == zoomTool - firstTool );
|
||||||
wxASSERT( drawTool == drawTool - firstTool );
|
wxASSERT( drawTool == drawTool - firstTool );
|
||||||
wxASSERT( multiTool == multiTool - 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()
|
ToolsToolBar::~ToolsToolBar()
|
||||||
@ -258,7 +254,8 @@ const wxChar * ToolsToolBar::GetMessageForTool( int ToolNumber )
|
|||||||
{
|
{
|
||||||
wxASSERT( ToolNumber >= 0 );
|
wxASSERT( ToolNumber >= 0 );
|
||||||
wxASSERT( ToolNumber < numTools );
|
wxASSERT( ToolNumber < numTools );
|
||||||
return wxGetTranslation(MessageOfTool[ ToolNumber ]);
|
|
||||||
|
return mMessageOfTool[ToolNumber];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -79,6 +79,8 @@ class ToolsToolBar:public ToolBar {
|
|||||||
wxGridSizer *mToolSizer;
|
wxGridSizer *mToolSizer;
|
||||||
int mCurrentTool;
|
int mCurrentTool;
|
||||||
|
|
||||||
|
const wxChar *mMessageOfTool[numTools];
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
DECLARE_CLASS(ToolsToolBar);
|
DECLARE_CLASS(ToolsToolBar);
|
||||||
|
@ -1191,7 +1191,7 @@ void LWSlider::OnKeyEvent(wxKeyEvent & event)
|
|||||||
nevent.SetDirection( !event.ShiftDown() );
|
nevent.SetDirection( !event.ShiftDown() );
|
||||||
nevent.SetEventObject( mParent );
|
nevent.SetEventObject( mParent );
|
||||||
nevent.SetCurrentFocus( mParent );
|
nevent.SetCurrentFocus( mParent );
|
||||||
mParent->GetParent()->ProcessEvent( nevent );
|
mParent->GetParent()->GetEventHandler()->ProcessEvent(nevent);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1203,7 +1203,7 @@ void LWSlider::OnKeyEvent(wxKeyEvent & event)
|
|||||||
if (def && def->IsEnabled()) {
|
if (def && def->IsEnabled()) {
|
||||||
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
|
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
|
||||||
def->GetId());
|
def->GetId());
|
||||||
mParent->ProcessEvent(cevent);
|
mParent->GetEventHandler()->ProcessEvent(cevent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1228,7 +1228,7 @@ void LWSlider::SendUpdate( float newValue )
|
|||||||
int intValue = (int)( ( mCurrentValue - mMinValue ) * 1000.0f /
|
int intValue = (int)( ( mCurrentValue - mMinValue ) * 1000.0f /
|
||||||
( mMaxValue - mMinValue ) );
|
( mMaxValue - mMinValue ) );
|
||||||
e.SetInt( intValue );
|
e.SetInt( intValue );
|
||||||
mParent->ProcessEvent( e );
|
mParent->GetEventHandler()->ProcessEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
int LWSlider::ValueToPosition(float val)
|
int LWSlider::ValueToPosition(float val)
|
||||||
|
@ -72,6 +72,7 @@ ExpandingToolBar.
|
|||||||
#include <wx/window.h>
|
#include <wx/window.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
#include <wx/dcmemory.h>
|
#include <wx/dcmemory.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
#include <wx/dragimag.h>
|
#include <wx/dragimag.h>
|
||||||
|
@ -89,7 +89,7 @@ void Grabber::SendEvent(wxEventType type, const wxPoint & pos)
|
|||||||
e.SetEventObject(parent);
|
e.SetEventObject(parent);
|
||||||
|
|
||||||
// Queue the event
|
// Queue the event
|
||||||
parent->AddPendingEvent(e);
|
parent->GetEventHandler()->AddPendingEvent(e);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
@ -79,6 +79,28 @@ void TimeEditor::BeginEdit(int row, int col, wxGrid *grid)
|
|||||||
GetTimeCtrl()->SetFocus();
|
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)
|
bool TimeEditor::EndEdit(int row, int col, wxGrid *grid)
|
||||||
{
|
{
|
||||||
double newtime = GetTimeCtrl()->GetTimeValue();
|
double newtime = GetTimeCtrl()->GetTimeValue();
|
||||||
@ -91,6 +113,8 @@ bool TimeEditor::EndEdit(int row, int col, wxGrid *grid)
|
|||||||
return changed;
|
return changed;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void TimeEditor::Reset()
|
void TimeEditor::Reset()
|
||||||
{
|
{
|
||||||
GetTimeCtrl()->SetTimeValue(mOld);
|
GetTimeCtrl()->SetTimeValue(mOld);
|
||||||
@ -295,8 +319,40 @@ void ChoiceEditor::BeginEdit(int row, int col, wxGrid* grid)
|
|||||||
Choice()->SetFocus();
|
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,
|
bool ChoiceEditor::EndEdit(int row, int col,
|
||||||
wxGrid* grid)
|
wxGrid* grid)
|
||||||
{
|
{
|
||||||
int sel = Choice()->GetSelection();
|
int sel = Choice()->GetSelection();
|
||||||
|
|
||||||
@ -315,6 +371,8 @@ bool ChoiceEditor::EndEdit(int row, int col,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
void ChoiceEditor::Reset()
|
void ChoiceEditor::Reset()
|
||||||
{
|
{
|
||||||
Choice()->SetSelection(mChoices.Index(mOld));
|
Choice()->SetSelection(mChoices.Index(mOld));
|
||||||
@ -491,7 +549,7 @@ void Grid::OnKeyDown(wxKeyEvent &event)
|
|||||||
if (def && def->IsEnabled()) {
|
if (def && def->IsEnabled()) {
|
||||||
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
|
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
|
||||||
def->GetId());
|
def->GetId());
|
||||||
GetParent()->ProcessEvent(cevent);
|
GetParent()->GetEventHandler()->ProcessEvent(cevent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -52,7 +52,14 @@ class TimeEditor:public wxGridCellEditor
|
|||||||
void SetSize(const wxRect &rect);
|
void SetSize(const wxRect &rect);
|
||||||
|
|
||||||
void BeginEdit(int row, int col, wxGrid *grid);
|
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);
|
bool EndEdit(int row, int col, wxGrid *grid);
|
||||||
|
#endif
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
@ -71,6 +78,7 @@ class TimeEditor:public wxGridCellEditor
|
|||||||
wxString mFormat;
|
wxString mFormat;
|
||||||
double mRate;
|
double mRate;
|
||||||
double mOld;
|
double mOld;
|
||||||
|
double mNew;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@ -124,7 +132,14 @@ public:
|
|||||||
void SetSize(const wxRect &rect);
|
void SetSize(const wxRect &rect);
|
||||||
|
|
||||||
void BeginEdit(int row, int col, wxGrid *grid);
|
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);
|
bool EndEdit(int row, int col, wxGrid *grid);
|
||||||
|
#endif
|
||||||
|
|
||||||
void Reset();
|
void Reset();
|
||||||
|
|
||||||
@ -159,6 +174,7 @@ public:
|
|||||||
|
|
||||||
wxArrayString mChoices;
|
wxArrayString mChoices;
|
||||||
wxString mOld;
|
wxString mOld;
|
||||||
|
wxString mNew;
|
||||||
};
|
};
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@ -96,6 +96,7 @@
|
|||||||
|
|
||||||
#include "ImageRoll.h"
|
#include "ImageRoll.h"
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
#include <wx/arrimpl.cpp>
|
#include <wx/arrimpl.cpp>
|
||||||
#include <wx/bitmap.h>
|
#include <wx/bitmap.h>
|
||||||
#include <wx/dcmemory.h>
|
#include <wx/dcmemory.h>
|
||||||
@ -299,7 +300,7 @@ bool ImageRoll::Ok() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
|
void ImageRoll::DrawBitmap(wxDC &dc, wxBitmap &bitmap,
|
||||||
int x, int y, int logicalFunc)
|
int x, int y, wxRasterOperationMode logicalFunc)
|
||||||
{
|
{
|
||||||
if (logicalFunc == wxCOPY)
|
if (logicalFunc == wxCOPY)
|
||||||
dc.DrawBitmap(bitmap, x, y);
|
dc.DrawBitmap(bitmap, x, y);
|
||||||
|
@ -12,10 +12,15 @@
|
|||||||
#ifndef __AUDACITY_IMAGE_ROLL__
|
#ifndef __AUDACITY_IMAGE_ROLL__
|
||||||
#define __AUDACITY_IMAGE_ROLL__
|
#define __AUDACITY_IMAGE_ROLL__
|
||||||
|
|
||||||
|
#include <wx/dc.h>
|
||||||
#include <wx/defs.h>
|
#include <wx/defs.h>
|
||||||
#include <wx/dynarray.h>
|
#include <wx/dynarray.h>
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
|
|
||||||
|
#if !wxCHECK_VERSION(3,0,0)
|
||||||
|
#define wxRasterOperationMode int
|
||||||
|
#endif
|
||||||
|
|
||||||
WX_DECLARE_OBJARRAY(wxBitmap, BitmapArray);
|
WX_DECLARE_OBJARRAY(wxBitmap, BitmapArray);
|
||||||
WX_DECLARE_OBJARRAY(wxImage, ImageArray);
|
WX_DECLARE_OBJARRAY(wxImage, ImageArray);
|
||||||
|
|
||||||
@ -48,7 +53,7 @@ class ImageRoll
|
|||||||
protected:
|
protected:
|
||||||
|
|
||||||
void DrawBitmap(wxDC &dc, wxBitmap &bitmap,
|
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);
|
void Init(RollType type, const wxImage &src, wxColour magicColor);
|
||||||
|
|
||||||
|
@ -55,10 +55,6 @@
|
|||||||
#include <wx/tooltip.h>
|
#include <wx/tooltip.h>
|
||||||
#include <wx/msgdlg.h>
|
#include <wx/msgdlg.h>
|
||||||
|
|
||||||
#if defined(__WXMAC__)
|
|
||||||
#include <wx/mac/uma.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "Meter.h"
|
#include "Meter.h"
|
||||||
@ -756,7 +752,7 @@ wxFont Meter::GetFont()
|
|||||||
fontSize = 8;
|
fontSize = 8;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
|
return wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Meter::ResetBar(MeterBar *b, bool resetClipping)
|
void Meter::ResetBar(MeterBar *b, bool resetClipping)
|
||||||
|
@ -116,9 +116,9 @@ Ruler::Ruler()
|
|||||||
fontSize = 8;
|
fontSize = 8;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
mMinorMinorFont = new wxFont(fontSize-1, wxSWISS, wxNORMAL, wxNORMAL);
|
mMinorMinorFont = new wxFont(fontSize - 1, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||||
mMinorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
|
mMinorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||||
mMajorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD);
|
mMajorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
|
||||||
mUserFonts = false;
|
mUserFonts = false;
|
||||||
|
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
@ -934,45 +934,45 @@ void Ruler::Update(TimeTrack* timetrack)// Envelope *speedEnv, long minSpeed, lo
|
|||||||
int j;
|
int j;
|
||||||
|
|
||||||
if (!mUserFonts) {
|
if (!mUserFonts) {
|
||||||
int fontSize = 4;
|
int fontSize = 4;
|
||||||
wxCoord strW, strH, strD, strL;
|
wxCoord strW, strH, strD, strL;
|
||||||
wxString exampleText = wxT("0.9"); //ignored for height calcs on all platforms
|
wxString exampleText = wxT("0.9"); //ignored for height calcs on all platforms
|
||||||
int desiredPixelHeight;
|
int desiredPixelHeight;
|
||||||
|
|
||||||
if (mOrientation == wxHORIZONTAL)
|
if (mOrientation == wxHORIZONTAL)
|
||||||
desiredPixelHeight = mBottom-mTop-5; // height less ticks and 1px gap
|
desiredPixelHeight = mBottom - mTop - 5; // height less ticks and 1px gap
|
||||||
else
|
else
|
||||||
desiredPixelHeight = 12; // why 12? 10 -> 12 seems to be max/min
|
desiredPixelHeight = 12; // why 12? 10 -> 12 seems to be max/min
|
||||||
|
|
||||||
if (desiredPixelHeight < 10)//8)
|
if (desiredPixelHeight < 10)//8)
|
||||||
desiredPixelHeight = 10;//8;
|
desiredPixelHeight = 10;//8;
|
||||||
if (desiredPixelHeight > 12)
|
if (desiredPixelHeight > 12)
|
||||||
desiredPixelHeight = 12;
|
desiredPixelHeight = 12;
|
||||||
|
|
||||||
// Keep making the font bigger until it's too big, then subtract one.
|
// 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);
|
mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL);
|
||||||
while( (strH-strD-strL) <= desiredPixelHeight && fontSize < 40) {
|
while ((strH - strD - strL) <= desiredPixelHeight && fontSize < 40) {
|
||||||
fontSize++;
|
fontSize++;
|
||||||
mDC->SetFont(wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD));
|
mDC->SetFont(wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD));
|
||||||
mDC->GetTextExtent(exampleText, &strW, &strH, &strD, & strL);
|
mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL);
|
||||||
}
|
}
|
||||||
fontSize--;
|
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);
|
mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL);
|
||||||
mLead = strL;
|
mLead = strL;
|
||||||
|
|
||||||
if (mMajorFont)
|
if (mMajorFont)
|
||||||
delete mMajorFont;
|
delete mMajorFont;
|
||||||
mMajorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxBOLD);
|
mMajorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD);
|
||||||
|
|
||||||
if (mMinorFont)
|
if (mMinorFont)
|
||||||
delete mMinorFont;
|
delete mMinorFont;
|
||||||
mMinorFont = new wxFont(fontSize, wxSWISS, wxNORMAL, wxNORMAL);
|
mMinorFont = new wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||||
|
|
||||||
if (mMinorMinorFont)
|
if (mMinorMinorFont)
|
||||||
delete mMinorMinorFont;
|
delete mMinorMinorFont;
|
||||||
mMinorMinorFont = new wxFont(fontSize-1, wxSWISS, wxNORMAL, wxNORMAL);
|
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.
|
// If ruler is being resized, we could end up with it being too small.
|
||||||
|
@ -168,6 +168,7 @@ different formats.
|
|||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
|
#include <wx/wx.h>
|
||||||
#include <wx/dcmemory.h>
|
#include <wx/dcmemory.h>
|
||||||
#include <wx/font.h>
|
#include <wx/font.h>
|
||||||
#include <wx/intl.h>
|
#include <wx/intl.h>
|
||||||
@ -1055,18 +1056,18 @@ bool TimeTextCtrl::Layout()
|
|||||||
wxString exampleText = wxT("0");
|
wxString exampleText = wxT("0");
|
||||||
|
|
||||||
// Keep making the font bigger until it's too big, then subtract one.
|
// 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);
|
memDC.GetTextExtent(exampleText, &strW, &strH);
|
||||||
while(strW <= mDigitBoxW && strH <= mDigitBoxH) {
|
while(strW <= mDigitBoxW && strH <= mDigitBoxH) {
|
||||||
fontSize++;
|
fontSize++;
|
||||||
memDC.SetFont(wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL));
|
memDC.SetFont(wxFont(fontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL));
|
||||||
memDC.GetTextExtent(exampleText, &strW, &strH);
|
memDC.GetTextExtent(exampleText, &strW, &strH);
|
||||||
}
|
}
|
||||||
fontSize--;
|
fontSize--;
|
||||||
|
|
||||||
if (mDigitFont)
|
if (mDigitFont)
|
||||||
delete mDigitFont;
|
delete mDigitFont;
|
||||||
mDigitFont = new wxFont(fontSize, wxFIXED, wxNORMAL, wxNORMAL);
|
mDigitFont = new wxFont(fontSize, wxFONTFAMILY_TELETYPE, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL);
|
||||||
memDC.SetFont(*mDigitFont);
|
memDC.SetFont(*mDigitFont);
|
||||||
memDC.GetTextExtent(exampleText, &strW, &strH);
|
memDC.GetTextExtent(exampleText, &strW, &strH);
|
||||||
mDigitW = strW;
|
mDigitW = strW;
|
||||||
@ -1076,7 +1077,7 @@ bool TimeTextCtrl::Layout()
|
|||||||
fontSize--;
|
fontSize--;
|
||||||
if (mLabelFont)
|
if (mLabelFont)
|
||||||
delete 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
|
// Figure out the x-position of each field and label in the box
|
||||||
x = mBorderLeft;
|
x = mBorderLeft;
|
||||||
@ -1435,7 +1436,7 @@ void TimeTextCtrl::OnKeyDown(wxKeyEvent &event)
|
|||||||
nevent.SetDirection(!event.ShiftDown());
|
nevent.SetDirection(!event.ShiftDown());
|
||||||
nevent.SetEventObject(parent);
|
nevent.SetEventObject(parent);
|
||||||
nevent.SetCurrentFocus(parent);
|
nevent.SetCurrentFocus(parent);
|
||||||
GetParent()->ProcessEvent(nevent);
|
GetParent()->GetEventHandler()->ProcessEvent(nevent);
|
||||||
event.Skip(false);
|
event.Skip(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1445,7 +1446,7 @@ void TimeTextCtrl::OnKeyDown(wxKeyEvent &event)
|
|||||||
if (def && def->IsEnabled()) {
|
if (def && def->IsEnabled()) {
|
||||||
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
|
wxCommandEvent cevent(wxEVT_COMMAND_BUTTON_CLICKED,
|
||||||
def->GetId());
|
def->GetId());
|
||||||
GetParent()->ProcessEvent(cevent);
|
GetParent()->GetEventHandler()->ProcessEvent(cevent);
|
||||||
event.Skip(false);
|
event.Skip(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -242,8 +242,13 @@ wxString wxNumberFormatter::ToString(long val, int style)
|
|||||||
|
|
||||||
wxString wxNumberFormatter::ToString(wxLongLong_t val, int style)
|
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);
|
style);
|
||||||
|
#else
|
||||||
|
return PostProcessIntString(wxString::Format(wxT("%") wxLongLongFmtSpec wxT("d"), val),
|
||||||
|
style);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
|
#endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
|
||||||
|
@ -124,21 +124,11 @@ void XMLWriter::WriteAttr(const wxString &name, const wxString &value)
|
|||||||
XMLEsc(value).c_str()));
|
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)
|
void XMLWriter::WriteAttr(const wxString &name, const wxChar *value)
|
||||||
{
|
{
|
||||||
WriteAttr(name, wxString(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)
|
void XMLWriter::WriteAttr(const wxString &name, int value)
|
||||||
{
|
{
|
||||||
Write(wxString::Format(wxT(" %s=\"%d\""),
|
Write(wxString::Format(wxT(" %s=\"%d\""),
|
||||||
@ -146,11 +136,6 @@ void XMLWriter::WriteAttr(const wxString &name, int value)
|
|||||||
value));
|
value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxChar *name, int value)
|
|
||||||
{
|
|
||||||
WriteAttr(wxString(name), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxString &name, bool value)
|
void XMLWriter::WriteAttr(const wxString &name, bool value)
|
||||||
{
|
{
|
||||||
Write(wxString::Format(wxT(" %s=\"%d\""),
|
Write(wxString::Format(wxT(" %s=\"%d\""),
|
||||||
@ -158,11 +143,6 @@ void XMLWriter::WriteAttr(const wxString &name, bool value)
|
|||||||
value));
|
value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxChar *name, bool value)
|
|
||||||
{
|
|
||||||
WriteAttr(wxString(name), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxString &name, long value)
|
void XMLWriter::WriteAttr(const wxString &name, long value)
|
||||||
{
|
{
|
||||||
Write(wxString::Format(wxT(" %s=\"%ld\""),
|
Write(wxString::Format(wxT(" %s=\"%ld\""),
|
||||||
@ -170,11 +150,6 @@ void XMLWriter::WriteAttr(const wxString &name, long value)
|
|||||||
value));
|
value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxChar *name, long value)
|
|
||||||
{
|
|
||||||
WriteAttr(wxString(name), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxString &name, long long value)
|
void XMLWriter::WriteAttr(const wxString &name, long long value)
|
||||||
{
|
{
|
||||||
Write(wxString::Format(wxT(" %s=\"%lld\""),
|
Write(wxString::Format(wxT(" %s=\"%lld\""),
|
||||||
@ -182,11 +157,6 @@ void XMLWriter::WriteAttr(const wxString &name, long long value)
|
|||||||
value));
|
value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxChar *name, long long value)
|
|
||||||
{
|
|
||||||
WriteAttr(wxString(name), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxString &name, size_t value)
|
void XMLWriter::WriteAttr(const wxString &name, size_t value)
|
||||||
{
|
{
|
||||||
Write(wxString::Format(wxT(" %s=\"%ld\""),
|
Write(wxString::Format(wxT(" %s=\"%ld\""),
|
||||||
@ -194,11 +164,6 @@ void XMLWriter::WriteAttr(const wxString &name, size_t value)
|
|||||||
value));
|
value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxChar *name, size_t value)
|
|
||||||
{
|
|
||||||
WriteAttr(wxString(name), value);
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMLWriter::WriteAttr(const wxString &name, float value, int digits)
|
void XMLWriter::WriteAttr(const wxString &name, float value, int digits)
|
||||||
{
|
{
|
||||||
Write(wxString::Format(wxT(" %s=\"%s\""),
|
Write(wxString::Format(wxT(" %s=\"%s\""),
|
||||||
@ -206,11 +171,6 @@ void XMLWriter::WriteAttr(const wxString &name, float value, int digits)
|
|||||||
Internat::ToString(value, digits).c_str()));
|
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)
|
void XMLWriter::WriteAttr(const wxString &name, double value, int digits)
|
||||||
{
|
{
|
||||||
Write(wxString::Format(wxT(" %s=\"%s\""),
|
Write(wxString::Format(wxT(" %s=\"%s\""),
|
||||||
@ -218,11 +178,6 @@ void XMLWriter::WriteAttr(const wxString &name, double value, int digits)
|
|||||||
Internat::ToString(value, digits).c_str()));
|
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)
|
void XMLWriter::WriteData(const wxString &value)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
@ -234,11 +189,6 @@ void XMLWriter::WriteData(const wxString &value)
|
|||||||
Write(XMLEsc(value));
|
Write(XMLEsc(value));
|
||||||
}
|
}
|
||||||
|
|
||||||
void XMLWriter::WriteData(const wxChar *value)
|
|
||||||
{
|
|
||||||
WriteData(wxString(value));
|
|
||||||
}
|
|
||||||
|
|
||||||
void XMLWriter::WriteSubTree(const wxString &value)
|
void XMLWriter::WriteSubTree(const wxString &value)
|
||||||
{
|
{
|
||||||
if (mInTag) {
|
if (mInTag) {
|
||||||
@ -250,16 +200,6 @@ void XMLWriter::WriteSubTree(const wxString &value)
|
|||||||
Write(value.c_str());
|
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
|
// See http://www.w3.org/TR/REC-xml for reference
|
||||||
wxString XMLWriter::XMLEsc(const wxString & s)
|
wxString XMLWriter::XMLEsc(const wxString & s)
|
||||||
{
|
{
|
||||||
|
@ -27,32 +27,19 @@ class AUDACITY_DLL_API XMLWriter {
|
|||||||
void EndTag(const wxString &name);
|
void EndTag(const wxString &name);
|
||||||
|
|
||||||
void WriteAttr(const wxString &name, const wxString &value);
|
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 wxString &name, const wxChar *value);
|
||||||
void WriteAttr(const wxChar *name, const wxString &value);
|
|
||||||
|
|
||||||
void WriteAttr(const wxString &name, int 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 wxString &name, bool value);
|
||||||
void WriteAttr(const wxChar *name, bool value);
|
|
||||||
void WriteAttr(const wxString &name, long 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 wxString &name, long long value);
|
||||||
void WriteAttr(const wxChar *name, long long value);
|
|
||||||
void WriteAttr(const wxString &name, size_t 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 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 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 wxString &value);
|
||||||
void WriteData(const wxChar *value);
|
|
||||||
|
|
||||||
void WriteSubTree(const wxString &value);
|
void WriteSubTree(const wxString &value);
|
||||||
void WriteSubTree(const wxChar *value);
|
|
||||||
|
|
||||||
void Write(const wxChar *data);
|
|
||||||
|
|
||||||
virtual void Write(const wxString &data) = 0;
|
virtual void Write(const wxString &data) = 0;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user