]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/wizard.cpp
Applied patch [ 851044 ] wxGrid receives wxFocusEvent
[wxWidgets.git] / src / generic / wizard.cpp
index c3bddea1d192ffdd3327c5a6fcac9772a54e631f..bb0e6c60482ea23c386b885b2a9ccefe74fe6c05 100644 (file)
@@ -349,7 +349,10 @@ void wxWizard::AddStaticLine(wxBoxSizer *mainColumn)
 
 void wxWizard::AddBackNextPair(wxBoxSizer *buttonRow)
 {
-    wxASSERT_MSG(m_btnNext!=0 && m_btnPrev!=0, "You must create the buttons first before calling wxWizard::AddBackNextPair");
+    wxASSERT_MSG( m_btnNext && m_btnPrev,
+                  _T("You must create the buttons before calling ")
+                  _T("wxWizard::AddBackNextPair") );
+
     // margin between Back and Next buttons
 #ifdef __WXMAC__
     static const int BACKNEXT_MARGIN = 10;
@@ -529,11 +532,12 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
     {
         // terminate successfully
         EndModal(wxID_OK);
-        if ( !IsModal() )
-         {
-           wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(),FALSE, 0);
-           (void)GetEventHandler()->ProcessEvent(event);
-         }
+
+        // and notify the user code (this is especially useful for modeless
+        // wizards)
+        wxWizardEvent event(wxEVT_WIZARD_FINISHED, GetId(), FALSE, 0);
+        (void)GetEventHandler()->ProcessEvent(event);
+
         return TRUE;
     }
 
@@ -719,6 +723,7 @@ void wxWizard::OnWizEvent(wxWizardEvent& event)
     if ( !(GetExtraStyle() & wxWS_EX_BLOCK_EVENTS) )
     {
         // the event will be propagated anyhow
+        event.Skip();
         return;
     }
 
@@ -734,7 +739,7 @@ void wxWizard::OnWizEvent(wxWizardEvent& event)
 // our public interface
 // ----------------------------------------------------------------------------
 
-#ifdef WXWIN_COMPATIBILITY_2_2
+#if WXWIN_COMPATIBILITY_2_2
 
 /* static */
 wxWizard *wxWizardBase::Create(wxWindow *parent,