]>
Commit | Line | Data |
---|---|---|
74b31181 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: generic/wizard.h | |
3 | // Purpose: declaration of generic wxWizard class | |
4 | // Author: Vadim Zeitlin | |
5 | // Modified by: | |
6 | // Created: 28.09.99 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr> | |
9 | // Licence: wxWindows license | |
10 | /////////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | // ---------------------------------------------------------------------------- | |
13 | // wxWizard | |
14 | // ---------------------------------------------------------------------------- | |
15 | ||
af49c4b8 | 16 | #if defined(__GNUG__) && !defined(__APPLE__) |
91c68292 VZ |
17 | #pragma interface "wizardg.h" |
18 | #endif | |
19 | ||
f1df0927 VZ |
20 | class WXDLLEXPORT wxButton; |
21 | class WXDLLEXPORT wxStaticBitmap; | |
91c68292 | 22 | class WXDLLEXPORT wxWizardEvent; |
f1df0927 VZ |
23 | |
24 | class WXDLLEXPORT wxWizard : public wxWizardBase | |
74b31181 VZ |
25 | { |
26 | public: | |
27 | // ctor | |
77436c4c JS |
28 | wxWizard() { Init(); } |
29 | wxWizard(wxWindow *parent, | |
30 | int id = -1, | |
31 | const wxString& title = wxEmptyString, | |
32 | const wxBitmap& bitmap = wxNullBitmap, | |
33 | const wxPoint& pos = wxDefaultPosition) | |
34 | { | |
35 | Init(); | |
36 | Create(parent, id, title, bitmap, pos); | |
37 | } | |
38 | bool Create(wxWindow *parent, | |
74b31181 VZ |
39 | int id = -1, |
40 | const wxString& title = wxEmptyString, | |
41 | const wxBitmap& bitmap = wxNullBitmap, | |
f6bcfd97 | 42 | const wxPoint& pos = wxDefaultPosition); |
77436c4c | 43 | void Init(); |
74b31181 VZ |
44 | |
45 | // implement base class pure virtuals | |
46 | virtual bool RunWizard(wxWizardPage *firstPage); | |
47 | virtual wxWizardPage *GetCurrentPage() const; | |
f6bcfd97 | 48 | virtual void SetPageSize(const wxSize& size); |
4fe5383d | 49 | virtual wxSize GetPageSize() const; |
3ee58334 | 50 | virtual void FitToPage(const wxWizardPage *firstPage); |
74b31181 VZ |
51 | |
52 | // implementation only from now on | |
53 | // ------------------------------- | |
54 | ||
55 | // is the wizard running? | |
56 | bool IsRunning() const { return m_page != NULL; } | |
57 | ||
58 | // show the prev/next page, but call TransferDataFromWindow on the current | |
f6bcfd97 BP |
59 | // page first and return FALSE without changing the page if |
60 | // TransferDataFromWindow() returns FALSE - otherwise, returns TRUE | |
74b31181 VZ |
61 | bool ShowPage(wxWizardPage *page, bool goingForward = TRUE); |
62 | ||
77436c4c JS |
63 | // do fill the dialog with controls |
64 | // this is app-overridable to, for example, set help and tooltip text | |
aacb1b80 | 65 | virtual void DoCreateControls(); |
77436c4c | 66 | |
74b31181 | 67 | private: |
f6bcfd97 BP |
68 | // was the dialog really created? |
69 | bool WasCreated() const { return m_btnPrev != NULL; } | |
70 | ||
74b31181 VZ |
71 | // event handlers |
72 | void OnCancel(wxCommandEvent& event); | |
73 | void OnBackOrNext(wxCommandEvent& event); | |
f80bf901 | 74 | void OnHelp(wxCommandEvent& event); |
74b31181 | 75 | |
91c68292 VZ |
76 | void OnWizEvent(wxWizardEvent& event); |
77 | ||
f6bcfd97 BP |
78 | // the page size requested by user |
79 | wxSize m_sizePage; | |
80 | ||
81 | // the dialog position from the ctor | |
82 | wxPoint m_posWizard; | |
83 | ||
74b31181 VZ |
84 | // wizard dimensions |
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) | |
88 | ||
89 | // wizard state | |
90 | wxWizardPage *m_page; // the current page or NULL | |
f1df0927 | 91 | wxBitmap m_bitmap; // the default bitmap to show |
74b31181 VZ |
92 | |
93 | // wizard controls | |
94 | wxButton *m_btnPrev, // the "<Back" button | |
95 | *m_btnNext; // the "Next>" or "Finish" button | |
f1df0927 | 96 | wxStaticBitmap *m_statbmp; // the control for the bitmap |
74b31181 VZ |
97 | |
98 | DECLARE_DYNAMIC_CLASS(wxWizard) | |
99 | DECLARE_EVENT_TABLE() | |
22f3361e | 100 | DECLARE_NO_COPY_CLASS(wxWizard) |
74b31181 VZ |
101 | }; |
102 |