Permalink
Browse files

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 wxWidgets/wxWidgets#1000 so this is essentially a backport (to 3.0.2 I believe pcsx2 uses ? ).
  • Loading branch information...
CookiePLMonster authored and lightningterror committed Oct 31, 2018
1 parent 8f52d82 commit c5edd38681573db956f1aae919ec23713a1005f0
@@ -131,6 +131,10 @@ class WXDLLIMPEXP_ADV wxWizard : public wxWizardBase
*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;
@@ -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);

0 comments on commit c5edd38

Please sign in to comment.