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
|
// remember the old bitmap (if any) to compare with the new one later
|
||||||
wxBitmap bmpPrev;
|
wxBitmap bmpPrev;
|
||||||
|
|
||||||
@@ -580,8 +576,6 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
|||||||
|
|
||||||
m_page->Hide();
|
m_page->Hide();
|
||||||
|
|
||||||
btnLabelWasNext = HasNextPage(m_page);
|
|
||||||
|
|
||||||
bmpPrev = m_page->GetBitmap();
|
bmpPrev = m_page->GetBitmap();
|
||||||
|
|
||||||
if ( !m_usingSizer )
|
if ( !m_usingSizer )
|
||||||
@@ -651,15 +645,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
|
|||||||
// and update the buttons state
|
// and update the buttons state
|
||||||
m_btnPrev->Enable(HasPrevPage(m_page));
|
m_btnPrev->Enable(HasPrevPage(m_page));
|
||||||
|
|
||||||
bool hasNext = HasNextPage(m_page);
|
const bool hasNext = HasNextPage(m_page);
|
||||||
if ( btnLabelWasNext != hasNext )
|
const wxString label = hasNext ? _("&Next >") : _("&Finish");
|
||||||
{
|
if ( label != m_btnNext->GetLabel() )
|
||||||
if ( hasNext )
|
m_btnNext->SetLabel(label);
|
||||||
m_btnNext->SetLabel(_("&Next >"));
|
|
||||||
else
|
|
||||||
m_btnNext->SetLabel(_("&Finish"));
|
|
||||||
}
|
|
||||||
// nothing to do: the label was already correct
|
|
||||||
|
|
||||||
m_btnNext->SetDefault();
|
m_btnNext->SetDefault();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user