1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-09 13:12:17 +01:00

All things with an UpdatePrefs() message listen for an event...

... Still to do, improve the handling of updates of only subsets of the prefs
This commit is contained in:
Paul Licameli
2018-02-17 17:42:14 -05:00
parent cc635e0498
commit 62899a32f4
37 changed files with 198 additions and 136 deletions

View File

@@ -107,6 +107,7 @@ SpectralSelectionBar::~SpectralSelectionBar()
void SpectralSelectionBar::Create(wxWindow * parent)
{
ToolBar::Create(parent);
UpdatePrefs();
mHeight = wxWindowBase::GetSizer()->GetSize().GetHeight();
}
@@ -370,12 +371,14 @@ void SpectralSelectionBar::OnUpdate(wxCommandEvent &evt)
if (type == EVT_FREQUENCYTEXTCTRL_UPDATED) {
NumericTextCtrl *frequencyCtrl = (mbCenterAndWidth ? mCenterCtrl : mLowCtrl);
auto frequencyFormatName = frequencyCtrl->GetBuiltinName(index);
mListener->SSBL_SetFrequencySelectionFormatName(frequencyFormatName);
if (mListener)
mListener->SSBL_SetFrequencySelectionFormatName(frequencyFormatName);
}
else if (mbCenterAndWidth &&
type == EVT_BANDWIDTHTEXTCTRL_UPDATED) {
auto bandwidthFormatName = mWidthCtrl->GetBuiltinName(index);
mListener->SSBL_SetBandwidthSelectionFormatName(bandwidthFormatName);
if (mListener)
mListener->SSBL_SetBandwidthSelectionFormatName(bandwidthFormatName);
}
// ToolBar::ReCreateButtons() will get rid of our sizers and controls