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 #if defined(__GNUG__) && !defined(__APPLE__)
17 #pragma interface "wizardg.h"
20 class WXDLLEXPORT wxButton
;
21 class WXDLLEXPORT wxStaticBitmap
;
22 class WXDLLEXPORT wxWizardEvent
;
24 class WXDLLEXPORT wxWizard
: public wxWizardBase
28 wxWizard() { Init(); }
29 wxWizard(wxWindow
*parent
,
31 const wxString
& title
= wxEmptyString
,
32 const wxBitmap
& bitmap
= wxNullBitmap
,
33 const wxPoint
& pos
= wxDefaultPosition
)
36 Create(parent
, id
, title
, bitmap
, pos
);
38 bool Create(wxWindow
*parent
,
40 const wxString
& title
= wxEmptyString
,
41 const wxBitmap
& bitmap
= wxNullBitmap
,
42 const wxPoint
& pos
= wxDefaultPosition
);
45 // implement base class pure virtuals
46 virtual bool RunWizard(wxWizardPage
*firstPage
);
47 virtual wxWizardPage
*GetCurrentPage() const;
48 virtual void SetPageSize(const wxSize
& size
);
49 virtual wxSize
GetPageSize() const;
50 virtual void FitToPage(const wxWizardPage
*firstPage
);
52 // implementation only from now on
53 // -------------------------------
55 // is the wizard running?
56 bool IsRunning() const { return m_page
!= NULL
; }
58 // show the prev/next page, but call TransferDataFromWindow on the current
59 // page first and return FALSE without changing the page if
60 // TransferDataFromWindow() returns FALSE - otherwise, returns TRUE
61 bool ShowPage(wxWizardPage
*page
, bool goingForward
= TRUE
);
63 // do fill the dialog with controls
64 // this is app-overridable to, for example, set help and tooltip text
65 virtual void DoCreateControls();
68 // was the dialog really created?
69 bool WasCreated() const { return m_btnPrev
!= NULL
; }
72 void OnCancel(wxCommandEvent
& event
);
73 void OnBackOrNext(wxCommandEvent
& event
);
74 void OnHelp(wxCommandEvent
& event
);
76 void OnWizEvent(wxWizardEvent
& event
);
78 // the page size requested by user
81 // the dialog position from the ctor
85 int m_x
, m_y
; // the origin for the pages
86 int m_width
, // the size of the page itself
87 m_height
; // (total width is m_width + m_x)
90 wxWizardPage
*m_page
; // the current page or NULL
91 wxBitmap m_bitmap
; // the default bitmap to show
94 wxButton
*m_btnPrev
, // the "<Back" button
95 *m_btnNext
; // the "Next>" or "Finish" button
96 wxStaticBitmap
*m_statbmp
; // the control for the bitmap
98 DECLARE_DYNAMIC_CLASS(wxWizard
)