diff --git a/docs/changes.txt b/docs/changes.txt index 4659001928..9d90e57ef6 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -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: diff --git a/include/wx/generic/wizard.h b/include/wx/generic/wizard.h index d8c9643b08..8d6b64936d 100644 --- a/include/wx/generic/wizard.h +++ b/include/wx/generic/wizard.h @@ -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 diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index bfd140a7a9..f3c47f3670 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -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 */);