1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-16 16:10:06 +02:00

wxWindow takes ownership of its wxAccessible, so we can use safenew.

This commit is contained in:
Paul Licameli 2016-05-06 21:03:37 -04:00
parent e59617f176
commit db137ddf76
11 changed files with 15 additions and 18 deletions

View File

@ -566,8 +566,7 @@ void PluginRegistrationDialog::PopulateOrExchange(ShuttleGui &S)
NULL,
this);
#if wxUSE_ACCESSIBILITY
mAx = new CheckListAx(mEffects);
mEffects->SetAccessible(mAx);
mEffects->SetAccessible(mAx = safenew CheckListAx(mEffects));
#endif
mEffects->InsertColumn(COL_Name, _("Name"));
mEffects->InsertColumn(COL_State, _("State"));

View File

@ -811,7 +811,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
m_pDatePickerCtrl_Start->SetName(_("Start Date"));
m_pDatePickerCtrl_Start->SetRange(wxDateTime::Today(), wxInvalidDateTime); // No backdating.
#if wxUSE_ACCESSIBILITY
m_pDatePickerCtrl_Start->SetAccessible( new DatePickerCtrlAx(m_pDatePickerCtrl_Start));
m_pDatePickerCtrl_Start->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_Start));
#endif
S.AddWindow(m_pDatePickerCtrl_Start);
@ -836,7 +836,7 @@ void TimerRecordDialog::PopulateOrExchange(ShuttleGui& S)
m_pDatePickerCtrl_End->SetRange(m_DateTime_Start, wxInvalidDateTime); // No backdating.
m_pDatePickerCtrl_End->SetName(_("End Date"));
#if wxUSE_ACCESSIBILITY
m_pDatePickerCtrl_End->SetAccessible( new DatePickerCtrlAx(m_pDatePickerCtrl_End));
m_pDatePickerCtrl_End->SetAccessible( safenew DatePickerCtrlAx(m_pDatePickerCtrl_End));
#endif
S.AddWindow(m_pDatePickerCtrl_End);

View File

@ -679,7 +679,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
mdBMaxSlider = S.Id(ID_dBMax).AddSlider(wxT(""), 30, 60, 0);
#if wxUSE_ACCESSIBILITY
mdBMaxSlider->SetName(_("Max dB"));
mdBMaxSlider->SetAccessible(new SliderAx(mdBMaxSlider, wxString(wxT("%d ")) + _("dB")));
mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, wxString(wxT("%d ")) + _("dB")));
#endif
S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE);
@ -687,7 +687,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
S.AddVariableText(_("- dB"), false, wxCENTER);
#if wxUSE_ACCESSIBILITY
mdBMinSlider->SetName(_("Min dB"));
mdBMinSlider->SetAccessible(new SliderAx(mdBMinSlider, wxString(wxT("%d ")) + _("dB")));
mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, wxString(wxT("%d ")) + _("dB")));
#endif
}
S.EndVerticalLay();
@ -748,7 +748,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
else
name.Printf(wxString(wxT("%g ")) + _("kHz"), kThirdOct[i]/1000.);
mSliders[i]->SetName(name);
mSliders[i]->SetAccessible(new SliderAx(mSliders[i], wxString(wxT("%d ")) + _("dB")));
mSliders[i]->SetAccessible(safenew SliderAx(mSliders[i], wxString(wxT("%d ")) + _("dB")));
#endif
mSlidersOld[i] = 0;
mEQVals[i] = 0.;

View File

@ -412,7 +412,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
mdBMaxSlider = S.Id(ID_dBMax).AddSlider(wxT(""), 10, 20, 0);
#if wxUSE_ACCESSIBILITY
mdBMaxSlider->SetName(_("Max dB"));
mdBMaxSlider->SetAccessible(new SliderAx(mdBMaxSlider, wxString(wxT("%d ")) + _("dB")));
mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, wxString(wxT("%d ")) + _("dB")));
#endif
S.SetStyle(wxSL_VERTICAL | wxSL_INVERSE);
@ -420,7 +420,7 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
S.AddVariableText(_("- dB"), false, wxCENTER);
#if wxUSE_ACCESSIBILITY
mdBMinSlider->SetName(_("Min dB"));
mdBMinSlider->SetAccessible(new SliderAx(mdBMinSlider, wxString(wxT("%d ")) + _("dB")));
mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, wxString(wxT("%d ")) + _("dB")));
#endif
}
S.EndVerticalLay();

View File

@ -233,7 +233,7 @@ void AButton::Init(wxWindow * parent,
#if wxUSE_ACCESSIBILITY
SetName( wxT("") );
SetAccessible(new AButtonAx(this));
SetAccessible(safenew AButtonAx(this));
#endif
}

View File

@ -1611,7 +1611,7 @@ ASlider::ASlider( wxWindow * parent,
mTimer.SetOwner(this);
#if wxUSE_ACCESSIBILITY
SetAccessible( new ASliderAx( this ) );
SetAccessible( safenew ASliderAx( this ) );
#endif
}

View File

@ -389,8 +389,7 @@ Grid::Grid(wxWindow *parent,
: wxGrid(parent, id, pos, size, style | wxWANTS_CHARS, name)
{
#if wxUSE_ACCESSIBILITY
mAx = new GridAx(this);
GetGridWindow()->SetAccessible(mAx);
GetGridWindow()->SetAccessible(mAx = safenew GridAx(this));
#endif
RegisterDataType(GRID_VALUE_TIME,

View File

@ -42,7 +42,7 @@ HtmlWindow::HtmlWindow(wxWindow *parent,
: wxHtmlWindow(parent, id, pos, size, style, name)
{
#if wxUSE_ACCESSIBILITY
SetAccessible( new HtmlWindowAx( this ) );
SetAccessible( safenew HtmlWindowAx( this ) );
#endif
}

View File

@ -59,8 +59,7 @@ KeyView::KeyView(wxWindow *parent,
{
#if wxUSE_ACCESSIBILITY
// Create and set accessibility object
mAx = new KeyViewAx(this);
SetAccessible(mAx);
SetAccessible(mAx = safenew KeyViewAx(this));
#endif
// The default view

View File

@ -251,7 +251,7 @@ Meter::Meter(AudacityProject *project,
mIsFocused = false;
#if wxUSE_ACCESSIBILITY
SetAccessible(new MeterAx(this));
SetAccessible(safenew MeterAx(this));
#endif
// Do this BEFORE UpdatePrefs()!

View File

@ -1205,7 +1205,7 @@ NumericTextCtrl::NumericTextCtrl(NumericConverter::Type type,
#if wxUSE_ACCESSIBILITY
SetLabel(wxT(""));
SetName(wxT(""));
SetAccessible(new NumericTextCtrlAx(this));
SetAccessible(safenew NumericTextCtrlAx(this));
#endif
}