Code::Blocks  SVN r11506
wizpage.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
3  * http://www.gnu.org/licenses/gpl-3.0.html
4  */
5 
6 #ifndef WIZPAGE_H
7 #define WIZPAGE_H
8 
9 #include <map>
10 
11 #include <wx/string.h>
12 #include <wx/wizard.h>
13 #include <wx/panel.h>
14 #include <wx/xrc/xmlres.h>
15 
16 class wxItemContainer;
17 class ProjectPathPanel;
18 class CompilerPanel;
19 class BuildTargetPanel;
21 class FilePathPanel;
22 class GenericSelectPath;
23 class WizPageBase;
24 class InfoPanel;
25 
26 typedef std::map<wxString, WizPageBase*> PagesByName;
27 
28 namespace Wizard {
29 
30 void FillCompilerControl(wxItemContainer *control, const wxString& compilerID, const wxString& validCompilerIDs);
31 } // namespace Wizard
32 
34 {
35  public:
36  WizPageBase(const wxString& pageName, wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap);
37  ~WizPageBase();
38 
39  virtual bool SkipPage() const { return m_SkipPage; } // default: false
40 
41  virtual void OnPageChanging(wxWizardEvent& event);
42  virtual void OnPageChanged(wxWizardEvent& event);
43 
44  virtual wxWizardPage* GetPrev() const;
45  virtual wxWizardPage* GetNext() const;
46  wxString GetPageName() const {return m_PageName;}
47  bool GetSkipPage() const {return m_SkipPage;}
48  void SetSkipPage(bool skip) {m_SkipPage = skip;}
49 
50  private:
53  bool m_SkipPage;
54 
55  DECLARE_EVENT_TABLE()
56 };
57 
58 class WizPage : public WizPageBase
59 {
60  public:
61  WizPage(const wxString& panelName, wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap);
62  ~WizPage();
63  void OnButton(wxCommandEvent& event);
64  private:
65  DECLARE_EVENT_TABLE()
66 };
67 
68 class WizInfoPanel : public WizPageBase
69 {
70  public:
71  WizInfoPanel(const wxString& pageId, const wxString& intro_msg, wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap);
72  ~WizInfoPanel();
73 
74  virtual void OnPageChanging(wxWizardEvent& event);
75  private:
77 };
78 
80 {
81  public:
82  WizFilePathPanel(bool showHeaderGuard, wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap);
84 
85  wxString GetFilename() const { return m_Filename; }
86  wxString GetHeaderGuard() const { return m_HeaderGuard; }
87  bool GetAddToProject() const { return m_AddToProject; }
88  int GetTargetIndex() const;
89  void SetFilePathSelectionFilter(const wxString& filter);
90 
91  void OnPageChanging(wxWizardEvent& event);
92  private:
97 };
98 
100 {
101  public:
102  WizProjectPathPanel(wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap);
104 
105  wxString GetPath() const;
106  wxString GetName() const;
107  wxString GetFullFileName() const;
108  wxString GetTitle() const;
109 
110  void OnButton(wxCommandEvent& event);
111  virtual void OnPageChanging(wxWizardEvent& event);
112  virtual void OnPageChanged(wxWizardEvent& event);
113  private:
115 
116  DECLARE_EVENT_TABLE()
117 };
118 
120 {
121  public:
122  WizGenericSelectPathPanel(const wxString& pageId, const wxString& descr, const wxString& label, const wxString& defValue,
123  wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap);
125 
126  void OnButton(wxCommandEvent& event);
127  virtual void OnPageChanging(wxWizardEvent& event);
128  private:
130 
131  DECLARE_EVENT_TABLE()
132 };
133 
135 {
136  public:
137  WizCompilerPanel(const wxString& compilerID, const wxString& validCompilerIDs, wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap,
138  bool allowCompilerChange = true, bool allowConfigChange = true);
139  ~WizCompilerPanel();
140 
141  wxString GetCompilerID() const;
142  bool GetWantDebug() const;
143  wxString GetDebugName() const;
144  wxString GetDebugOutputDir() const;
145  wxString GetDebugObjectOutputDir() const;
146  bool GetWantRelease() const;
147  wxString GetReleaseName() const;
148  wxString GetReleaseOutputDir() const;
149  wxString GetReleaseObjectOutputDir() const;
150 
151  void OnPageChanging(wxWizardEvent& event);
152  private:
155 };
156 
158 {
159  public:
160  WizBuildTargetPanel(const wxString& targetName, bool isDebug,
161  wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap,
162  bool showCompiler = false,
163  const wxString& compilerID = wxEmptyString, const wxString& validCompilerIDs = _T("*"),
164  bool allowCompilerChange = true);
166 
167  wxString GetCompilerID() const;
168  bool GetEnableDebug() const;
169  wxString GetTargetName() const;
170  wxString GetTargetOutputDir() const;
171  wxString GetTargetObjectOutputDir() const;
172 
173  void OnPageChanging(wxWizardEvent& event);
174  private:
176 };
177 
179 {
180  public:
181  WizGenericSingleChoiceList(const wxString& pageId, const wxString& descr, const wxArrayString& choices, int defChoice, wxWizard* parent, const wxBitmap& bitmap = wxNullBitmap);
183 
184  int GetChoice() const;
185  void SetChoice(int choice);
186 
187  void OnPageChanging(wxWizardEvent& event);
188  private:
190 };
191 
192 #endif // WIZPAGE_H
void SetSkipPage(bool skip)
Definition: wizpage.h:48
bool m_AllowConfigChange
Definition: wizpage.h:154
bool GetSkipPage() const
Definition: wizpage.h:47
wxString GetPageName() const
Definition: wizpage.h:46
wxString GetFilename() const
Definition: wizpage.h:85
std::map< wxString, WizPageBase * > PagesByName
Definition: wizpage.h:24
bool m_AddToProject
Definition: wizpage.h:96
#define _T(string)
InfoPanel * m_InfoPanel
Definition: wizpage.h:76
ProjectPathPanel * m_pProjectPathPanel
Definition: wizpage.h:114
CompilerPanel * m_pCompilerPanel
Definition: wizpage.h:153
wxString m_PageName
Definition: wizpage.h:52
wxString GetHeaderGuard() const
Definition: wizpage.h:86
FilePathPanel * m_pFilePathPanel
Definition: wizpage.h:93
BuildTargetPanel * m_pBuildTargetPanel
Definition: wizpage.h:175
GenericSelectPath * m_pGenericSelectPath
Definition: wizpage.h:129
wxString wxEmptyString
virtual bool SkipPage() const
Definition: wizpage.h:39
void FillCompilerControl(wxItemContainer *control, const wxString &compilerID, const wxString &validCompilerIDs)
Definition: wizpage.cpp:38
bool m_SkipPage
Definition: wizpage.h:53
wxBitmap wxNullBitmap
wxString m_HeaderGuard
Definition: wizpage.h:95
wxString m_Filename
Definition: wizpage.h:94
bool GetAddToProject() const
Definition: wizpage.h:87
static PagesByName s_PagesByName
Definition: wizpage.h:51
GenericSingleChoiceList * m_pGenericSingleChoiceList
Definition: wizpage.h:189