///////////////////////////////////////////////////////////////////////////////
// ============================================================================
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// ----------------------------------------------------------------------------
// event tables and such
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// event tables and such
// ----------------------------------------------------------------------------
DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGING)
DEFINE_EVENT_TYPE(wxEVT_WIZARD_CANCEL)
DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGED)
DEFINE_EVENT_TYPE(wxEVT_WIZARD_PAGE_CHANGING)
DEFINE_EVENT_TYPE(wxEVT_WIZARD_CANCEL)
DEFINE_EVENT_TYPE(wxEVT_WIZARD_HELP)
BEGIN_EVENT_TABLE(wxWizard, wxDialog)
DEFINE_EVENT_TYPE(wxEVT_WIZARD_HELP)
BEGIN_EVENT_TABLE(wxWizard, wxDialog)
EVT_WIZARD_PAGE_CHANGED(-1, wxWizard::OnWizEvent)
EVT_WIZARD_PAGE_CHANGING(-1, wxWizard::OnWizEvent)
EVT_WIZARD_CANCEL(-1, wxWizard::OnWizEvent)
EVT_WIZARD_PAGE_CHANGED(-1, wxWizard::OnWizEvent)
EVT_WIZARD_PAGE_CHANGING(-1, wxWizard::OnWizEvent)
EVT_WIZARD_CANCEL(-1, wxWizard::OnWizEvent)
// default width and height of the page
static const int DEFAULT_PAGE_WIDTH = 270;
static const int DEFAULT_PAGE_HEIGHT = 290;
// default width and height of the page
static const int DEFAULT_PAGE_WIDTH = 270;
static const int DEFAULT_PAGE_HEIGHT = 290;
m_btnPrev = new wxButton(this, wxID_BACKWARD, _("< &Back"), wxPoint(x, y), sizeBtn);
x += sizeBtn.x;
m_btnPrev = new wxButton(this, wxID_BACKWARD, _("< &Back"), wxPoint(x, y), sizeBtn);
x += sizeBtn.x;
m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >"), wxPoint(x, y), sizeBtn);
x += sizeBtn.x + BUTTON_MARGIN;
m_btnNext = new wxButton(this, wxID_FORWARD, _("&Next >"), wxPoint(x, y), sizeBtn);
x += sizeBtn.x + BUTTON_MARGIN;
- wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGING, GetId(), goingForward);
+ wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGING, GetId(), goingForward, m_page);
- wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGED, GetId(), goingForward);
+ wxWizardEvent event(wxEVT_WIZARD_PAGE_CHANGED, GetId(), goingForward, m_page);
{
// this function probably can never be called when we don't have an active
// page, but a small extra check won't hurt
wxWindow *win = m_page ? (wxWindow *)m_page : (wxWindow *)this;
{
// this function probably can never be called when we don't have an active
// page, but a small extra check won't hurt
wxWindow *win = m_page ? (wxWindow *)m_page : (wxWindow *)this;
if ( !win->GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
{
// no objections - close the dialog
if ( !win->GetEventHandler()->ProcessEvent(event) || event.IsAllowed() )
{
// no objections - close the dialog
// ask the current page first: notice that we do it before calling
// GetNext/Prev() because the data transfered from the controls of the page
// may change the value returned by these methods
// ask the current page first: notice that we do it before calling
// GetNext/Prev() because the data transfered from the controls of the page
// may change the value returned by these methods
return new wxWizard(parent, id, title, bitmap, pos);
}
return new wxWizard(parent, id, title, bitmap, pos);
}
// ----------------------------------------------------------------------------
// wxWizardEvent
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// wxWizardEvent
// ----------------------------------------------------------------------------