mirror of
https://github.com/cookiengineer/audacity
synced 2025-10-27 07:43:50 +01:00
Disallow non-numeric chars in numeric input boxes.
Patch by Ed using examples by Martyn & James.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user