mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-03 23:30:12 +01:00
Delete key in center/width spectral selection toolbar works
This commit is contained in:
@@ -146,12 +146,14 @@ void SpectralSelectionBar::Populate()
|
|||||||
|
|
||||||
mCenterCtrl = new NumericTextCtrl(
|
mCenterCtrl = new NumericTextCtrl(
|
||||||
NumericConverter::FREQUENCY, this, OnCenterID, frequencyFormatName, 0.0);
|
NumericConverter::FREQUENCY, this, OnCenterID, frequencyFormatName, 0.0);
|
||||||
|
mCenterCtrl->SetInvalidValue(SelectedRegion::UndefinedFrequency);
|
||||||
mCenterCtrl->SetName(_("Center Frequency:"));
|
mCenterCtrl->SetName(_("Center Frequency:"));
|
||||||
mCenterCtrl->EnableMenu();
|
mCenterCtrl->EnableMenu();
|
||||||
subSizer->Add(mCenterCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
subSizer->Add(mCenterCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 5);
|
||||||
|
|
||||||
mWidthCtrl = new NumericTextCtrl(
|
mWidthCtrl = new NumericTextCtrl(
|
||||||
NumericConverter::BANDWIDTH, this, OnWidthID, bandwidthFormatName, 0.0);
|
NumericConverter::BANDWIDTH, this, OnWidthID, bandwidthFormatName, 0.0);
|
||||||
|
mWidthCtrl->SetInvalidValue(-1.0);
|
||||||
mWidthCtrl->SetName(wxString(_("Bandwidth:")));
|
mWidthCtrl->SetName(wxString(_("Bandwidth:")));
|
||||||
mWidthCtrl->EnableMenu();
|
mWidthCtrl->EnableMenu();
|
||||||
subSizer->Add(mWidthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
subSizer->Add(mWidthCtrl, 0, wxALIGN_CENTER_VERTICAL | wxRIGHT, 0);
|
||||||
@@ -228,7 +230,11 @@ void SpectralSelectionBar::ModifySpectralSelection(bool done)
|
|||||||
if (mbCenterAndWidth) {
|
if (mbCenterAndWidth) {
|
||||||
mCenter = mCenterCtrl->GetValue();
|
mCenter = mCenterCtrl->GetValue();
|
||||||
mWidth = mWidthCtrl->GetValue();
|
mWidth = mWidthCtrl->GetValue();
|
||||||
if (mCenter < 0 && mWidth < 0)
|
if ((mCenter < 0 || mWidth < 0) &&
|
||||||
|
(mLow >= 0 || mHigh >= 0))
|
||||||
|
// Transition from defined spectral selection to undefined
|
||||||
|
bottom = top = SelectedRegion::UndefinedFrequency;
|
||||||
|
else if (mCenter < 0 && mWidth < 0)
|
||||||
bottom = top = SelectedRegion::UndefinedFrequency;
|
bottom = top = SelectedRegion::UndefinedFrequency;
|
||||||
else {
|
else {
|
||||||
if (mCenter < 0) {
|
if (mCenter < 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user