1 ///////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxWizard class: a GUI control presenting the user with a
4 // sequence of dialogs which allows to simply perform some task
5 // Author: Vadim Zeitlin (partly based on work by Ron Kuris and Kevin B.
10 // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
11 // Licence: wxWindows license
12 ///////////////////////////////////////////////////////////////////////////////
17 // ----------------------------------------------------------------------------
19 // ----------------------------------------------------------------------------
21 class WXDLLEXPORT wxWizard
: public wxDialog
24 // create the wizard control
25 static wxWizard
*Create(wxWindow
*parent
,
27 const wxString
& title
= wxEmptyString
,
28 const wxBitmap
& bitmap
= wxNullBitmap
,
29 const wxPoint
& pos
= wxDefaultPosition
,
30 const wxSize
& size
= wxDefaultSize
);
32 // wizard construction: add/insert new page into it
33 // adds a page at the end
34 virtual void AddPage(wxPanel
*page
) = 0;
35 // adds a page before the page nPage (the new page will have this index)
36 virtual void InsertPage(int nPage
, wxPanel
*page
) = 0;
38 // executes the wizard, returns TRUE if it was successfully finished, FALSE
39 // if user cancelled it
40 virtual bool RunWizard() = 0;
42 // get the current page (NULL if RunWizard() isn't running)
43 virtual wxPanel
*GetCurrentPage() const = 0;
46 DECLARE_DYNAMIC_CLASS(wxWizard
)
49 // ----------------------------------------------------------------------------
50 // wxWizardEvent class represents an event generated by the wizard
51 // ----------------------------------------------------------------------------
53 class WXDLLEXPORT wxWizardEvent
: public wxNotifyEvent
56 wxWizardEvent(wxEventType type
= wxEVT_NULL
, int id
= 0);
58 // get the previously active page or -1 if none
59 int GetOldPage() const { return m_pageOld
; }
61 // get the current page or -1 if none
62 int GetPage() const { return m_page
; }
65 int m_pageOld
, m_page
;
67 DECLARE_DYNAMIC_CLASS(wxWizardEvent
)
70 // ----------------------------------------------------------------------------
71 // macros for handling wxWizardEvents
72 // ----------------------------------------------------------------------------
74 typedef void (wxEvtHandler::*wxWizardEventFunction
)(wxWizardEvent
&);
76 // notifies that the page has just been changed
77 #define EVT_WIZARD_PAGE_CHANGED(id, fn) { wxEVT_WIZARD_PAGE_CHANGED, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxWizardEventFunction) & fn, (wxObject *)NULL },
79 // the user pressed "<Back" or "Next>" button and the page is going to be
80 // changed - unless the event handler vetoes the event
81 #define EVT_WIZARD_PAGE_CHANGING(id, fn) { wxEVT_WIZARD_PAGE_CHANGING, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxWizardEventFunction) & fn, (wxObject *)NULL },
83 // the user pressed "Cancel" button and the wizard is going to be dismissed -
84 // unless the event handler vetoes the event
85 #define EVT_WIZARD_CANCEL(id, fn) { wxEVT_WIZARD_CANCEL, id, -1, (wxObjectEventFunction) (wxEventFunction) (wxWizardEventFunction) & fn, (wxObject *)NULL },
87 #endif // _WX_WIZARD_H_