Code::Blocks
SVN r11506
plugins
scriptedwizard
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
;
20
class
GenericSingleChoiceList
;
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
33
class
WizPageBase
:
public
wxWizardPageSimple
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
:
51
static
PagesByName
s_PagesByName
;
52
wxString
m_PageName
;
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
:
76
InfoPanel
*
m_InfoPanel
;
77
};
78
79
class
WizFilePathPanel
:
public
WizPageBase
80
{
81
public
:
82
WizFilePathPanel
(
bool
showHeaderGuard,
wxWizard
* parent,
const
wxBitmap
& bitmap =
wxNullBitmap
);
83
~
WizFilePathPanel
();
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
:
93
FilePathPanel
*
m_pFilePathPanel
;
94
wxString
m_Filename
;
95
wxString
m_HeaderGuard
;
96
bool
m_AddToProject
;
97
};
98
99
class
WizProjectPathPanel
:
public
WizPageBase
100
{
101
public
:
102
WizProjectPathPanel
(
wxWizard
* parent,
const
wxBitmap
& bitmap =
wxNullBitmap
);
103
~
WizProjectPathPanel
();
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
:
114
ProjectPathPanel
*
m_pProjectPathPanel
;
115
116
DECLARE_EVENT_TABLE()
117
};
118
119
class
WizGenericSelectPathPanel
:
public
WizPageBase
120
{
121
public
:
122
WizGenericSelectPathPanel
(
const
wxString
& pageId,
const
wxString
& descr,
const
wxString
& label,
const
wxString
& defValue,
123
wxWizard
* parent,
const
wxBitmap
& bitmap =
wxNullBitmap
);
124
~
WizGenericSelectPathPanel
();
125
126
void
OnButton(
wxCommandEvent
& event);
127
virtual
void
OnPageChanging(
wxWizardEvent
& event);
128
private
:
129
GenericSelectPath
*
m_pGenericSelectPath
;
130
131
DECLARE_EVENT_TABLE()
132
};
133
134
class
WizCompilerPanel
:
public
WizPageBase
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
:
153
CompilerPanel
*
m_pCompilerPanel
;
154
bool
m_AllowConfigChange
;
155
};
156
157
class
WizBuildTargetPanel
:
public
WizPageBase
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
);
165
~
WizBuildTargetPanel
();
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
:
175
BuildTargetPanel
*
m_pBuildTargetPanel
;
176
};
177
178
class
WizGenericSingleChoiceList
:
public
WizPageBase
179
{
180
public
:
181
WizGenericSingleChoiceList
(
const
wxString
& pageId,
const
wxString
& descr,
const
wxArrayString
& choices,
int
defChoice,
wxWizard
* parent,
const
wxBitmap
& bitmap =
wxNullBitmap
);
182
~
WizGenericSingleChoiceList
();
183
184
int
GetChoice()
const
;
185
void
SetChoice(
int
choice);
186
187
void
OnPageChanging(
wxWizardEvent
& event);
188
private
:
189
GenericSingleChoiceList
*
m_pGenericSingleChoiceList
;
190
};
191
192
#endif // WIZPAGE_H
WizPageBase::SetSkipPage
void SetSkipPage(bool skip)
Definition:
wizpage.h:48
WizCompilerPanel::m_AllowConfigChange
bool m_AllowConfigChange
Definition:
wizpage.h:154
WizPageBase::GetSkipPage
bool GetSkipPage() const
Definition:
wizpage.h:47
WizPageBase::GetPageName
wxString GetPageName() const
Definition:
wizpage.h:46
CompilerPanel
Definition:
compilerpanel.h:20
InfoPanel
Definition:
infopanel.h:19
GenericSingleChoiceList
Definition:
genericsinglechoicelist.h:20
string.h
wxWizardPage
WizFilePathPanel::GetFilename
wxString GetFilename() const
Definition:
wizpage.h:85
ProjectPathPanel
Definition:
projectpathpanel.h:20
PagesByName
std::map< wxString, WizPageBase * > PagesByName
Definition:
wizpage.h:24
WizFilePathPanel::m_AddToProject
bool m_AddToProject
Definition:
wizpage.h:96
WizBuildTargetPanel
Definition:
wizpage.h:157
wizard.h
WizProjectPathPanel
Definition:
wizpage.h:99
_T
#define _T(string)
WizInfoPanel::m_InfoPanel
InfoPanel * m_InfoPanel
Definition:
wizpage.h:76
WizProjectPathPanel::m_pProjectPathPanel
ProjectPathPanel * m_pProjectPathPanel
Definition:
wizpage.h:114
WizCompilerPanel::m_pCompilerPanel
CompilerPanel * m_pCompilerPanel
Definition:
wizpage.h:153
WizPageBase::m_PageName
wxString m_PageName
Definition:
wizpage.h:52
wxCommandEvent
wxWizard
WizGenericSingleChoiceList
Definition:
wizpage.h:178
wxBitmap
wxItemContainer
WizFilePathPanel::GetHeaderGuard
wxString GetHeaderGuard() const
Definition:
wizpage.h:86
Wizard
Definition:
wizpage.cpp:36
WizFilePathPanel::m_pFilePathPanel
FilePathPanel * m_pFilePathPanel
Definition:
wizpage.h:93
WizFilePathPanel
Definition:
wizpage.h:79
FilePathPanel
Definition:
filepathpanel.h:22
wxString
WizBuildTargetPanel::m_pBuildTargetPanel
BuildTargetPanel * m_pBuildTargetPanel
Definition:
wizpage.h:175
GenericSelectPath
Definition:
genericselectpath.h:20
WizInfoPanel
Definition:
wizpage.h:68
WizPage
Definition:
wizpage.h:58
WizGenericSelectPathPanel::m_pGenericSelectPath
GenericSelectPath * m_pGenericSelectPath
Definition:
wizpage.h:129
wxEmptyString
wxString wxEmptyString
WizPageBase::SkipPage
virtual bool SkipPage() const
Definition:
wizpage.h:39
Wizard::FillCompilerControl
void FillCompilerControl(wxItemContainer *control, const wxString &compilerID, const wxString &validCompilerIDs)
Definition:
wizpage.cpp:38
WizPageBase::m_SkipPage
bool m_SkipPage
Definition:
wizpage.h:53
xmlres.h
wxNullBitmap
wxBitmap wxNullBitmap
wxWizardEvent
wxArrayString
WizFilePathPanel::m_HeaderGuard
wxString m_HeaderGuard
Definition:
wizpage.h:95
BuildTargetPanel
Definition:
buildtargetpanel.h:21
WizCompilerPanel
Definition:
wizpage.h:134
WizFilePathPanel::m_Filename
wxString m_Filename
Definition:
wizpage.h:94
WizFilePathPanel::GetAddToProject
bool GetAddToProject() const
Definition:
wizpage.h:87
WizGenericSelectPathPanel
Definition:
wizpage.h:119
WizPageBase
Definition:
wizpage.h:33
WizPageBase::s_PagesByName
static PagesByName s_PagesByName
Definition:
wizpage.h:51
WizGenericSingleChoiceList::m_pGenericSingleChoiceList
GenericSingleChoiceList * m_pGenericSingleChoiceList
Definition:
wizpage.h:189
panel.h
wxWizardPageSimple
Generated by
1.8.13