From 309f9a90ce69cfdc119ccdc40a27095d405eff3c Mon Sep 17 00:00:00 2001 From: martynshaw99 Date: Thu, 16 Jun 2011 23:29:56 +0000 Subject: [PATCH] Disallow non-numeric chars in numeric input boxes. Patch by Ed using examples by Martyn & James. --- src/Languages.cpp | 4 +-- src/effects/Noise.cpp | 2 +- src/effects/NoiseRemoval.cpp | 6 ++++ src/effects/Phaser.cpp | 21 +++++++++---- src/effects/ToneGen.cpp | 12 +++---- src/effects/TruncSilence.cpp | 6 ++-- src/effects/Wahwah.cpp | 18 ++++++++--- src/effects/nyquist/Nyquist.cpp | 2 ++ src/prefs/DirectoriesPrefs.cpp | 8 ++--- src/prefs/MidiIOPrefs.cpp | 6 ++-- src/prefs/PlaybackPrefs.cpp | 40 +++++++++++------------ src/prefs/QualityPrefs.cpp | 6 ++-- src/prefs/RecordingPrefs.cpp | 32 +++++++++---------- src/prefs/SpectrumPrefs.cpp | 56 ++++++++++++++++----------------- 14 files changed, 122 insertions(+), 97 deletions(-) diff --git a/src/Languages.cpp b/src/Languages.cpp index ff5d40d78..23ba0572c 100644 --- a/src/Languages.cpp +++ b/src/Languages.cpp @@ -197,10 +197,10 @@ void GetLanguages(wxArrayString &langCodes, wxArrayString &langNames) tempNames.Add(name); tempHash[code] = name; - wxLogDebug(wxT("code=%s name=%s fullCode=%s name=%s -> %s"), +/* wxLogDebug(wxT("code=%s name=%s fullCode=%s name=%s -> %s"), code.c_str(), localLanguageName[code].c_str(), fullCode.c_str(), localLanguageName[fullCode].c_str(), - name.c_str()); + name.c_str());*/ } } diff --git a/src/effects/Noise.cpp b/src/effects/Noise.cpp index 2871c8bcd..7b7dd7ea6 100644 --- a/src/effects/Noise.cpp +++ b/src/effects/Noise.cpp @@ -196,7 +196,7 @@ void NoiseDialog::PopulateOrExchange( ShuttleGui & S ) // the translatable strings to avoid breaking translations close to 2.0. // TODO: Make colon part of the translatable string after 2.0. S.TieChoice(_("Noise type") + wxString(wxT(":")), nType, nTypeList); - S.TieTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), nAmplitude, 10); + S.TieNumericTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), nAmplitude, 10); S.AddPrompt(_("Duration") + wxString(wxT(":"))); if (mNoiseDurationT == NULL) { diff --git a/src/effects/NoiseRemoval.cpp b/src/effects/NoiseRemoval.cpp index 82c3b35cf..0d2d8e3fb 100644 --- a/src/effects/NoiseRemoval.cpp +++ b/src/effects/NoiseRemoval.cpp @@ -70,6 +70,7 @@ #include #include #include +#include #include "../AudacityApp.h" @@ -901,10 +902,12 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(3, wxEXPAND); S.SetStretchyCol(2); { + wxTextValidator vld(wxFILTER_NUMERIC); mGainT = S.Id(ID_GAIN_TEXT).AddTextBox(_("Noise re&duction (dB):"), wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); + mGainT->SetValidator(vld); mGainS = S.Id(ID_GAIN_SLIDER).AddSlider(wxT(""), 0, GAIN_MAX); mGainS->SetName(_("Noise reduction")); mGainS->SetRange(GAIN_MIN, GAIN_MAX); @@ -914,6 +917,7 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); + mSensitivityT->SetValidator(vld); mSensitivityS = S.Id(ID_SENSITIVITY_SLIDER).AddSlider(wxT(""), 0, SENSITIVITY_MAX); mSensitivityS->SetName(_("Sensitivity")); mSensitivityS->SetRange(SENSITIVITY_MIN, SENSITIVITY_MAX); @@ -923,6 +927,7 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); + mFreqT->SetValidator(vld); mFreqS = S.Id(ID_FREQ_SLIDER).AddSlider(wxT(""), 0, FREQ_MAX); mFreqS->SetName(_("Frequency smoothing")); mFreqS->SetRange(FREQ_MIN, FREQ_MAX); @@ -932,6 +937,7 @@ void NoiseRemovalDialog::PopulateOrExchange(ShuttleGui & S) wxT(""), 0); S.SetStyle(wxSL_HORIZONTAL); + mTimeT->SetValidator(vld); mTimeS = S.Id(ID_TIME_SLIDER).AddSlider(wxT(""), 0, TIME_MAX); mTimeS->SetName(_("Attack/decay time")); mTimeS->SetRange(TIME_MIN, TIME_MAX); diff --git a/src/effects/Phaser.cpp b/src/effects/Phaser.cpp index 2c36029b3..7b83efd4e 100644 --- a/src/effects/Phaser.cpp +++ b/src/effects/Phaser.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include @@ -213,6 +214,7 @@ PhaserDialog::PhaserDialog(EffectPhaser * effect, wxWindow * parent) void PhaserDialog::PopulateOrExchange(ShuttleGui & S) { + wxTextValidator vld(wxFILTER_NUMERIC); S.SetBorder(10); S.StartHorizontalLay(wxCENTER, false); { @@ -224,33 +226,38 @@ void PhaserDialog::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(3, wxEXPAND); { wxSlider *s; + wxTextCtrl * tempTC; S.SetStretchyCol(1); - S.Id(ID_PHASER_STAGESTEXT).AddTextBox(_("Stages:"), wxT(""), 12); + tempTC = S.Id(ID_PHASER_STAGESTEXT).AddTextBox(_("Stages:"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_PHASER_STAGESSLIDER).AddSlider(wxT(""), 2, STAGES_MAX, STAGES_MIN); s->SetName(_("Stages")); #if defined(__WXGTK__) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_PHASER_DRYWETTEXT).AddTextBox(_("Dry/Wet:"), wxT(""), 12); + tempTC = S.Id(ID_PHASER_DRYWETTEXT).AddTextBox(_("Dry/Wet:"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_PHASER_DRYWETSLIDER).AddSlider(wxT(""), 0, DRYWET_MAX, DRYWET_MIN); s->SetName(_("Dry Wet")); #if defined(__WXGTK__) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_PHASER_FREQTEXT).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12); + tempTC = S.Id(ID_PHASER_FREQTEXT).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_PHASER_FREQSLIDER).AddSlider(wxT(""), 100, FREQ_MAX, FREQ_MIN); s->SetName(_("LFO frequency in hertz")); #if defined(__WXGTK__) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_PHASER_PHASETEXT).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 12); + tempTC = S.Id(ID_PHASER_PHASETEXT).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_PHASER_PHASESLIDER).AddSlider(wxT(""), 0, PHASE_MAX, PHASE_MIN); s->SetName(_("LFO start phase in degrees")); s->SetLineSize(10); @@ -258,16 +265,18 @@ void PhaserDialog::PopulateOrExchange(ShuttleGui & S) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_PHASER_DEPTHTEXT).AddTextBox(_("Depth:"), wxT(""), 12); + tempTC = S.Id(ID_PHASER_DEPTHTEXT).AddTextBox(_("Depth:"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_PHASER_DEPTHSLIDER).AddSlider(wxT(""), 0, DEPTH_MAX, DEPTH_MIN); s->SetName(_("Depth in percent")); #if defined(__WXGTK__) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_PHASER_FEEDBACKTEXT).AddTextBox(_("Feedback (%):"), wxT(""), 12); + tempTC = S.Id(ID_PHASER_FEEDBACKTEXT).AddTextBox(_("Feedback (%):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_PHASER_FEEDBACKSLIDER).AddSlider(wxT(""), 0, FB_MAX, FB_MIN); s->SetName(_("Feedback in percent")); s->SetLineSize(10); diff --git a/src/effects/ToneGen.cpp b/src/effects/ToneGen.cpp index 8fa264eae..034b9a400 100644 --- a/src/effects/ToneGen.cpp +++ b/src/effects/ToneGen.cpp @@ -278,8 +278,8 @@ void ToneGenDialog::PopulateOrExchangeStandard( ShuttleGui & S ) // The added colon to improve visual consistency was placed outside // the translatable strings to avoid breaking translations close to 2.0. // TODO: Make colon part of the translatable string after 2.0. - S.TieTextBox(_("Frequency (Hz)") + wxString(wxT(":")), frequency[0], 5); - S.TieTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), amplitude[0], 5); + S.TieNumericTextBox(_("Frequency (Hz)") + wxString(wxT(":")), frequency[0], 5); + S.TieNumericTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), amplitude[0], 5); S.AddPrompt(_("Duration") + wxString(wxT(":"))); if (mToneDurationT == NULL) { @@ -319,10 +319,10 @@ void ToneGenDialog::PopulateOrExchangeExtended( ShuttleGui & S ) // The added colon to improve visual consistency was placed outside // the translatable strings to avoid breaking translations close to 2.0. // TODO: Make colon part of the translatable string after 2.0. - S.TieTextBox(_("Frequency (Hz)") + wxString(wxT(":")), frequency[0], 10)->SetName(_("Frequency Hertz Start")); - S.TieTextBox(wxT(""), frequency[1], 10)->SetName(_("Frequency Hertz End")); - S.TieTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), amplitude[0], 10)->SetName(_("Amplitude Start")); - S.TieTextBox(wxT(""), amplitude[1], 10)->SetName(_("Amplitude End")); + S.TieNumericTextBox(_("Frequency (Hz)") + wxString(wxT(":")), frequency[0], 10)->SetName(_("Frequency Hertz Start")); + S.TieNumericTextBox(wxT(""), frequency[1], 10)->SetName(_("Frequency Hertz End")); + S.TieNumericTextBox(_("Amplitude (0-1)") + wxString(wxT(":")), amplitude[0], 10)->SetName(_("Amplitude Start")); + S.TieNumericTextBox(wxT(""), amplitude[1], 10)->SetName(_("Amplitude End")); } S.EndMultiColumn(); S.StartMultiColumn(2, wxCENTER); diff --git a/src/effects/TruncSilence.cpp b/src/effects/TruncSilence.cpp index caea3395c..631506776 100644 --- a/src/effects/TruncSilence.cpp +++ b/src/effects/TruncSilence.cpp @@ -878,15 +878,15 @@ void TruncSilenceDialog::PopulateOrExchange(ShuttleGui & S) { wxArrayString choices(Enums::NumDbChoices, Enums::GetDbChoices()); - S.Id( ID_SHORTEST_SILENCE_TEXT ).TieTextBox(_("Min silence duration:"), + S.Id( ID_SHORTEST_SILENCE_TEXT ).TieNumericTextBox(_("Min silence duration:"), mEffect->mTruncInitialAllowedSilentMs, 10); S.AddUnits( _("milliseconds") ); - S.Id( ID_LONGEST_SILENCE_TEXT ).TieTextBox(_("Max silence duration:"), + S.Id( ID_LONGEST_SILENCE_TEXT ).TieNumericTextBox(_("Max silence duration:"), mEffect->mTruncLongestAllowedSilentMs, 10); S.AddUnits( _("milliseconds") ); - S.Id( ID_COMPRESS_FACTOR ).TieTextBox(_("Silence compression:"), + S.Id( ID_COMPRESS_FACTOR ).TieNumericTextBox(_("Silence compression:"), mEffect->mSilenceCompressRatio, 10); S.AddUnits( _(":1") ); diff --git a/src/effects/Wahwah.cpp b/src/effects/Wahwah.cpp index 5dc558068..d5e274833 100644 --- a/src/effects/Wahwah.cpp +++ b/src/effects/Wahwah.cpp @@ -40,6 +40,7 @@ #include #include #include +#include // // EffectWahwah @@ -208,6 +209,7 @@ WahwahDialog::WahwahDialog(EffectWahwah * effect, wxWindow * parent) void WahwahDialog::PopulateOrExchange(ShuttleGui & S) { + wxTextValidator vld(wxFILTER_NUMERIC); S.SetBorder(10); S.StartHorizontalLay(wxCENTER, false); { @@ -219,16 +221,19 @@ void WahwahDialog::PopulateOrExchange(ShuttleGui & S) S.StartMultiColumn(3, wxCENTER); { wxSlider *s; - S.Id(ID_FREQTEXT).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12); + wxTextCtrl * tempTC; + tempTC = S.Id(ID_FREQTEXT).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_FREQSLIDER).AddSlider(wxT(""), 100, FREQ_MAX, FREQ_MIN); s->SetName(_("LFO frequency in hertz")); #if defined(__WXGTK__) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_PHASETEXT).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 12); + tempTC = S.Id(ID_PHASETEXT).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_PHASESLIDER).AddSlider(wxT(""), 0, PHASE_MAX, PHASE_MIN); s->SetName(_("LFO start phase in degrees")); s->SetLineSize(10); @@ -236,24 +241,27 @@ void WahwahDialog::PopulateOrExchange(ShuttleGui & S) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_DEPTHTEXT).AddTextBox(_("Depth (%):"), wxT(""), 12); + tempTC = S.Id(ID_DEPTHTEXT).AddTextBox(_("Depth (%):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_DEPTHSLIDER).AddSlider(wxT(""), 0, DEPTH_MAX, DEPTH_MIN); s->SetName(_("Depth in percent")); #if defined(__WXGTK__) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_RESONANCETEXT).AddTextBox(_("Resonance:"), wxT(""), 12); + tempTC = S.Id(ID_RESONANCETEXT).AddTextBox(_("Resonance:"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s = S.Id(ID_RESONANCESLIDER).AddSlider(wxT(""), 0, RES_MAX, RES_MIN); s->SetName(_("Resonance")); #if defined(__WXGTK__) s->SetMinSize(wxSize(100, -1)); #endif - S.Id(ID_FREQOFFTEXT).AddTextBox(_("Wah Frequency Offset (%):"), wxT(""), 12); + tempTC = S.Id(ID_FREQOFFTEXT).AddTextBox(_("Wah Frequency Offset (%):"), wxT(""), 12); S.SetStyle(wxSL_HORIZONTAL); + tempTC->SetValidator(vld); s =S.Id(ID_FREQOFFSLIDER).AddSlider(wxT(""), 0, FREQOFF_MAX, FREQOFF_MIN); s->SetName(_("Wah frequency offset in percent")); #if defined(__WXGTK__) diff --git a/src/effects/nyquist/Nyquist.cpp b/src/effects/nyquist/Nyquist.cpp index 5a128d4fd..6c8dec17d 100644 --- a/src/effects/nyquist/Nyquist.cpp +++ b/src/effects/nyquist/Nyquist.cpp @@ -1128,6 +1128,8 @@ NyquistDialog::NyquistDialog(wxWindow * parent, wxWindowID id, item = new wxTextCtrl(this, ID_NYQ_TEXT+i, wxT(""), wxDefaultPosition, wxSize(60, -1)); item->SetName(ctrl->name); + wxTextValidator vld(wxFILTER_NUMERIC); + item->SetValidator(vld); grid->Add(item, 0, wxALIGN_CENTRE | wxALIGN_CENTER_VERTICAL | wxALL, 5); diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index 0689181a3..36b7e594b 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -108,10 +108,10 @@ void DirectoriesPrefs::PopulateOrExchange(ShuttleGui & S) S.StartTwoColumn(); { - S.TieTextBox(_("Mi&nimum Free Memory (MB):"), - wxT("/Directories/CacheLowMem"), - 16, - 9); + S.TieNumericTextBox(_("Mi&nimum Free Memory (MB):"), + wxT("/Directories/CacheLowMem"), + 16, + 9); } S.EndTwoColumn(); diff --git a/src/prefs/MidiIOPrefs.cpp b/src/prefs/MidiIOPrefs.cpp index 42d19e0f6..5e62f865e 100644 --- a/src/prefs/MidiIOPrefs.cpp +++ b/src/prefs/MidiIOPrefs.cpp @@ -142,9 +142,9 @@ void MidiIOPrefs::PopulateOrExchange( ShuttleGui & S ) { &empty); int latency = gPrefs->Read(wxT("/MidiIO/OutputLatency"), DEFAULT_SYNTH_LATENCY); - mLatency = S.TieTextBox(_("MIDI Synthesizer Latency (ms):"), - wxT("/MidiIO/SynthLatency"), - latency, 3); + mLatency = S.TieNumericTextBox(_("MIDI Synthesizer Latency (ms):"), + wxT("/MidiIO/SynthLatency"), + latency, 3); } S.EndMultiColumn(); } diff --git a/src/prefs/PlaybackPrefs.cpp b/src/prefs/PlaybackPrefs.cpp index 2ef163d4a..4f0a01000 100644 --- a/src/prefs/PlaybackPrefs.cpp +++ b/src/prefs/PlaybackPrefs.cpp @@ -58,10 +58,10 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartThreeColumn(); { - w = S.TieTextBox(_("&Length of preview:"), - wxT("/AudioIO/EffectsPreviewLen"), - 3.0, - 9); + w = S.TieNumericTextBox(_("&Length of preview:"), + wxT("/AudioIO/EffectsPreviewLen"), + 3.0, + 9); S.AddUnits(_("seconds")); w->SetName(w->GetName() + wxT(" ") + _("seconds")); } @@ -73,17 +73,17 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartThreeColumn(); { - w = S.TieTextBox(_("Preview &before cut region:"), - wxT("/AudioIO/CutPreviewBeforeLen"), - 1.0, - 9); + w = S.TieNumericTextBox(_("Preview &before cut region:"), + wxT("/AudioIO/CutPreviewBeforeLen"), + 1.0, + 9); S.AddUnits(_("seconds")); w->SetName(w->GetName() + wxT(" ") + _("seconds")); - w = S.TieTextBox(_("Preview &after cut region:"), - wxT("/AudioIO/CutPreviewAfterLen"), - 1.0, - 9); + w = S.TieNumericTextBox(_("Preview &after cut region:"), + wxT("/AudioIO/CutPreviewAfterLen"), + 1.0, + 9); S.AddUnits(_("seconds")); w->SetName(w->GetName() + wxT(" ") + _("seconds")); } @@ -95,17 +95,17 @@ void PlaybackPrefs::PopulateOrExchange(ShuttleGui & S) { S.StartThreeColumn(); { - w = S.TieTextBox(_("&Short period:"), - wxT("/AudioIO/SeekShortPeriod"), - 1.0, - 9); + w = S.TieNumericTextBox(_("&Short period:"), + wxT("/AudioIO/SeekShortPeriod"), + 1.0, + 9); S.AddUnits(_("seconds")); w->SetName(w->GetName() + wxT(" ") + _("seconds")); - w = S.TieTextBox(_("Lo&ng period:"), - wxT("/AudioIO/SeekLongPeriod"), - 15.0, - 9); + w = S.TieNumericTextBox(_("Lo&ng period:"), + wxT("/AudioIO/SeekLongPeriod"), + 15.0, + 9); S.AddUnits(_("seconds")); w->SetName(w->GetName() + wxT(" ") + _("seconds")); } diff --git a/src/prefs/QualityPrefs.cpp b/src/prefs/QualityPrefs.cpp index 6d324b5cf..0820582b8 100644 --- a/src/prefs/QualityPrefs.cpp +++ b/src/prefs/QualityPrefs.cpp @@ -145,9 +145,9 @@ void QualityPrefs::PopulateOrExchange(ShuttleGui & S) S.SetSizeHints(mSampleRateNames); // Now do the edit box... - mOtherSampleRate = S.TieTextBox(wxT(""), - mOtherSampleRateValue, - 15); + mOtherSampleRate = S.TieNumericTextBox(wxT(""), + mOtherSampleRateValue, + 15); } S.EndHorizontalLay(); diff --git a/src/prefs/RecordingPrefs.cpp b/src/prefs/RecordingPrefs.cpp index 65ec927ed..13d7d744f 100644 --- a/src/prefs/RecordingPrefs.cpp +++ b/src/prefs/RecordingPrefs.cpp @@ -85,17 +85,17 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) { // only show the following controls if we use Portaudio v19, because // for Portaudio v18 we always use default buffer sizes - w = S.TieTextBox(_("Audio to &buffer:"), - wxT("/AudioIO/LatencyDuration"), - DEFAULT_LATENCY_DURATION, - 9); + w = S.TieNumericTextBox(_("Audio to &buffer:"), + wxT("/AudioIO/LatencyDuration"), + DEFAULT_LATENCY_DURATION, + 9); S.AddUnits(_("milliseconds (higher = more latency)")); w->SetName(w->GetName() + wxT(" ") + _("milliseconds (higher = more latency)")); - w = S.TieTextBox(_("L&atency correction:"), - wxT("/AudioIO/LatencyCorrection"), - DEFAULT_LATENCY_CORRECTION, - 9); + w = S.TieNumericTextBox(_("L&atency correction:"), + wxT("/AudioIO/LatencyCorrection"), + DEFAULT_LATENCY_CORRECTION, + 9); S.AddUnits(_("milliseconds (negative = backwards)")); w->SetName(w->GetName() + wxT(" ") + _("milliseconds (negative = backwards)")); } @@ -151,16 +151,16 @@ void RecordingPrefs::PopulateOrExchange(ShuttleGui & S) S.StartThreeColumn(); { - S.TieTextBox(_("Analysis Time:"), - wxT("/AudioIO/AnalysisTime"), - AILA_DEF_ANALYSIS_TIME, - 9); + S.TieNumericTextBox(_("Analysis Time:"), + wxT("/AudioIO/AnalysisTime"), + AILA_DEF_ANALYSIS_TIME, + 9); S.AddUnits(_("milliseconds (time of one analysis)")); - S.TieTextBox(_("Number of consecutive analysis:"), - wxT("/AudioIO/NumberAnalysis"), - AILA_DEF_NUMBER_ANALYSIS, - 2); + S.TieNumericTextBox(_("Number of consecutive analysis:"), + wxT("/AudioIO/NumberAnalysis"), + AILA_DEF_NUMBER_ANALYSIS, + 2); S.AddUnits(_("0 means endless")); } S.EndThreeColumn(); diff --git a/src/prefs/SpectrumPrefs.cpp b/src/prefs/SpectrumPrefs.cpp index 0e4361476..80e4f9fee 100644 --- a/src/prefs/SpectrumPrefs.cpp +++ b/src/prefs/SpectrumPrefs.cpp @@ -127,34 +127,34 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) S.StartTwoColumn(); { mMinFreq = - S.TieTextBox(_("Mi&nimum Frequency (Hz):"), - wxT("/Spectrum/MinFreq"), - 0, - 12); + S.TieNumericTextBox(_("Mi&nimum Frequency (Hz):"), + wxT("/Spectrum/MinFreq"), + 0, + 12); mMaxFreq = - S.TieTextBox(_("Ma&ximum Frequency (Hz):"), - wxT("/Spectrum/MaxFreq"), - 8000, - 12); + S.TieNumericTextBox(_("Ma&ximum Frequency (Hz):"), + wxT("/Spectrum/MaxFreq"), + 8000, + 12); mGain = - S.TieTextBox(_("&Gain (dB):"), - wxT("/Spectrum/Gain"), - 20, - 8); + S.TieNumericTextBox(_("&Gain (dB):"), + wxT("/Spectrum/Gain"), + 20, + 8); mRange = - S.TieTextBox(_("&Range (dB):"), - wxT("/Spectrum/Range"), - 80, - 8); + S.TieNumericTextBox(_("&Range (dB):"), + wxT("/Spectrum/Range"), + 80, + 8); mFrequencyGain = - S.TieTextBox(_("Frequency g&ain (dB/dec):"), - wxT("/Spectrum/FrequencyGain"), - 0, - 4); + S.TieNumericTextBox(_("Frequency g&ain (dB/dec):"), + wxT("/Spectrum/FrequencyGain"), + 0, + 4); } S.EndTwoColumn(); @@ -176,16 +176,16 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S) S.StartTwoColumn(); { mFindNotesMinA = - S.TieTextBox(_("Minimum Amplitude (dB):"), - wxT("/Spectrum/FindNotesMinA"), - -30L, - 8); + S.TieNumericTextBox(_("Minimum Amplitude (dB):"), + wxT("/Spectrum/FindNotesMinA"), + -30L, + 8); mFindNotesN = - S.TieTextBox(_("Max. Number of Notes (1..128):"), - wxT("/Spectrum/FindNotesN"), - 5L, - 8); + S.TieNumericTextBox(_("Max. Number of Notes (1..128):"), + wxT("/Spectrum/FindNotesN"), + 5L, + 8); } S.EndTwoColumn();