X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3c7789014106c9269b0f4ecc1a3071b14f351d3f..75595b9750de618c1ccc6356159aad0918bc4786:/src/generic/wizard.cpp diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index e42f6c65e9..fb34ae6511 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -81,11 +81,12 @@ private: // event tables and such // ---------------------------------------------------------------------------- -wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent ) -wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent ) -wxDEFINE_EVENT( wxEVT_WIZARD_CANCEL, wxWizardEvent ) -wxDEFINE_EVENT( wxEVT_WIZARD_FINISHED, wxWizardEvent ) -wxDEFINE_EVENT( wxEVT_WIZARD_HELP, wxWizardEvent ) +wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent ); +wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent ); +wxDEFINE_EVENT( wxEVT_WIZARD_CANCEL, wxWizardEvent ); +wxDEFINE_EVENT( wxEVT_WIZARD_FINISHED, wxWizardEvent ); +wxDEFINE_EVENT( wxEVT_WIZARD_HELP, wxWizardEvent ); +wxDEFINE_EVENT( wxEVT_WIZARD_PAGE_SHOWN, wxWizardEvent ); BEGIN_EVENT_TABLE(wxWizard, wxDialog) EVT_BUTTON(wxID_CANCEL, wxWizard::OnCancel) @@ -214,11 +215,6 @@ wxSize wxWizardSizer::CalcMin() wxSize wxWizardSizer::GetMaxChildSize() { -#if !defined(__WXDEBUG__) - if ( m_childSize.IsFullySpecified() ) - return m_childSize; -#endif - wxSize maxOfMin; for ( wxSizerItemList::compatibility_iterator childNode = m_children.GetFirst(); @@ -230,21 +226,6 @@ wxSize wxWizardSizer::GetMaxChildSize() maxOfMin.IncTo(SiblingSize(child)); } - // No longer applicable since we may change sizes when size adaptation is done -#if 0 -#ifdef __WXDEBUG__ - if ( m_childSize.IsFullySpecified() && m_childSize != maxOfMin ) - { - wxFAIL_MSG( _T("Size changed in wxWizard::GetPageAreaSizer()") - _T("after RunWizard().\n") - _T("Did you forget to call GetSizer()->Fit(this) ") - _T("for some page?")) ; - - return m_childSize; - } -#endif // __WXDEBUG__ -#endif - if ( m_owner->m_started ) { m_childSize = maxOfMin; @@ -289,7 +270,7 @@ wxSize wxWizardSizer::SiblingSize(wxSizerItem *child) void wxWizard::Init() { m_posWizard = wxDefaultPosition; - m_page = (wxWizardPage *)NULL; + m_page = NULL; m_btnPrev = m_btnNext = NULL; m_statbmp = NULL; m_sizerBmpAndPage = NULL; @@ -389,8 +370,8 @@ void wxWizard::AddStaticLine(wxBoxSizer *mainColumn) void wxWizard::AddBackNextPair(wxBoxSizer *buttonRow) { wxASSERT_MSG( m_btnNext && m_btnPrev, - _T("You must create the buttons before calling ") - _T("wxWizard::AddBackNextPair") ); + wxT("You must create the buttons before calling ") + wxT("wxWizard::AddBackNextPair") ); // margin between Back and Next buttons #ifdef __WXMAC__ @@ -451,7 +432,7 @@ void wxWizard::AddButtonRow(wxBoxSizer *mainColumn) wxButton *btnHelp=0; #ifdef __WXMAC__ if (GetExtraStyle() & wxWIZARD_EX_HELPBUTTON) - btnHelp=new wxButton(this, wxID_HELP, _("&Help"), wxDefaultPosition, wxDefaultSize, buttonStyle); + btnHelp=new wxButton(this, wxID_HELP, wxEmptyString, wxDefaultPosition, wxDefaultSize, buttonStyle); #endif m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >")); @@ -682,6 +663,10 @@ bool wxWizard::ShowPage(wxWizardPage *page, bool goingForward) m_sizerPage->RecalcSizes(); } + wxWizardEvent pageShownEvent(wxEVT_WIZARD_PAGE_SHOWN, GetId(), + goingForward, m_page); + m_page->GetEventHandler()->ProcessEvent(pageShownEvent); + return true; } @@ -798,7 +783,7 @@ void wxWizard::OnBackOrNext(wxCommandEvent& event) (event.GetEventObject() == m_btnPrev), wxT("unknown button") ); - wxCHECK_RET( m_page, _T("should have a valid current page") ); + wxCHECK_RET( m_page, wxT("should have a valid current page") ); // ask the current page first: notice that we do it before calling // GetNext/Prev() because the data transfered from the controls of the page @@ -936,7 +921,7 @@ bool wxWizard::DoLayoutAdaptation() // Size event doesn't get sent soon enough on wxGTK DoLayout(); - + SetLayoutAdaptationDone(true); return true;