X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/55ccdb93e4ae4b606a4068cb37492c1ec3ed77a6..9a7b7798282622e445efc3318b6c85ff0bed9af8:/src/generic/wizard.cpp diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 138f1c6680..c3d603509e 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -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 // ----------------------------------------------------------------------------