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 ? ).
This commit is contained in:
Silent 2018-10-31 09:57:57 +01:00 committed by lightningterror
parent 8f52d82e58
commit c5edd38681
2 changed files with 9 additions and 2 deletions

View File

@ -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;

View File

@ -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);