From c5edd38681573db956f1aae919ec23713a1005f0 Mon Sep 17 00:00:00 2001 From: Silent Date: Wed, 31 Oct 2018 09:57:57 +0100 Subject: [PATCH] 3rdparty:wxwidgets: Cache strings for "Next>" or "Finish" buttons in wxWizard so locale stays consistent throughougt wizard's lifetime (#2664) When updating from a higher wx release this change needs to be rechecked. The change was also included on the current 3.1.2 branch https://github.com/wxWidgets/wxWidgets/pull/1000 so this is essentially a backport (to 3.0.2 I believe pcsx2 uses ? ). --- 3rdparty/wxwidgets3.0/include/wx/generic/wizard.h | 4 ++++ 3rdparty/wxwidgets3.0/src/generic/wizard.cpp | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/3rdparty/wxwidgets3.0/include/wx/generic/wizard.h b/3rdparty/wxwidgets3.0/include/wx/generic/wizard.h index 2161870077..048a1140a9 100644 --- a/3rdparty/wxwidgets3.0/include/wx/generic/wizard.h +++ b/3rdparty/wxwidgets3.0/include/wx/generic/wizard.h @@ -131,6 +131,10 @@ protected: *m_btnNext; // the "Next>" or "Finish" button wxStaticBitmap *m_statbmp; // the control for the bitmap + // cached labels so their locale stays consistent + wxString m_nextLabel, + m_finishLabel; + // Border around page area sizer requested using SetBorder() int m_border; diff --git a/3rdparty/wxwidgets3.0/src/generic/wizard.cpp b/3rdparty/wxwidgets3.0/src/generic/wizard.cpp index 25d1a669d0..ca4f88f3d3 100644 --- a/3rdparty/wxwidgets3.0/src/generic/wizard.cpp +++ b/3rdparty/wxwidgets3.0/src/generic/wizard.cpp @@ -428,7 +428,10 @@ void wxWizard::AddButtonRow(wxBoxSizer *mainColumn) btnHelp=new wxButton(this, wxID_HELP, wxEmptyString, wxDefaultPosition, wxDefaultSize, buttonStyle); #endif - m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >")); + m_nextLabel = _("&Next >"); + m_finishLabel = _("&Finish"); + + m_btnNext = new wxButton(this, wxID_FORWARD, m_nextLabel); wxButton *btnCancel=new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, buttonStyle); #ifndef __WXMAC__ if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) @@ -623,7 +626,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) m_btnPrev->Enable(HasPrevPage(m_page)); const bool hasNext = HasNextPage(m_page); - const wxString label = hasNext ? _("&Next >") : _("&Finish"); + const wxString& label = hasNext ? m_nextLabel : m_finishLabel; if ( label != m_btnNext->GetLabel() ) m_btnNext->SetLabel(label);