From deeb0a89b94742a35cb38b58dfca61ef3d555114 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Mon, 25 Jan 2010 18:48:21 +0000 Subject: [PATCH] Added EVT_WIZARD_PAGE_SHOWN event for wxWizard, to give apps a chance to initiate processing after a page is presented. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63263 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/wizard.h | 4 ++++ interface/wx/wizard.h | 4 ++++ src/generic/wizard.cpp | 5 +++++ 3 files changed, 13 insertions(+) diff --git a/include/wx/wizard.h b/include/wx/wizard.h index e0d2296a8a..f1930176ae 100644 --- a/include/wx/wizard.h +++ b/include/wx/wizard.h @@ -290,6 +290,7 @@ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_CHANGING, wxWizardE wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_CANCEL, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_HELP, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_FINISHED, wxWizardEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_ADV, wxEVT_WIZARD_PAGE_SHOWN, wxWizardEvent ); typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); @@ -316,6 +317,9 @@ typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); // the user pressed "Help" button #define EVT_WIZARD_HELP(id, fn) wx__DECLARE_WIZARDEVT(HELP, id, fn) +// the page was just shown and laid out +#define EVT_WIZARD_PAGE_SHOWN(id, fn) wx__DECLARE_WIZARDEVT(PAGE_SHOWN, id, fn) + #endif // wxUSE_WIZARDDLG #endif // _WX_WIZARD_H_ diff --git a/interface/wx/wizard.h b/interface/wx/wizard.h index 3204fba198..2bdfd7a0c3 100644 --- a/interface/wx/wizard.h +++ b/interface/wx/wizard.h @@ -98,6 +98,8 @@ public: The page has been just changed (this event can not be vetoed). @event{EVT_WIZARD_PAGE_CHANGING(id, func)} The page is being changed (this event can be vetoed). + @event{EVT_WIZARD_PAGE_SHOWN(id, func)} + The page was shown and laid out (this event cannot be vetoed). @event{EVT_WIZARD_CANCEL(id, func)} The user attempted to cancel the wizard (this event may also be vetoed). @event{EVT_WIZARD_HELP(id, func)} @@ -229,6 +231,8 @@ public: The page has just been changed (this event cannot be vetoed). @event{EVT_WIZARD_PAGE_CHANGING(id, func)} The page is being changed (this event can be vetoed). + @event{EVT_WIZARD_PAGE_SHOWN(id, func)} + The page was shown and laid out (this event cannot be vetoed). @event{EVT_WIZARD_CANCEL(id, func)} The user attempted to cancel the wizard (this event may also be vetoed). @event{EVT_WIZARD_HELP(id, func)} diff --git a/src/generic/wizard.cpp b/src/generic/wizard.cpp index ecd387555f..fb34ae6511 100644 --- a/src/generic/wizard.cpp +++ b/src/generic/wizard.cpp @@ -86,6 +86,7 @@ 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) @@ -662,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; }