]> git.saurik.com Git - wxWidgets.git/blame - include/wx/generic/wizard.h
fixed the last of the off-by-one errors (some are refixed, again...)
[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
23 wxWizard(wxWindow *parent = NULL,
24 int id = -1,
25 const wxString& title = wxEmptyString,
26 const wxBitmap& bitmap = wxNullBitmap,
f6bcfd97 27 const wxPoint& pos = wxDefaultPosition);
74b31181
VZ
28
29 // implement base class pure virtuals
30 virtual bool RunWizard(wxWizardPage *firstPage);
31 virtual wxWizardPage *GetCurrentPage() const;
f6bcfd97 32 virtual void SetPageSize(const wxSize& size);
4fe5383d 33 virtual wxSize GetPageSize() const;
74b31181
VZ
34
35 // implementation only from now on
36 // -------------------------------
37
38 // is the wizard running?
39 bool IsRunning() const { return m_page != NULL; }
40
41 // show the prev/next page, but call TransferDataFromWindow on the current
f6bcfd97
BP
42 // page first and return FALSE without changing the page if
43 // TransferDataFromWindow() returns FALSE - otherwise, returns TRUE
74b31181
VZ
44 bool ShowPage(wxWizardPage *page, bool goingForward = TRUE);
45
46private:
f6bcfd97
BP
47 // was the dialog really created?
48 bool WasCreated() const { return m_btnPrev != NULL; }
49
50 // do fill the dialog with controls
51 void DoCreateControls();
52
74b31181
VZ
53 // event handlers
54 void OnCancel(wxCommandEvent& event);
55 void OnBackOrNext(wxCommandEvent& event);
56
f6bcfd97
BP
57 // the page size requested by user
58 wxSize m_sizePage;
59
60 // the dialog position from the ctor
61 wxPoint m_posWizard;
62
74b31181
VZ
63 // wizard dimensions
64 int m_x, m_y; // the origin for the pages
65 int m_width, // the size of the page itself
66 m_height; // (total width is m_width + m_x)
67
68 // wizard state
69 wxWizardPage *m_page; // the current page or NULL
f1df0927 70 wxBitmap m_bitmap; // the default bitmap to show
74b31181
VZ
71
72 // wizard controls
73 wxButton *m_btnPrev, // the "<Back" button
74 *m_btnNext; // the "Next>" or "Finish" button
f1df0927 75 wxStaticBitmap *m_statbmp; // the control for the bitmap
74b31181
VZ
76
77 DECLARE_DYNAMIC_CLASS(wxWizard)
78 DECLARE_EVENT_TABLE()
79};
80