]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/wizard.h
fixed a signed/unsigned comparison warning introudced by last warning fix...
[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
07f20d9a 5// Modified by: Robert Vazan (sizers)
74b31181
VZ
6// Created: 28.09.99
7// RCS-ID: $Id$
8// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
65571936 9// Licence: wxWindows licence
74b31181
VZ
10///////////////////////////////////////////////////////////////////////////////
11
12// ----------------------------------------------------------------------------
13// wxWizard
14// ----------------------------------------------------------------------------
15
f1df0927
VZ
16class WXDLLEXPORT wxButton;
17class WXDLLEXPORT wxStaticBitmap;
12f190b0 18class WXDLLIMPEXP_ADV wxWizardEvent;
07f20d9a 19class WXDLLEXPORT wxBoxSizer;
12f190b0 20class WXDLLIMPEXP_ADV wxWizardSizer;
f1df0927 21
12f190b0 22class WXDLLIMPEXP_ADV wxWizard : public wxWizardBase
74b31181
VZ
23{
24public:
25 // ctor
77436c4c
JS
26 wxWizard() { Init(); }
27 wxWizard(wxWindow *parent,
ca65c044 28 int id = wxID_ANY,
77436c4c
JS
29 const wxString& title = wxEmptyString,
30 const wxBitmap& bitmap = wxNullBitmap,
07f20d9a
VZ
31 const wxPoint& pos = wxDefaultPosition,
32 long style = wxDEFAULT_DIALOG_STYLE)
77436c4c
JS
33 {
34 Init();
07f20d9a 35 Create(parent, id, title, bitmap, pos, style);
77436c4c
JS
36 }
37 bool Create(wxWindow *parent,
ca65c044 38 int id = wxID_ANY,
74b31181
VZ
39 const wxString& title = wxEmptyString,
40 const wxBitmap& bitmap = wxNullBitmap,
07f20d9a
VZ
41 const wxPoint& pos = wxDefaultPosition,
42 long style = wxDEFAULT_DIALOG_STYLE);
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);
07f20d9a
VZ
51 virtual wxSizer *GetPageAreaSizer() const;
52 virtual void SetBorder(int border);
74b31181
VZ
53
54 // implementation only from now on
55 // -------------------------------
56
57 // is the wizard running?
58 bool IsRunning() const { return m_page != NULL; }
59
60 // show the prev/next page, but call TransferDataFromWindow on the current
ca65c044
WS
61 // page first and return false without changing the page if
62 // TransferDataFromWindow() returns false - otherwise, returns true
63 bool ShowPage(wxWizardPage *page, bool goingForward = true);
74b31181 64
77436c4c
JS
65 // do fill the dialog with controls
66 // this is app-overridable to, for example, set help and tooltip text
aacb1b80 67 virtual void DoCreateControls();
77436c4c 68
84006e65
VZ
69protected:
70 void FinishLayout();
71
74b31181 72private:
f6bcfd97
BP
73 // was the dialog really created?
74 bool WasCreated() const { return m_btnPrev != NULL; }
75
74b31181
VZ
76 // event handlers
77 void OnCancel(wxCommandEvent& event);
78 void OnBackOrNext(wxCommandEvent& event);
f80bf901 79 void OnHelp(wxCommandEvent& event);
74b31181 80
91c68292
VZ
81 void OnWizEvent(wxWizardEvent& event);
82
07f20d9a
VZ
83 void AddBitmapRow(wxBoxSizer *mainColumn);
84 void AddStaticLine(wxBoxSizer *mainColumn);
85 void AddBackNextPair(wxBoxSizer *buttonRow);
86 void AddButtonRow(wxBoxSizer *mainColumn);
87
07f20d9a 88 wxSize GetManualPageSize() const;
ca65c044 89
f6bcfd97
BP
90 // the page size requested by user
91 wxSize m_sizePage;
92
93 // the dialog position from the ctor
94 wxPoint m_posWizard;
95
74b31181
VZ
96 // wizard state
97 wxWizardPage *m_page; // the current page or NULL
f1df0927 98 wxBitmap m_bitmap; // the default bitmap to show
74b31181
VZ
99
100 // wizard controls
101 wxButton *m_btnPrev, // the "<Back" button
102 *m_btnNext; // the "Next>" or "Finish" button
f1df0927 103 wxStaticBitmap *m_statbmp; // the control for the bitmap
74b31181 104
07f20d9a
VZ
105 // Whether user called SetBorder()
106 bool m_calledSetBorder;
107 // Border around page area sizer requested using SetBorder()
108 int m_border;
ca65c044 109
07f20d9a
VZ
110 // Whether RunWizard() was called
111 bool m_started;
ca65c044 112
07f20d9a
VZ
113 // Page area sizer will be inserted here with padding
114 wxBoxSizer *m_sizerBmpAndPage;
ca65c044 115
07f20d9a
VZ
116 // Actual position and size of pages
117 wxWizardSizer *m_sizerPage;
ca65c044 118
07f20d9a 119 friend class wxWizardSizer;
ca65c044 120
74b31181
VZ
121 DECLARE_DYNAMIC_CLASS(wxWizard)
122 DECLARE_EVENT_TABLE()
22f3361e 123 DECLARE_NO_COPY_CLASS(wxWizard)
74b31181
VZ
124};
125