X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c73b439f80d84ce1a58d862835b3b8cc3fb96f5d..da00a8bb164dd1f58dd0bb211475538a375867b4:/src/generic/wizard.cpp diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index 1e2e0f9fbf..c57773d6ce 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -280,7 +280,7 @@ void wxWizard::SetPageSize(const wxSize& size) m_sizePage = size; } -void wxWizard::Fit(const wxWizardPage *page) +void wxWizard::FitToPage(const wxWizardPage *page) { // otherwise it will have no effect now as it's too late... wxASSERT_MSG( !WasCreated(), _T("should be called before RunWizard()!") ); @@ -323,8 +323,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) // use these labels to determine if we need to change the bitmap // for this page - wxBitmap PreviousBitmap = wxNullBitmap; - wxBitmap ThisBitmap = wxNullBitmap; + wxBitmap bmpPrev, bmpCur; // check for previous page if ( m_page ) @@ -343,9 +342,9 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) btnLabelWasNext = m_page->GetNext() != (wxWizardPage *)NULL; // Get the bitmap of the previous page (if it exists) - if(m_page->GetBitmap().Ok()) - { - PreviousBitmap = m_page->GetBitmap(); + if ( m_page->GetBitmap().Ok() ) + { + bmpPrev = m_page->GetBitmap(); } } @@ -360,20 +359,15 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) return TRUE; } - // send the change event to the new page now - wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGED, GetId(), goingForward); - (void)m_page->GetEventHandler()->ProcessEvent(event); - // position and show the new page (void)m_page->TransferDataToWindow(); m_page->SetSize(m_x, m_y, m_width, m_height); - m_page->Show(); // check if bitmap needs to be updated // update default flag as well - if(m_page->GetBitmap().Ok()) + if ( m_page->GetBitmap().Ok() ) { - ThisBitmap = m_page->GetBitmap(); + bmpCur = m_page->GetBitmap(); bmpIsDefault = FALSE; } @@ -381,7 +375,7 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) // 1) a default bitmap was selected in constructor // 2) this page was constructed with a bitmap // 3) this bitmap is not the previous bitmap - if( m_statbmp && (ThisBitmap != PreviousBitmap) ) + if ( m_statbmp && (bmpCur != bmpPrev) ) { wxBitmap bmp; if ( bmpIsDefault ) @@ -405,6 +399,14 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) } // nothing to do: the label was already correct + // send the change event to the new page now + wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGED, GetId(), goingForward); + (void)m_page->GetEventHandler()->ProcessEvent(event); + + // and finally show it + m_page->Show(); + m_page->SetFocus(); + return TRUE; }