Always disable "Back" wxWizard button for the starting page.

Do it even if the start page has a previous page (e.g. because the wizard has
been started in the middle for some reason).

Closes #16535.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2014-09-05 12:46:38 +00:00
parent 6fa258860e
commit 46a414097b
3 changed files with 6 additions and 1 deletions

View File

@ -77,6 +77,7 @@ All (GUI):
- Use native renderer for drawing check boxes in wxPropertyGrid (Eran Ifrah).
- Fix drawing custom colours of wxEnumProperty items in wxPG (Artur Wieczorek).
- Add wxBitmap ctor from wxCursor.
- Always disable wxWizard "Back" button on the starting page (pmgrace30).
wxGTK:

View File

@ -124,6 +124,7 @@ protected:
// wizard state
wxWizardPage *m_page; // the current page or NULL
wxWizardPage *m_firstpage; // the page RunWizard started on or NULL
wxBitmap m_bitmap; // the default bitmap to show
// wizard controls

View File

@ -271,6 +271,7 @@ void wxWizard::Init()
{
m_posWizard = wxDefaultPosition;
m_page = NULL;
m_firstpage = NULL;
m_btnPrev = m_btnNext = NULL;
m_statbmp = NULL;
m_sizerBmpAndPage = NULL;
@ -620,7 +621,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
// and update the buttons state
m_btnPrev->Enable(HasPrevPage(m_page));
m_btnPrev->Enable(m_page != m_firstpage);
const bool hasNext = HasNextPage(m_page);
const wxString label = hasNext ? _("&Next >") : _("&Finish");
@ -687,6 +688,8 @@ bool wxWizard::RunWizard(wxWizardPage *firstPage)
{
wxCHECK_MSG( firstPage, false, wxT("can't run empty wizard") );
m_firstpage = firstPage;
// can't return false here because there is no old page
(void)ShowPage(firstPage, true /* forward */);