initialize the button label correctly if the same wizard is ran again
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@55039 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -558,10 +558,6 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
||||
}
|
||||
|
||||
|
||||
// we'll use this to decide whether we have to change the label of this
|
||||
// button or not (initially the label is "Next")
|
||||
bool btnLabelWasNext = true;
|
||||
|
||||
// remember the old bitmap (if any) to compare with the new one later
|
||||
wxBitmap bmpPrev;
|
||||
|
||||
@@ -580,8 +576,6 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
||||
|
||||
m_page->Hide();
|
||||
|
||||
btnLabelWasNext = HasNextPage(m_page);
|
||||
|
||||
bmpPrev = m_page->GetBitmap();
|
||||
|
||||
if ( !m_usingSizer )
|
||||
@@ -651,15 +645,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
||||
// and update the buttons state
|
||||
m_btnPrev->Enable(HasPrevPage(m_page));
|
||||
|
||||
bool hasNext = HasNextPage(m_page);
|
||||
if ( btnLabelWasNext != hasNext )
|
||||
{
|
||||
if ( hasNext )
|
||||
m_btnNext->SetLabel(_("&Next >"));
|
||||
else
|
||||
m_btnNext->SetLabel(_("&Finish"));
|
||||
}
|
||||
// nothing to do: the label was already correct
|
||||
const bool hasNext = HasNextPage(m_page);
|
||||
const wxString label = hasNext ? _("&Next >") : _("&Finish");
|
||||
if ( label != m_btnNext->GetLabel() )
|
||||
m_btnNext->SetLabel(label);
|
||||
|
||||
m_btnNext->SetDefault();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user