X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/e75e8815757816135722ee8c8c144979449b14a7..12bb29f5432174ecbd65549bda832d70d34a98ae:/src/generic/wizard.cpp diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index d8dbd11137..60d8fa754b 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -83,6 +83,7 @@ private: wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent ); wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent ); +wxDEFINE_EVENT( wxEVT_WIZARD_BEFORE_PAGE_CHANGED, wxWizardEvent ); wxDEFINE_EVENT( wxEVT_WIZARD_CANCEL, wxWizardEvent ); wxDEFINE_EVENT( wxEVT_WIZARD_FINISHED, wxWizardEvent ); wxDEFINE_EVENT( wxEVT_WIZARD_HELP, wxWizardEvent ); @@ -792,6 +793,13 @@ void wxWizard::OnBackOrNext(wxCommandEvent& event) bool forward = event.GetEventObject() == m_btnNext; + // Give the application a chance to set state which may influence GetNext()/GetPrev() + wxWizardEvent eventPreChanged(wxEVT_WIZARD_BEFORE_PAGE_CHANGED, GetId(), forward, m_page); + (void)m_page->GetEventHandler()->ProcessEvent(eventPreChanged); + + if (!eventPreChanged.IsAllowed()) + return; + wxWizardPage *page; if ( forward ) {