1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-12 14:47:43 +02:00

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

View File

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

View File

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

View File

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