File: clBoostrapWizardBase.cpp

package info (click to toggle)
codelite 17.0.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 136,204 kB
  • sloc: cpp: 491,547; ansic: 280,393; php: 10,259; sh: 8,930; lisp: 7,664; vhdl: 6,518; python: 6,020; lex: 4,920; yacc: 3,123; perl: 2,385; javascript: 1,715; cs: 1,193; xml: 1,110; makefile: 804; cobol: 741; sql: 709; ruby: 620; f90: 566; ada: 534; asm: 464; fortran: 350; objc: 289; tcl: 258; java: 157; erlang: 61; pascal: 51; ml: 49; awk: 44; haskell: 36
file content (300 lines) | stat: -rw-r--r-- 15,499 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: clBoostrapWizardBase.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////

#include "clBoostrapWizardBase.h"

// Declare the bitmap loading function
extern void wxCFAD6InitBitmapResources();

static bool bBitmapLoaded = false;

clBoostrapWizardBase::clBoostrapWizardBase(wxWindow* parent, wxWindowID id, const wxString& title, const wxBitmap& bmp,
                                           const wxPoint& pos, long style)
{
    if(!bBitmapLoaded) {
        // We need to initialise the default bitmap handler
        wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
        wxCFAD6InitBitmapResources();
        bBitmapLoaded = true;
    }
    Create(parent, id, title, wxNullBitmap, pos, style);

    m_wizardPageWelcome = new clBoostrapWizardPageWelcome(this, NULL, NULL, wxNullBitmap);
    m_pages.push_back(m_wizardPageWelcome);

    wxBoxSizer* boxSizer79 = new wxBoxSizer(wxVERTICAL);
    m_wizardPageWelcome->SetSizer(boxSizer79);

    m_banner81 = new wxBannerWindow(m_wizardPageWelcome, wxID_ANY, wxTOP, wxDefaultPosition,
                                    wxDLG_UNIT(m_wizardPageWelcome, wxSize(-1, -1)), 0);
    m_banner81->SetBitmap(wxNullBitmap);
    m_banner81->SetText(_("Welcome to the setup wizard"),
                        _("This wizard will help you setup CodeLite to fit your coding style. Click Next to continue"));
    m_banner81->SetGradient(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE),
                            wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));

    boxSizer79->Add(m_banner81, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxBoxSizer* boxSizer105 = new wxBoxSizer(wxVERTICAL);

    boxSizer79->Add(boxSizer105, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    boxSizer105->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_cmdLnkBtn107 = new wxCommandLinkButton(
        m_wizardPageWelcome, wxID_ANY, _("Not this time!"),
        _("If your CodeLite is already configured the way you like it, click to skip the Wizard"), wxDefaultPosition,
        wxDLG_UNIT(m_wizardPageWelcome, wxSize(-1, -1)), 0);

    boxSizer105->Add(m_cmdLnkBtn107, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));

    boxSizer105->Add(0, 0, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_wizardPagePlugins = new clBoostrapWizardPagePlugins(this, NULL, NULL, wxNullBitmap);
    m_pages.push_back(m_wizardPagePlugins);

    wxBoxSizer* boxSizer89 = new wxBoxSizer(wxVERTICAL);
    m_wizardPagePlugins->SetSizer(boxSizer89);

    m_banner811 = new wxBannerWindow(m_wizardPagePlugins, wxID_ANY, wxTOP, wxDefaultPosition,
                                     wxDLG_UNIT(m_wizardPagePlugins, wxSize(-1, -1)), 0);
    m_banner811->SetBitmap(wxNullBitmap);
    m_banner811->SetText(_("Development Profile"), _("Select the profile that best describes you"));
    m_banner811->SetGradient(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE),
                             wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));

    boxSizer89->Add(m_banner811, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxBoxSizer* boxSizer93 = new wxBoxSizer(wxHORIZONTAL);

    boxSizer89->Add(boxSizer93, 1, wxEXPAND, WXC_FROM_DIP(5));

    wxBoxSizer* boxSizer114 = new wxBoxSizer(wxVERTICAL);

    boxSizer93->Add(boxSizer114, 1, wxEXPAND, WXC_FROM_DIP(5));

    wxArrayString m_radioBoxProfileArr;
    m_radioBoxProfileArr.Add(_("Default"));
    m_radioBoxProfileArr.Add(_("C/C++ development"));
    m_radioBoxProfileArr.Add(_("Web development (PHP, JS etc)"));
    m_radioBoxProfileArr.Add(_("C/C++ development (Blockchain using EOSIO)"));
    m_radioBoxProfile =
        new wxRadioBox(m_wizardPagePlugins, wxID_ANY, wxT(""), wxDefaultPosition,
                       wxDLG_UNIT(m_wizardPagePlugins, wxSize(-1, -1)), m_radioBoxProfileArr, 1, wxRA_SPECIFY_COLS);
    m_radioBoxProfile->SetSelection(0);

    boxSizer114->Add(m_radioBoxProfile, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_wizardPageCompilers = new clBoostrapWizardPageCompilers(this, NULL, NULL, wxNullBitmap);
    m_pages.push_back(m_wizardPageCompilers);

    wxBoxSizer* boxSizer52 = new wxBoxSizer(wxVERTICAL);
    m_wizardPageCompilers->SetSizer(boxSizer52);

    m_banner69 = new wxBannerWindow(m_wizardPageCompilers, wxID_ANY, wxTOP, wxDefaultPosition,
                                    wxDLG_UNIT(m_wizardPageCompilers, wxSize(-1, -1)), 0);
    m_banner69->SetBitmap(wxNullBitmap);
    m_banner69->SetText(_("Setup compilers"),
                        _("Let CodeLite configure your installed compilers or help you install one"));
    m_banner69->SetGradient(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE),
                            wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));

    boxSizer52->Add(m_banner69, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_cmdLnkBtnScanForCompilers = new wxCommandLinkButton(
        m_wizardPageCompilers, wxID_ANY, _("Scan"), _("Click to scan your computer for installed compilers"),
        wxDefaultPosition, wxDLG_UNIT(m_wizardPageCompilers, wxSize(-1, -1)), 0);

    boxSizer52->Add(m_cmdLnkBtnScanForCompilers, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_cmdLnkBtnDownloadCompiler =
        new wxCommandLinkButton(m_wizardPageCompilers, wxID_ANY, _("Install"), _("Click to download a MinGW compiler"),
                                wxDefaultPosition, wxDLG_UNIT(m_wizardPageCompilers, wxSize(-1, -1)), 0);

    boxSizer52->Add(m_cmdLnkBtnDownloadCompiler, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_dvListCtrlCompilers = new wxDataViewListCtrl(m_wizardPageCompilers, wxID_ANY, wxDefaultPosition,
                                                   wxDLG_UNIT(m_wizardPageCompilers, wxSize(-1, -1)),
                                                   wxDV_VERT_RULES | wxDV_ROW_LINES | wxDV_SINGLE);
    m_dvListCtrlCompilers->Hide();

    boxSizer52->Add(m_dvListCtrlCompilers, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_dvListCtrlCompilers->AppendTextColumn(_("Compiler Name"), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(150), wxALIGN_LEFT,
                                            wxDATAVIEW_COL_RESIZABLE);
    m_dvListCtrlCompilers->AppendTextColumn(_("Installation Path"), wxDATAVIEW_CELL_INERT, WXC_FROM_DIP(-2),
                                            wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE);
    m_wizardPageColoursAndFonts = new clBoostrapWizardPageColours(this, NULL, NULL, wxNullBitmap);
    m_pages.push_back(m_wizardPageColoursAndFonts);

    wxBoxSizer* boxSizer12 = new wxBoxSizer(wxVERTICAL);
    m_wizardPageColoursAndFonts->SetSizer(boxSizer12);

    m_banner71 = new wxBannerWindow(m_wizardPageColoursAndFonts, wxID_ANY, wxTOP, wxDefaultPosition,
                                    wxDLG_UNIT(m_wizardPageColoursAndFonts, wxSize(-1, -1)), 0);
    m_banner71->SetBitmap(wxNullBitmap);
    m_banner71->SetText(_("Customise colours"), _("Select the editor theme from the list below.\nYou can always change "
                                                  "this from the menu: Settings -> Colours and fonts..."));
    m_banner71->SetGradient(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE),
                            wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));

    boxSizer12->Add(m_banner71, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    wxFlexGridSizer* flexGridSizer118 = new wxFlexGridSizer(0, 2, 0, 0);
    flexGridSizer118->SetFlexibleDirection(wxBOTH);
    flexGridSizer118->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED);
    flexGridSizer118->AddGrowableCol(1);

    boxSizer12->Add(flexGridSizer118, 0, wxEXPAND, WXC_FROM_DIP(5));

    m_staticText122 = new wxStaticText(m_wizardPageColoursAndFonts, wxID_ANY, _("Theme:"), wxDefaultPosition,
                                       wxDLG_UNIT(m_wizardPageColoursAndFonts, wxSize(-1, -1)), 0);

    flexGridSizer118->Add(m_staticText122, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, WXC_FROM_DIP(5));

    wxArrayString m_themePickerArr;
    m_themePickerArr.Add(wxT("Default (OS settings)"));
    m_themePickerArr.Add(wxT("Dark"));
    m_themePickerArr.Add(wxT("Light"));
    m_themePicker = new wxChoice(m_wizardPageColoursAndFonts, wxID_ANY, wxDefaultPosition,
                                 wxDLG_UNIT(m_wizardPageColoursAndFonts, wxSize(-1, -1)), m_themePickerArr, 0);
    m_themePicker->SetToolTip(_("Set the IDE global colour\nThis colour affects various controls"));
    m_themePicker->SetSelection(0);

    flexGridSizer118->Add(m_themePicker, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_stc24 = new wxStyledTextCtrl(m_wizardPageColoursAndFonts, wxID_ANY, wxDefaultPosition,
                                   wxDLG_UNIT(m_wizardPageColoursAndFonts, wxSize(-1, -1)), 0);
    // Configure the fold margin
    m_stc24->SetMarginType(4, wxSTC_MARGIN_SYMBOL);
    m_stc24->SetMarginMask(4, wxSTC_MASK_FOLDERS);
    m_stc24->SetMarginSensitive(4, true);
    m_stc24->SetMarginWidth(4, 16);

    m_stc24->SetProperty(wxT("fold"), wxT("1"));
    m_stc24->MarkerDefine(wxSTC_MARKNUM_FOLDEROPEN, wxSTC_MARK_ARROWDOWN);
    m_stc24->MarkerDefine(wxSTC_MARKNUM_FOLDER, wxSTC_MARK_ARROW);
    m_stc24->MarkerDefine(wxSTC_MARKNUM_FOLDERSUB, wxSTC_MARK_BACKGROUND);
    m_stc24->MarkerDefine(wxSTC_MARKNUM_FOLDERTAIL, wxSTC_MARK_BACKGROUND);
    m_stc24->MarkerDefine(wxSTC_MARKNUM_FOLDEREND, wxSTC_MARK_ARROW);
    m_stc24->MarkerDefine(wxSTC_MARKNUM_FOLDEROPENMID, wxSTC_MARK_ARROWDOWN);
    m_stc24->MarkerDefine(wxSTC_MARKNUM_FOLDERMIDTAIL, wxSTC_MARK_BACKGROUND);
    // Configure the tracker margin
    m_stc24->SetMarginWidth(1, 0);

    // Configure the symbol margin
    m_stc24->SetMarginType(2, wxSTC_MARGIN_SYMBOL);
    m_stc24->SetMarginMask(2, ~(wxSTC_MASK_FOLDERS));
    m_stc24->SetMarginWidth(2, 0);
    m_stc24->SetMarginSensitive(2, true);

    // Configure the line numbers margin
    int m_stc24_PixelWidth = 4 + 5 * m_stc24->TextWidth(wxSTC_STYLE_LINENUMBER, wxT("9"));
    m_stc24->SetMarginType(0, wxSTC_MARGIN_NUMBER);
    m_stc24->SetMarginWidth(0, m_stc24_PixelWidth);

    // Configure the line symbol margin
    m_stc24->SetMarginType(3, wxSTC_MARGIN_FORE);
    m_stc24->SetMarginMask(3, 0);
    m_stc24->SetMarginWidth(3, 0);
    // Select the lexer
    m_stc24->SetLexer(wxSTC_LEX_NULL);
    // Set default font / styles
    m_stc24->StyleClearAll();
    m_stc24->SetWrapMode(0);
    m_stc24->SetIndentationGuides(0);
    m_stc24->SetKeyWords(0, wxT(""));
    m_stc24->SetKeyWords(1, wxT(""));
    m_stc24->SetKeyWords(2, wxT(""));
    m_stc24->SetKeyWords(3, wxT(""));
    m_stc24->SetKeyWords(4, wxT(""));

    boxSizer12->Add(m_stc24, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    m_wizardPageWhitespace = new clBoostrapWizardPageWhitespace(this, NULL, NULL, wxNullBitmap);
    m_pages.push_back(m_wizardPageWhitespace);
    if(m_pages.size() > 1) {
        for(size_t i = 1; i < m_pages.size(); i++) {
            wxWizardPageSimple::Chain(m_pages.at(i - 1), m_pages.at(i));
        }
    }
    GetPageAreaSizer()->Add(m_pages.at(0));

    wxBoxSizer* boxSizer30 = new wxBoxSizer(wxVERTICAL);
    m_wizardPageWhitespace->SetSizer(boxSizer30);

    m_banner73 = new wxBannerWindow(m_wizardPageWhitespace, wxID_ANY, wxTOP, wxDefaultPosition,
                                    wxDLG_UNIT(m_wizardPageWhitespace, wxSize(-1, -1)), 0);
    m_banner73->SetBitmap(wxNullBitmap);
    m_banner73->SetText(_("Whitespace & Indentation"), _("Should CodeLite use TABS or SPACES for indentation?"));
    m_banner73->SetGradient(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE),
                            wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE));

    boxSizer30->Add(m_banner73, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));

    boxSizer30->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5));

    wxArrayString m_radioBoxSpacesVsTabsArr;
    m_radioBoxSpacesVsTabsArr.Add(_("Indent using SPACES"));
    m_radioBoxSpacesVsTabsArr.Add(_("Indent using TABS"));
    m_radioBoxSpacesVsTabs = new wxRadioBox(m_wizardPageWhitespace, wxID_ANY, _("Indentation"), wxDefaultPosition,
                                            wxDLG_UNIT(m_wizardPageWhitespace, wxSize(200, -1)),
                                            m_radioBoxSpacesVsTabsArr, 1, wxRA_SPECIFY_COLS);
    m_radioBoxSpacesVsTabs->SetSelection(0);

    boxSizer30->Add(m_radioBoxSpacesVsTabs, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));

    wxArrayString m_radioBoxWhitespaceVisibilityArr;
    m_radioBoxWhitespaceVisibilityArr.Add(_("Invisible"));
    m_radioBoxWhitespaceVisibilityArr.Add(_("Visible always"));
    m_radioBoxWhitespaceVisibilityArr.Add(_("Visible after indentation"));
    m_radioBoxWhitespaceVisibility = new wxRadioBox(
        m_wizardPageWhitespace, wxID_ANY, _("Whitespace Visibility:"), wxDefaultPosition,
        wxDLG_UNIT(m_wizardPageWhitespace, wxSize(200, -1)), m_radioBoxWhitespaceVisibilityArr, 1, wxRA_SPECIFY_COLS);
    m_radioBoxWhitespaceVisibility->SetSelection(1);

    boxSizer30->Add(m_radioBoxWhitespaceVisibility, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));

    boxSizer30->Add(0, 0, 1, wxALL, WXC_FROM_DIP(5));

    SetName(wxT("clBoostrapWizardBase"));
    SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
    if(GetSizer()) {
        GetSizer()->Fit(this);
    }
    if(GetParent()) {
        CentreOnParent(wxBOTH);
    } else {
        CentreOnScreen(wxBOTH);
    }
    // Connect events
    this->Connect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(clBoostrapWizardBase::OnFinish), NULL, this);
    m_cmdLnkBtn107->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(clBoostrapWizardBase::OnCancelWizard),
                            NULL, this);
    m_cmdLnkBtnScanForCompilers->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
                                         wxCommandEventHandler(clBoostrapWizardBase::OnScanForCompilers), NULL, this);
    m_cmdLnkBtnDownloadCompiler->Connect(wxEVT_UPDATE_UI,
                                         wxUpdateUIEventHandler(clBoostrapWizardBase::OnInstallCompilerUI), NULL, this);
    m_cmdLnkBtnDownloadCompiler->Connect(wxEVT_COMMAND_BUTTON_CLICKED,
                                         wxCommandEventHandler(clBoostrapWizardBase::OnInstallCompiler), NULL, this);
    m_themePicker->Connect(wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler(clBoostrapWizardBase::OnThemeSelected),
                           NULL, this);
}

clBoostrapWizardBase::~clBoostrapWizardBase()
{
    this->Disconnect(wxEVT_WIZARD_FINISHED, wxWizardEventHandler(clBoostrapWizardBase::OnFinish), NULL, this);
    m_cmdLnkBtn107->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
                               wxCommandEventHandler(clBoostrapWizardBase::OnCancelWizard), NULL, this);
    m_cmdLnkBtnScanForCompilers->Disconnect(
        wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(clBoostrapWizardBase::OnScanForCompilers), NULL, this);
    m_cmdLnkBtnDownloadCompiler->Disconnect(
        wxEVT_UPDATE_UI, wxUpdateUIEventHandler(clBoostrapWizardBase::OnInstallCompilerUI), NULL, this);
    m_cmdLnkBtnDownloadCompiler->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED,
                                            wxCommandEventHandler(clBoostrapWizardBase::OnInstallCompiler), NULL, this);
    m_themePicker->Disconnect(wxEVT_COMMAND_CHOICE_SELECTED,
                              wxCommandEventHandler(clBoostrapWizardBase::OnThemeSelected), NULL, this);
}