]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/wizard.h
Fix another line somehow missing from the wxGraphicsBitmap forward port.
[wxWidgets.git] / include / wx / generic / wizard.h
CommitLineData
74b31181 1///////////////////////////////////////////////////////////////////////////////
94c09a19 2// Name: wx/generic/wizard.h
74b31181
VZ
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
20ceebaa
MW
12#ifndef _WX_GENERIC_WIZARD_H_
13#define _WX_GENERIC_WIZARD_H_
14
74b31181
VZ
15// ----------------------------------------------------------------------------
16// wxWizard
17// ----------------------------------------------------------------------------
18
b5dbe15d
VS
19class WXDLLIMPEXP_FWD_CORE wxButton;
20class WXDLLIMPEXP_FWD_CORE wxStaticBitmap;
21class WXDLLIMPEXP_FWD_ADV wxWizardEvent;
22class WXDLLIMPEXP_FWD_CORE wxBoxSizer;
23class WXDLLIMPEXP_FWD_ADV wxWizardSizer;
f1df0927 24
12f190b0 25class WXDLLIMPEXP_ADV wxWizard : public wxWizardBase
74b31181
VZ
26{
27public:
28 // ctor
77436c4c
JS
29 wxWizard() { Init(); }
30 wxWizard(wxWindow *parent,
ca65c044 31 int id = wxID_ANY,
77436c4c
JS
32 const wxString& title = wxEmptyString,
33 const wxBitmap& bitmap = wxNullBitmap,
07f20d9a
VZ
34 const wxPoint& pos = wxDefaultPosition,
35 long style = wxDEFAULT_DIALOG_STYLE)
77436c4c
JS
36 {
37 Init();
07f20d9a 38 Create(parent, id, title, bitmap, pos, style);
77436c4c
JS
39 }
40 bool Create(wxWindow *parent,
ca65c044 41 int id = wxID_ANY,
74b31181
VZ
42 const wxString& title = wxEmptyString,
43 const wxBitmap& bitmap = wxNullBitmap,
07f20d9a
VZ
44 const wxPoint& pos = wxDefaultPosition,
45 long style = wxDEFAULT_DIALOG_STYLE);
77436c4c 46 void Init();
781130bf 47 virtual ~wxWizard();
74b31181
VZ
48
49 // implement base class pure virtuals
50 virtual bool RunWizard(wxWizardPage *firstPage);
51 virtual wxWizardPage *GetCurrentPage() const;
f6bcfd97 52 virtual void SetPageSize(const wxSize& size);
4fe5383d 53 virtual wxSize GetPageSize() const;
3ee58334 54 virtual void FitToPage(const wxWizardPage *firstPage);
07f20d9a
VZ
55 virtual wxSizer *GetPageAreaSizer() const;
56 virtual void SetBorder(int border);
74b31181 57
f49fd6d0
JS
58 /// set/get bitmap
59 const wxBitmap& GetBitmap() const { return m_bitmap; }
60 void SetBitmap(const wxBitmap& bitmap);
61
74b31181
VZ
62 // implementation only from now on
63 // -------------------------------
64
65 // is the wizard running?
66 bool IsRunning() const { return m_page != NULL; }
67
68 // show the prev/next page, but call TransferDataFromWindow on the current
ca65c044
WS
69 // page first and return false without changing the page if
70 // TransferDataFromWindow() returns false - otherwise, returns true
3aa8e4ea 71 virtual bool ShowPage(wxWizardPage *page, bool goingForward = true);
74b31181 72
77436c4c
JS
73 // do fill the dialog with controls
74 // this is app-overridable to, for example, set help and tooltip text
aacb1b80 75 virtual void DoCreateControls();
77436c4c 76
3aa8e4ea
JS
77 // Do the adaptation
78 virtual bool DoLayoutAdaptation();
79
80 // Set/get bitmap background colour
81 void SetBitmapBackgroundColour(const wxColour& colour) { m_bitmapBackgroundColour = colour; }
82 const wxColour& GetBitmapBackgroundColour() const { return m_bitmapBackgroundColour; }
83
84 // Set/get bitmap placement (centred, tiled etc.)
85 void SetBitmapPlacement(int placement) { m_bitmapPlacement = placement; }
86 int GetBitmapPlacement() const { return m_bitmapPlacement; }
87
88 // Set/get minimum bitmap width
89 void SetMinimumBitmapWidth(int w) { m_bitmapMinimumWidth = w; }
90 int GetMinimumBitmapWidth() const { return m_bitmapMinimumWidth; }
91
92 // Tile bitmap
93 static bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap);
94
84006e65 95protected:
0a089246
VZ
96 // for compatibility only, doesn't do anything any more
97 void FinishLayout() { }
84006e65 98
3aa8e4ea
JS
99 // Do fit, and adjust to screen size if necessary
100 virtual void DoWizardLayout();
101
102 // Resize bitmap if necessary
103 virtual bool ResizeBitmap(wxBitmap& bmp);
104
f6bcfd97
BP
105 // was the dialog really created?
106 bool WasCreated() const { return m_btnPrev != NULL; }
107
74b31181
VZ
108 // event handlers
109 void OnCancel(wxCommandEvent& event);
110 void OnBackOrNext(wxCommandEvent& event);
f80bf901 111 void OnHelp(wxCommandEvent& event);
74b31181 112
91c68292
VZ
113 void OnWizEvent(wxWizardEvent& event);
114
07f20d9a
VZ
115 void AddBitmapRow(wxBoxSizer *mainColumn);
116 void AddStaticLine(wxBoxSizer *mainColumn);
117 void AddBackNextPair(wxBoxSizer *buttonRow);
118 void AddButtonRow(wxBoxSizer *mainColumn);
119
f6bcfd97
BP
120 // the page size requested by user
121 wxSize m_sizePage;
122
123 // the dialog position from the ctor
124 wxPoint m_posWizard;
125
74b31181
VZ
126 // wizard state
127 wxWizardPage *m_page; // the current page or NULL
f1df0927 128 wxBitmap m_bitmap; // the default bitmap to show
74b31181
VZ
129
130 // wizard controls
131 wxButton *m_btnPrev, // the "<Back" button
132 *m_btnNext; // the "Next>" or "Finish" button
f1df0927 133 wxStaticBitmap *m_statbmp; // the control for the bitmap
74b31181 134
07f20d9a
VZ
135 // Border around page area sizer requested using SetBorder()
136 int m_border;
ca65c044 137
07f20d9a
VZ
138 // Whether RunWizard() was called
139 bool m_started;
ca65c044 140
94c09a19
WS
141 // Whether was modal (modeless has to be destroyed on finish or cancel)
142 bool m_wasModal;
143
0a089246
VZ
144 // True if pages are laid out using the sizer
145 bool m_usingSizer;
146
07f20d9a
VZ
147 // Page area sizer will be inserted here with padding
148 wxBoxSizer *m_sizerBmpAndPage;
ca65c044 149
07f20d9a
VZ
150 // Actual position and size of pages
151 wxWizardSizer *m_sizerPage;
ca65c044 152
3aa8e4ea
JS
153 // Bitmap background colour if resizing bitmap
154 wxColour m_bitmapBackgroundColour;
155
156 // Bitmap placement flags
157 int m_bitmapPlacement;
158
159 // Minimum bitmap width
160 int m_bitmapMinimumWidth;
161
07f20d9a 162 friend class wxWizardSizer;
ca65c044 163
74b31181
VZ
164 DECLARE_DYNAMIC_CLASS(wxWizard)
165 DECLARE_EVENT_TABLE()
c0c133e1 166 wxDECLARE_NO_COPY_CLASS(wxWizard);
74b31181
VZ
167};
168
20ceebaa 169#endif // _WX_GENERIC_WIZARD_H_