]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/wizard.cpp
Remove superfluous mouse capturing in wxGrid row/column labels windows.
[wxWidgets.git] / src / generic / wizard.cpp
index d8dbd11137d24d2160b2889e06ade2483342a238..25d1a669d081be6b6af62b598cf6f88ef5198daf 100644 (file)
@@ -8,7 +8,6 @@
 //              3) Fixed ShowPage() bug on displaying bitmaps
 //              Robert Vazan (sizers)
 // Created:     15.08.99
-// RCS-ID:      $Id$
 // Copyright:   (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -83,6 +82,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 +792,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 )
     {