]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/wizard.cpp
missing commit
[wxWidgets.git] / src / generic / wizard.cpp
index d8dbd11137d24d2160b2889e06ade2483342a238..60d8fa754b025a6dcaf2a982f265644393e6e3a0 100644 (file)
@@ -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 )
     {