]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/wizard.h
Fixed OS/2 compilation problems.
[wxWidgets.git] / include / wx / generic / wizard.h
CommitLineData
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
16class WXDLLEXPORT wxButton;
17class WXDLLEXPORT wxStaticBitmap;
18
19class WXDLLEXPORT wxWizard : public wxWizardBase
74b31181
VZ
20{
21public:
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 61private:
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);
f80bf901 68 void OnHelp(wxCommandEvent& event);
74b31181 69
f6bcfd97
BP
70 // the page size requested by user
71 wxSize m_sizePage;
72
73 // the dialog position from the ctor
74 wxPoint m_posWizard;
75
74b31181
VZ
76 // wizard dimensions
77 int m_x, m_y; // the origin for the pages
78 int m_width, // the size of the page itself
79 m_height; // (total width is m_width + m_x)
80
81 // wizard state
82 wxWizardPage *m_page; // the current page or NULL
f1df0927 83 wxBitmap m_bitmap; // the default bitmap to show
74b31181
VZ
84
85 // wizard controls
86 wxButton *m_btnPrev, // the "<Back" button
87 *m_btnNext; // the "Next>" or "Finish" button
f1df0927 88 wxStaticBitmap *m_statbmp; // the control for the bitmap
74b31181
VZ
89
90 DECLARE_DYNAMIC_CLASS(wxWizard)
91 DECLARE_EVENT_TABLE()
92};
93