1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: generic/wizard.h
3 // Purpose: declaration of generic wxWizard class
4 // Author: Vadim Zeitlin
8 // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows license
10 ///////////////////////////////////////////////////////////////////////////////
12 // ----------------------------------------------------------------------------
14 // ----------------------------------------------------------------------------
16 class WXDLLEXPORT wxButton
;
17 class WXDLLEXPORT wxStaticBitmap
;
19 class WXDLLEXPORT wxWizard
: public wxWizardBase
23 wxWizard() { Init(); }
24 wxWizard(wxWindow
*parent
,
26 const wxString
& title
= wxEmptyString
,
27 const wxBitmap
& bitmap
= wxNullBitmap
,
28 const wxPoint
& pos
= wxDefaultPosition
)
31 Create(parent
, id
, title
, bitmap
, pos
);
33 bool Create(wxWindow
*parent
,
35 const wxString
& title
= wxEmptyString
,
36 const wxBitmap
& bitmap
= wxNullBitmap
,
37 const wxPoint
& pos
= wxDefaultPosition
);
40 // implement base class pure virtuals
41 virtual bool RunWizard(wxWizardPage
*firstPage
);
42 virtual wxWizardPage
*GetCurrentPage() const;
43 virtual void SetPageSize(const wxSize
& size
);
44 virtual wxSize
GetPageSize() const;
46 // implementation only from now on
47 // -------------------------------
49 // is the wizard running?
50 bool IsRunning() const { return m_page
!= NULL
; }
52 // show the prev/next page, but call TransferDataFromWindow on the current
53 // page first and return FALSE without changing the page if
54 // TransferDataFromWindow() returns FALSE - otherwise, returns TRUE
55 bool ShowPage(wxWizardPage
*page
, bool goingForward
= TRUE
);
57 // do fill the dialog with controls
58 // this is app-overridable to, for example, set help and tooltip text
59 void DoCreateControls();
62 // was the dialog really created?
63 bool WasCreated() const { return m_btnPrev
!= NULL
; }
66 void OnCancel(wxCommandEvent
& event
);
67 void OnBackOrNext(wxCommandEvent
& event
);
68 void OnHelp(wxCommandEvent
& event
);
70 // the page size requested by user
73 // the dialog position from the ctor
77 int m_x
, m_y
; // the origin for the pages
78 int m_width
, // the size of the page itself
79 m_height
; // (total width is m_width + m_x)
82 wxWizardPage
*m_page
; // the current page or NULL
83 wxBitmap m_bitmap
; // the default bitmap to show
86 wxButton
*m_btnPrev
, // the "<Back" button
87 *m_btnNext
; // the "Next>" or "Finish" button
88 wxStaticBitmap
*m_statbmp
; // the control for the bitmap
90 DECLARE_DYNAMIC_CLASS(wxWizard
)