]>
Commit | Line | Data |
---|---|---|
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 | ||
16 | class WXDLLEXPORT wxButton; | |
17 | class WXDLLEXPORT wxStaticBitmap; | |
18 | ||
19 | class WXDLLEXPORT wxWizard : public wxWizardBase | |
20 | { | |
21 | public: | |
22 | // ctor | |
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, | |
34 | int id = -1, | |
35 | const wxString& title = wxEmptyString, | |
36 | const wxBitmap& bitmap = wxNullBitmap, | |
37 | const wxPoint& pos = wxDefaultPosition); | |
38 | void Init(); | |
39 | ||
40 | // implement base class pure virtuals | |
41 | virtual bool RunWizard(wxWizardPage *firstPage); | |
42 | virtual wxWizardPage *GetCurrentPage() const; | |
43 | virtual void SetPageSize(const wxSize& size); | |
44 | virtual wxSize GetPageSize() const; | |
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 | |
53 | // page first and return FALSE without changing the page if | |
54 | // TransferDataFromWindow() returns FALSE - otherwise, returns TRUE | |
55 | bool ShowPage(wxWizardPage *page, bool goingForward = TRUE); | |
56 | ||
57 | // do fill the dialog with controls | |
58 | // this is app-overridable to, for example, set help and tooltip text | |
59 | void DoCreateControls(); | |
60 | ||
61 | private: | |
62 | // was the dialog really created? | |
63 | bool WasCreated() const { return m_btnPrev != NULL; } | |
64 | ||
65 | // event handlers | |
66 | void OnCancel(wxCommandEvent& event); | |
67 | void OnBackOrNext(wxCommandEvent& event); | |
68 | ||
69 | // the page size requested by user | |
70 | wxSize m_sizePage; | |
71 | ||
72 | // the dialog position from the ctor | |
73 | wxPoint m_posWizard; | |
74 | ||
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 | |
82 | wxBitmap m_bitmap; // the default bitmap to show | |
83 | ||
84 | // wizard controls | |
85 | wxButton *m_btnPrev, // the "<Back" button | |
86 | *m_btnNext; // the "Next>" or "Finish" button | |
87 | wxStaticBitmap *m_statbmp; // the control for the bitmap | |
88 | ||
89 | DECLARE_DYNAMIC_CLASS(wxWizard) | |
90 | DECLARE_EVENT_TABLE() | |
91 | }; | |
92 |