SliderAx uses TranslatableString

This commit is contained in:
Paul Licameli 2019-12-27 22:30:19 -05:00
parent 65a13fd3d6
commit 956e0813c4
4 changed files with 10 additions and 9 deletions

View File

@ -806,7 +806,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
.Style(wxSL_VERTICAL | wxSL_INVERSE)
.AddSlider( {}, 30, 60, 0);
#if wxUSE_ACCESSIBILITY
mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, _("%d dB")));
mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, XO("%d dB")));
#endif
mdBMinSlider = S.Id(ID_dBMin)
@ -815,7 +815,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
.AddSlider( {}, -30, -10, -120);
S.AddVariableText(XO("- dB"), false, wxCENTER);
#if wxUSE_ACCESSIBILITY
mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, _("%d dB")));
mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, XO("%d dB")));
#endif
}
S.EndVerticalLay();
@ -876,7 +876,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
wxDefaultPosition, wxDefaultSize, wxSL_VERTICAL | wxSL_INVERSE);
#if wxUSE_ACCESSIBILITY
mSliders[i]->SetAccessible(safenew SliderAx(mSliders[i], _("%d dB")));
mSliders[i]->SetAccessible(safenew SliderAx(mSliders[i], XO("%d dB")));
#endif
mSlidersOld[i] = 0;

View File

@ -413,14 +413,14 @@ void EffectScienFilter::PopulateOrExchange(ShuttleGui & S)
.Style(wxSL_VERTICAL | wxSL_INVERSE)
.AddSlider( {}, 10, 20, 0);
#if wxUSE_ACCESSIBILITY
mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, _("%d dB")));
mdBMaxSlider->SetAccessible(safenew SliderAx(mdBMaxSlider, XO("%d dB")));
#endif
mdBMinSlider = S.Id(ID_dBMin)
.Name(XO("Min dB"))
.Style(wxSL_VERTICAL | wxSL_INVERSE)
.AddSlider( {}, -10, -10, -120);
#if wxUSE_ACCESSIBILITY
mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, _("%d dB")));
mdBMinSlider->SetAccessible(safenew SliderAx(mdBMinSlider, XO("%d dB")));
#endif
S.AddVariableText(XO("- dB"), false, wxCENTER);

View File

@ -41,7 +41,7 @@ wxAccStatus WindowAccessible::GetName(int childId, wxString* name)
#include <wx/slider.h>
SliderAx::SliderAx(wxWindow * window, const wxString &fmt) :
SliderAx::SliderAx(wxWindow * window, const TranslatableString &fmt) :
WindowAccessible( window )
{
mParent = window;
@ -224,7 +224,7 @@ wxAccStatus SliderAx::GetValue(int childId, wxString* strValue)
if( childId == 0 )
{
strValue->Printf( mFmt, s->GetValue() );
strValue->Printf( mFmt.Translation(), s->GetValue() );
return wxACC_OK;
}

View File

@ -16,6 +16,7 @@
#if wxUSE_ACCESSIBILITY
#include <wx/access.h> // to inherit
#include <../Internat.h> // for TranslatableString
class WindowAccessible: public wxAccessible
{
@ -30,7 +31,7 @@ public:
class SliderAx final : public WindowAccessible
{
public:
SliderAx(wxWindow * window, const wxString &fmt);
SliderAx(wxWindow * window, const TranslatableString &fmt);
virtual ~ SliderAx();
@ -94,7 +95,7 @@ public:
private:
wxWindow *mParent;
wxString mFmt;
TranslatableString mFmt;
};
#endif // wxUSE_ACCESSIBILITY