]> git.saurik.com Git - wxWidgets.git/blobdiff - src/generic/wizard.cpp
fix bug with adding entries to a root group containing only subgroups (as shown by...
[wxWidgets.git] / src / generic / wizard.cpp
index 138f1c6680fb63680f18c815680ebd550b0fd0ff..c3d603509ed8f57dc2c804e26aabefa785eba192 100644 (file)
@@ -125,31 +125,17 @@ void wxWizardPage::Init()
 }
 
 wxWizardPage::wxWizardPage(wxWizard *parent,
-                           const wxBitmap& bitmap,
-                           const wxChar *resource)
+                           const wxBitmap& bitmap)
 {
-    Create(parent, bitmap, resource);
+    Create(parent, bitmap);
 }
 
 bool wxWizardPage::Create(wxWizard *parent,
-                          const wxBitmap& bitmap,
-                          const wxChar *resource)
+                          const wxBitmap& bitmap)
 {
     if ( !wxPanel::Create(parent, wxID_ANY) )
         return false;
 
-    if ( resource != NULL )
-    {
-#if wxUSE_WX_RESOURCES
-#if 0
-       if ( !LoadFromResource(this, resource) )
-        {
-            wxFAIL_MSG(wxT("wxWizardPage LoadFromResource failed!!!!"));
-        }
-#endif
-#endif // wxUSE_RESOURCES
-    }
-
     m_bitmap = bitmap;
 
     // initially the page is hidden, it's shown only when it becomes current
@@ -326,6 +312,15 @@ bool wxWizard::Create(wxWindow *parent,
     return result;
 }
 
+wxWizard::~wxWizard()
+{
+    // normally we don't have to delete this sizer as it's deleted by the
+    // associated window but if we never used it or didn't set it as the window
+    // sizer yet, do delete it manually
+    if ( !m_usingSizer || !m_started )
+        delete m_sizerPage;
+}
+
 void wxWizard::AddBitmapRow(wxBoxSizer *mainColumn)
 {
     m_sizerBmpAndPage = new wxBoxSizer(wxHORIZONTAL);
@@ -631,7 +626,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
         if ( !bmpPrev.Ok() )
             bmpPrev = m_bitmap;
 
-        if ( !bmp.IsRefTo(&bmpPrev) )
+        if ( !bmp.IsSameAs(bmpPrev) )
             m_statbmp->SetBitmap(bmp);
     }
 #endif // wxUSE_STATBMP
@@ -643,7 +638,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward)
     bool hasNext = HasNextPage(m_page);
     if ( btnLabelWasNext != hasNext )
     {
-        m_btnNext->SetLabel(hasNext ? _("&Next >") : _("&Finish"));
+        if ( hasNext )
+            m_btnNext->SetLabel(_("&Next >"));
+        else
+            m_btnNext->SetLabel(_("&Finish"));
     }
     // nothing to do: the label was already correct
 
@@ -845,6 +843,13 @@ void wxWizard::OnWizEvent(wxWizardEvent& event)
     }
 }
 
+void wxWizard::SetBitmap(const wxBitmap& bitmap)
+{
+    m_bitmap = bitmap;
+    if (m_statbmp)
+        m_statbmp->SetBitmap(m_bitmap);
+}
+
 // ----------------------------------------------------------------------------
 // wxWizardEvent
 // ----------------------------------------------------------------------------