1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: generic/wizard.h
3 // Purpose: declaration of generic wxWizard class
4 // Author: Vadim Zeitlin
5 // Modified by: Robert Vazan (sizers)
8 // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
9 // Licence: wxWindows licence
10 ///////////////////////////////////////////////////////////////////////////////
12 // ----------------------------------------------------------------------------
14 // ----------------------------------------------------------------------------
16 class WXDLLEXPORT wxButton
;
17 class WXDLLEXPORT wxStaticBitmap
;
18 class WXDLLIMPEXP_ADV wxWizardEvent
;
19 class WXDLLEXPORT wxBoxSizer
;
20 class WXDLLIMPEXP_ADV wxWizardSizer
;
22 class WXDLLIMPEXP_ADV wxWizard
: public wxWizardBase
26 wxWizard() { Init(); }
27 wxWizard(wxWindow
*parent
,
29 const wxString
& title
= wxEmptyString
,
30 const wxBitmap
& bitmap
= wxNullBitmap
,
31 const wxPoint
& pos
= wxDefaultPosition
,
32 long style
= wxDEFAULT_DIALOG_STYLE
)
35 Create(parent
, id
, title
, bitmap
, pos
, style
);
37 bool Create(wxWindow
*parent
,
39 const wxString
& title
= wxEmptyString
,
40 const wxBitmap
& bitmap
= wxNullBitmap
,
41 const wxPoint
& pos
= wxDefaultPosition
,
42 long style
= wxDEFAULT_DIALOG_STYLE
);
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
);
51 virtual wxSizer
*GetPageAreaSizer() const;
52 virtual void SetBorder(int border
);
54 // implementation only from now on
55 // -------------------------------
57 // is the wizard running?
58 bool IsRunning() const { return m_page
!= NULL
; }
60 // show the prev/next page, but call TransferDataFromWindow on the current
61 // page first and return false without changing the page if
62 // TransferDataFromWindow() returns false - otherwise, returns true
63 bool ShowPage(wxWizardPage
*page
, bool goingForward
= true);
65 // do fill the dialog with controls
66 // this is app-overridable to, for example, set help and tooltip text
67 virtual void DoCreateControls();
70 // was the dialog really created?
71 bool WasCreated() const { return m_btnPrev
!= NULL
; }
74 void OnCancel(wxCommandEvent
& event
);
75 void OnBackOrNext(wxCommandEvent
& event
);
76 void OnHelp(wxCommandEvent
& event
);
78 void OnWizEvent(wxWizardEvent
& event
);
80 void AddBitmapRow(wxBoxSizer
*mainColumn
);
81 void AddStaticLine(wxBoxSizer
*mainColumn
);
82 void AddBackNextPair(wxBoxSizer
*buttonRow
);
83 void AddButtonRow(wxBoxSizer
*mainColumn
);
85 #if wxABI_VERSION >= 20602
91 wxSize
GetManualPageSize() const;
93 // the page size requested by user
96 // the dialog position from the ctor
100 wxWizardPage
*m_page
; // the current page or NULL
101 wxBitmap m_bitmap
; // the default bitmap to show
104 wxButton
*m_btnPrev
, // the "<Back" button
105 *m_btnNext
; // the "Next>" or "Finish" button
106 wxStaticBitmap
*m_statbmp
; // the control for the bitmap
108 // Whether user called SetBorder()
109 bool m_calledSetBorder
;
110 // Border around page area sizer requested using SetBorder()
113 // Whether RunWizard() was called
116 // Page area sizer will be inserted here with padding
117 wxBoxSizer
*m_sizerBmpAndPage
;
119 // Actual position and size of pages
120 wxWizardSizer
*m_sizerPage
;
122 friend class wxWizardSizer
;
124 DECLARE_DYNAMIC_CLASS(wxWizard
)
125 DECLARE_EVENT_TABLE()
126 DECLARE_NO_COPY_CLASS(wxWizard
)