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 #if defined(__GNUG__) && !defined(__APPLE__)
17 #pragma interface "wizardg.h"
20 class WXDLLEXPORT wxButton
;
21 class WXDLLEXPORT wxStaticBitmap
;
22 class WXDLLEXPORT wxWizardEvent
;
23 class WXDLLEXPORT wxBoxSizer
;
24 class WXDLLEXPORT wxWizardSizer
;
26 class WXDLLEXPORT wxWizard
: public wxWizardBase
30 wxWizard() { Init(); }
31 wxWizard(wxWindow
*parent
,
33 const wxString
& title
= wxEmptyString
,
34 const wxBitmap
& bitmap
= wxNullBitmap
,
35 const wxPoint
& pos
= wxDefaultPosition
,
36 long style
= wxDEFAULT_DIALOG_STYLE
)
39 Create(parent
, id
, title
, bitmap
, pos
, style
);
41 bool Create(wxWindow
*parent
,
43 const wxString
& title
= wxEmptyString
,
44 const wxBitmap
& bitmap
= wxNullBitmap
,
45 const wxPoint
& pos
= wxDefaultPosition
,
46 long style
= wxDEFAULT_DIALOG_STYLE
);
49 // implement base class pure virtuals
50 virtual bool RunWizard(wxWizardPage
*firstPage
);
51 virtual wxWizardPage
*GetCurrentPage() const;
52 virtual void SetPageSize(const wxSize
& size
);
53 virtual wxSize
GetPageSize() const;
54 virtual void FitToPage(const wxWizardPage
*firstPage
);
55 virtual wxSizer
*GetPageAreaSizer() const;
56 virtual void SetBorder(int border
);
58 // implementation only from now on
59 // -------------------------------
61 // is the wizard running?
62 bool IsRunning() const { return m_page
!= NULL
; }
64 // show the prev/next page, but call TransferDataFromWindow on the current
65 // page first and return FALSE without changing the page if
66 // TransferDataFromWindow() returns FALSE - otherwise, returns TRUE
67 bool ShowPage(wxWizardPage
*page
, bool goingForward
= TRUE
);
69 // do fill the dialog with controls
70 // this is app-overridable to, for example, set help and tooltip text
71 virtual void DoCreateControls();
74 // was the dialog really created?
75 bool WasCreated() const { return m_btnPrev
!= NULL
; }
78 void OnCancel(wxCommandEvent
& event
);
79 void OnBackOrNext(wxCommandEvent
& event
);
80 void OnHelp(wxCommandEvent
& event
);
82 void OnWizEvent(wxWizardEvent
& event
);
84 void AddBitmapRow(wxBoxSizer
*mainColumn
);
85 void AddStaticLine(wxBoxSizer
*mainColumn
);
86 void AddBackNextPair(wxBoxSizer
*buttonRow
);
87 void AddButtonRow(wxBoxSizer
*mainColumn
);
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
)