]>
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 | ||
f1df0927 VZ |
16 | class WXDLLEXPORT wxButton; |
17 | class WXDLLEXPORT wxStaticBitmap; | |
18 | ||
19 | class WXDLLEXPORT wxWizard : public wxWizardBase | |
74b31181 VZ |
20 | { |
21 | public: | |
22 | // ctor | |
77436c4c JS |
23 | wxWizard() { Init(); } |
24 | wxWizard(wxWindow *parent, | |
25 | int id = -1, | |
26 | const wxString& title = wxEmptyString, | |
27 | const wxBitmap& bitmap = wxNullBitmap, | |
28 | const wxPoint& pos = wxDefaultPosition) | |
29 | { | |
30 | Init(); | |
31 | Create(parent, id, title, bitmap, pos); | |
32 | } | |
33 | bool Create(wxWindow *parent, | |
74b31181 VZ |
34 | int id = -1, |
35 | const wxString& title = wxEmptyString, | |
36 | const wxBitmap& bitmap = wxNullBitmap, | |
f6bcfd97 | 37 | const wxPoint& pos = wxDefaultPosition); |
77436c4c | 38 | void Init(); |
74b31181 VZ |
39 | |
40 | // implement base class pure virtuals | |
41 | virtual bool RunWizard(wxWizardPage *firstPage); | |
42 | virtual wxWizardPage *GetCurrentPage() const; | |
f6bcfd97 | 43 | virtual void SetPageSize(const wxSize& size); |
4fe5383d | 44 | virtual wxSize GetPageSize() const; |
74b31181 VZ |
45 | |
46 | // implementation only from now on | |
47 | // ------------------------------- | |
48 | ||
49 | // is the wizard running? | |
50 | bool IsRunning() const { return m_page != NULL; } | |
51 | ||
52 | // show the prev/next page, but call TransferDataFromWindow on the current | |
f6bcfd97 BP |
53 | // page first and return FALSE without changing the page if |
54 | // TransferDataFromWindow() returns FALSE - otherwise, returns TRUE | |
74b31181 VZ |
55 | bool ShowPage(wxWizardPage *page, bool goingForward = TRUE); |
56 | ||
77436c4c JS |
57 | // do fill the dialog with controls |
58 | // this is app-overridable to, for example, set help and tooltip text | |
59 | void DoCreateControls(); | |
60 | ||
74b31181 | 61 | private: |
f6bcfd97 BP |
62 | // was the dialog really created? |
63 | bool WasCreated() const { return m_btnPrev != NULL; } | |
64 | ||
74b31181 VZ |
65 | // event handlers |
66 | void OnCancel(wxCommandEvent& event); | |
67 | void OnBackOrNext(wxCommandEvent& event); | |
68 | ||
f6bcfd97 BP |
69 | // the page size requested by user |
70 | wxSize m_sizePage; | |
71 | ||
72 | // the dialog position from the ctor | |
73 | wxPoint m_posWizard; | |
74 | ||
74b31181 VZ |
75 | // wizard dimensions |
76 | int m_x, m_y; // the origin for the pages | |
77 | int m_width, // the size of the page itself | |
78 | m_height; // (total width is m_width + m_x) | |
79 | ||
80 | // wizard state | |
81 | wxWizardPage *m_page; // the current page or NULL | |
f1df0927 | 82 | wxBitmap m_bitmap; // the default bitmap to show |
74b31181 VZ |
83 | |
84 | // wizard controls | |
85 | wxButton *m_btnPrev, // the "<Back" button | |
86 | *m_btnNext; // the "Next>" or "Finish" button | |
f1df0927 | 87 | wxStaticBitmap *m_statbmp; // the control for the bitmap |
74b31181 VZ |
88 | |
89 | DECLARE_DYNAMIC_CLASS(wxWizard) | |
90 | DECLARE_EVENT_TABLE() | |
91 | }; | |
92 |