Code::Blocks  SVN r11506
wizpage.cpp
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  * $Revision: 9832 $
6  * $Id: wizpage.cpp 9832 2014-06-25 00:31:36Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/scriptedwizard/wizpage.cpp $
8  */
9 
10 #include <sdk.h>
11 #ifndef CB_PRECOMP
12  #include <wx/ctrlsub.h>
13  #include <manager.h>
14  #include <logmanager.h>
15  #include <configmanager.h>
16  #include <projectmanager.h>
17  #include <scriptingmanager.h>
18  #include <compilerfactory.h>
19  #include <compiler.h>
20  #include <macrosmanager.h>
21  #include <cbproject.h>
22  #include <cbexception.h>
23 #endif
24 
26 
27 #include "wizpage.h"
28 #include "infopanel.h"
29 #include "projectpathpanel.h"
30 #include "compilerpanel.h"
31 #include "buildtargetpanel.h"
32 #include "filepathpanel.h"
33 #include "genericselectpath.h"
35 
36 namespace Wizard {
37 
38 void FillCompilerControl(wxItemContainer *control, const wxString& compilerID, const wxString& validCompilerIDs)
39 {
40  const wxArrayString &valids = GetArrayFromString(validCompilerIDs, _T(";"), true);
41  wxString def = compilerID;
42  if (def.IsEmpty())
44  int id = 0;
45  control->Clear();
46  for (size_t i = 0; i < CompilerFactory::GetCompilersCount(); ++i)
47  {
49  if (compiler)
50  {
51  for (size_t n = 0; n < valids.GetCount(); ++n)
52  {
53  // match not only if IDs match, but if ID inherits from it too
54  if (CompilerFactory::CompilerInheritsFrom(compiler, valids[n]))
55  {
56  control->Append(compiler->GetName());
57  if (compiler->GetID().IsSameAs(def))
58  id = control->GetCount() < 1 ? 0 : (control->GetCount() - 1);
59  break;
60  }
61  }
62  }
63  }
64  control->SetSelection(id);
65 }
66 
67 } // namespace Wizard
68 
69 using namespace Wizard;
70 
71 // utility function to append a path separator to the
72 // string parameter, if needed.
74 {
75  if (path.IsEmpty() || path.Last() == _T('/') || path.Last() == _T('\\'))
76  return path;
77  return path + wxFILE_SEP_PATH;
78 }
79 
80 // static
82 
84 // WizPage
86 
87 BEGIN_EVENT_TABLE(WizPageBase, wxWizardPageSimple)
88  EVT_WIZARD_PAGE_CHANGING(-1, WizPageBase::OnPageChanging)
89  EVT_WIZARD_PAGE_CHANGED(-1, WizPageBase::OnPageChanged)
90 END_EVENT_TABLE()
91 
92 WizPageBase::WizPageBase(const wxString& pageName, wxWizard* parent, const wxBitmap& bitmap)
93  : wxWizardPageSimple(parent, 0, 0, bitmap),
94  m_PageName(pageName)
95 {
96  // duplicate pageIDs are not allowed
97  if (s_PagesByName[m_PageName])
98  cbThrow(_T("Page ID in use:") + pageName);
99 
100  // register this to the static pages map
101  s_PagesByName[m_PageName] = this;
102 
103  // if this is true, the page won't be added to the wizard
104  m_SkipPage = Manager::Get()->GetConfigManager(_T("scripts"))->ReadBool(_T("/generic_wizard/") + m_PageName + _T("/skip"), false);
105 }
106 
107 //------------------------------------------------------------------------------
109 {
110  // unregister this from the static pages map
111  s_PagesByName[m_PageName] = 0;
112 }
113 
114 //------------------------------------------------------------------------------
115 
117 {
118  try
119  {
120  wxString sig = _T("OnGetPrevPage_") + m_PageName;
121  SqPlus::SquirrelFunction<wxString&> cb(cbU2C(sig));
122  if (cb.func.IsNull())
124  wxString prev = cb();
125  if (prev.IsEmpty())
126  return 0;
127  return s_PagesByName[prev];
128  }
129  catch (SquirrelError& e)
130  {
132  }
134 }
135 
136 //------------------------------------------------------------------------------
137 
139 {
140  try
141  {
142  wxString sig = _T("OnGetNextPage_") + m_PageName;
143  SqPlus::SquirrelFunction<wxString&> cb(cbU2C(sig));
144  if (cb.func.IsNull())
146  wxString next = cb();
147  if (next.IsEmpty())
148  return 0;
149  return s_PagesByName[next];
150  }
151  catch (SquirrelError& e)
152  {
154  }
156 }
157 
159 {
160  Manager::Get()->GetConfigManager(_T("scripts"))->Write(_T("/generic_wizard/") + m_PageName + _T("/skip"), (bool)m_SkipPage);
161 
162  try
163  {
164  wxString sig = _T("OnLeave_") + m_PageName;
165  SqPlus::SquirrelFunction<bool> cb(cbU2C(sig));
166  if (cb.func.IsNull())
167  return;
168  bool allow = cb(event.GetDirection() != 0); // !=0 forward, ==0 backward
169  if (!allow)
170  event.Veto();
171  }
172  catch (SquirrelError& e)
173  {
175  }
176 }
177 
178 //------------------------------------------------------------------------------
180 {
181  try
182  {
183  wxString sig = _T("OnEnter_") + m_PageName;
184  SqPlus::SquirrelFunction<void> cb(cbU2C(sig));
185  if (cb.func.IsNull())
186  return;
187  cb(event.GetDirection() != 0); // !=0 forward, ==0 backward
188  }
189  catch (SquirrelError& e)
190  {
192  }
193 }
194 
196 // WizPage
198 
199 BEGIN_EVENT_TABLE(WizPage, WizPageBase)
200  EVT_CHOICE(-1, WizPage::OnButton)
201  EVT_COMBOBOX(-1, WizPage::OnButton)
202  EVT_CHECKBOX(-1, WizPage::OnButton)
203  EVT_LISTBOX(-1, WizPage::OnButton)
204  EVT_RADIOBOX(-1, WizPage::OnButton)
205  EVT_BUTTON(-1, WizPage::OnButton)
206 END_EVENT_TABLE()
207 
208 WizPage::WizPage(const wxString& panelName, wxWizard* parent, const wxBitmap& bitmap)
209  : WizPageBase(panelName, parent, bitmap)
210 {
211  wxXmlResource::Get()->LoadPanel(this, panelName);
212 }
213 
214 //------------------------------------------------------------------------------
216 {
217 }
218 
219 //------------------------------------------------------------------------------
221 {
222  wxWindow* win = FindWindowById(event.GetId(), this);
223  if (!win)
224  {
225  Manager::Get()->GetLogManager()->DebugLog(F(_T("Can't locate window with id %d"), event.GetId()));
226  return;
227  }
228  try
229  {
230  wxString sig = _T("OnClick_") + win->GetName();
231  SqPlus::SquirrelFunction<void> cb(cbU2C(sig));
232  if (cb.func.IsNull())
233  return;
234  cb();
235  }
236  catch (SquirrelError& e)
237  {
239  }
240 }
241 
243 // WizInfoPanel
245 
246 WizInfoPanel::WizInfoPanel(const wxString& pageId, const wxString& intro_msg, wxWizard* parent, const wxBitmap& bitmap)
247  : WizPageBase(pageId, parent, bitmap)
248 {
249  m_InfoPanel = new InfoPanel(this);
250  m_InfoPanel->SetIntroText(intro_msg);
251 }
252 
253 //------------------------------------------------------------------------------
255 {
256 }
257 
259 {
260  if (!GetSkipPage() && event.GetDirection() != 0) // !=0 forward, ==0 backward
261  {
263  }
264 
266 }
267 
269 // WizFilePathPanel
271 
272 WizFilePathPanel::WizFilePathPanel(bool showHeaderGuard, wxWizard* parent, const wxBitmap& bitmap)
273  : WizPageBase(_T("FilePathPage"), parent, bitmap),
274  m_AddToProject(false)
275 {
276  ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("scripts"));
277  m_pFilePathPanel = new FilePathPanel(this);
278 
279  m_pFilePathPanel->ShowHeaderGuard(showHeaderGuard);
280  m_pFilePathPanel->SetAddToProject(cfg->ReadBool(_T("/generic_wizard/add_file_to_project"), true));
281 }
282 
283 //------------------------------------------------------------------------------
285 {
286 }
287 
289 {
290  if (m_pFilePathPanel)
291  {
293  }
294  return -1;
295 }
296 
298 {
300 }
301 
303 {
304  if (event.GetDirection() != 0) // !=0 forward, ==0 backward
305  {
309 
311  {
312  cbMessageBox(_("Please select a filename with full path for your new file..."), _("Error"), wxICON_ERROR, GetParent());
313  event.Veto();
314  return;
315  }
316 
317  ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("scripts"));
318  cfg->Write(_T("/generic_wizard/add_file_to_project"), (bool)m_pFilePathPanel->GetAddToProject());
319  }
320  WizPageBase::OnPageChanging(event); // let the base class handle it too
321 }
322 
324 // WizProjectPathPanel
326 
327 BEGIN_EVENT_TABLE(WizProjectPathPanel, WizPageBase)
328  EVT_BUTTON(-1, WizProjectPathPanel::OnButton)
329 END_EVENT_TABLE()
330 
332  : WizPageBase(_T("ProjectPathPage"), parent, bitmap)
333 {
334  m_pProjectPathPanel = new ProjectPathPanel(this);
335 }
336 
337 //------------------------------------------------------------------------------
339 {
340 }
341 
342 //------------------------------------------------------------------------------
344 {
345  return AppendPathSepIfNeeded(m_pProjectPathPanel->GetPath());
346 }
347 
348 //------------------------------------------------------------------------------
350 {
351  return m_pProjectPathPanel->GetName();
352 }
353 
354 //------------------------------------------------------------------------------
356 {
357  return m_pProjectPathPanel->GetFullFileName();
358 }
359 
360 //------------------------------------------------------------------------------
362 {
363  return m_pProjectPathPanel->GetTitle();
364 }
365 
366 //------------------------------------------------------------------------------
368 {
369  wxString dir = m_pProjectPathPanel->GetPath();
370  dir = ChooseDirectory(0, _("Please select the folder to create your project in"), dir, wxEmptyString, false, true);
371  if (!dir.IsEmpty() && wxDirExists(dir))
372  m_pProjectPathPanel->SetPath(dir);
373 }
374 
375 //------------------------------------------------------------------------------
377 {
378  if (event.GetDirection() != 0) // !=0 forward, ==0 backward
379  {
380  wxString dir = m_pProjectPathPanel->GetPath();
381  wxString name = m_pProjectPathPanel->GetName();
382  wxString fullname = m_pProjectPathPanel->GetFullFileName();
383  wxString title = m_pProjectPathPanel->GetTitle();
384 // if (!wxDirExists(dir))
385 // {
386 // cbMessageBox(_("Please select a valid path to create your project..."), _("Error"), wxICON_ERROR, GetParent());
387 // event.Veto();
388 // return;
389 // }
390  if (title.IsEmpty())
391  {
392  cbMessageBox(_("Please select a title for your project..."), _("Error"), wxICON_ERROR, GetParent());
393  event.Veto();
394  return;
395  }
396  if (name.IsEmpty())
397  {
398  cbMessageBox(_("Please select a name for your project..."), _("Error"), wxICON_ERROR, GetParent());
399  event.Veto();
400  return;
401  }
402  if (wxFileExists(fullname))
403  {
404  if (cbMessageBox(_("A project with the same name already exists in the project folder.\n"
405  "Are you sure you want to use this directory (files may be OVERWRITTEN)?"),
406  _("Confirmation"),
407  wxICON_QUESTION | wxYES_NO, GetParent()) != wxID_YES)
408  {
409 // cbMessageBox(_("A project with the same name already exists in the project folder.\n"
410 // "Please select a different project name..."), _("Warning"), wxICON_WARNING, GetParent());
411  event.Veto();
412  return;
413  }
414  }
416  }
417  WizPageBase::OnPageChanging(event); // let the base class handle it too
418 }
419 
420 //------------------------------------------------------------------------------
422 {
423  if (event.GetDirection() != 0) // !=0 forward, ==0 backward
424  {
426  m_pProjectPathPanel->SetPath(dir);
427  }
428  WizPageBase::OnPageChanged(event); // let the base class handle it too
429 }
430 
432 // WizGenericSelectPathPanel
434 
435 BEGIN_EVENT_TABLE(WizGenericSelectPathPanel, WizPageBase)
437 END_EVENT_TABLE()
438 
439 WizGenericSelectPathPanel::WizGenericSelectPathPanel(const wxString& pageId, const wxString& descr, const wxString& label, const wxString& defValue,
440  wxWizard* parent, const wxBitmap& bitmap)
441  : WizPageBase(pageId, parent, bitmap)
442 {
443  wxString savedValue = Manager::Get()->GetConfigManager(_T("project_wizard"))->Read(_T("/generic_paths/") + pageId);
444  if (savedValue.IsEmpty())
445  savedValue = defValue;
446 
447  m_pGenericSelectPath = new GenericSelectPath(this);
448  m_pGenericSelectPath->txtFolder->SetValue(savedValue);
449  m_pGenericSelectPath->SetDescription(descr);
450  m_pGenericSelectPath->lblLabel->SetLabel(label);
451 }
452 
453 //------------------------------------------------------------------------------
455 {
456 }
457 
458 //------------------------------------------------------------------------------
460 {
461  wxString dir = Manager::Get()->GetMacrosManager()->ReplaceMacros(m_pGenericSelectPath->txtFolder->GetValue());
462  dir = ChooseDirectory(this, _("Please select location"), dir, wxEmptyString, false, true);
463  if (!dir.IsEmpty() && wxDirExists(dir))
464  m_pGenericSelectPath->txtFolder->SetValue(dir);
465 }
466 
467 //------------------------------------------------------------------------------
469 {
470  if (event.GetDirection() != 0) // !=0 forward, ==0 backward
471  {
472  wxString dir = Manager::Get()->GetMacrosManager()->ReplaceMacros(m_pGenericSelectPath->txtFolder->GetValue());
473  if (!wxDirExists(dir))
474  {
475  cbMessageBox(_("Please select a valid location..."), _("Error"), wxICON_ERROR, GetParent());
476  event.Veto();
477  return;
478  }
479  }
480  WizPageBase::OnPageChanging(event); // let the base class handle it too
481 
482  if (event.GetDirection() != 0 && event.IsAllowed())
483  {
484  Manager::Get()->GetConfigManager(_T("project_wizard"))->Write(_T("/generic_paths/") + GetPageName(), m_pGenericSelectPath->txtFolder->GetValue());
485  }
486 }
487 
489 // WizCompilerPanel
491 
492 WizCompilerPanel::WizCompilerPanel(const wxString& compilerID, const wxString& validCompilerIDs, wxWizard* parent, const wxBitmap& bitmap,
493  bool allowCompilerChange, bool allowConfigChange)
494  : WizPageBase(_T("CompilerPage"), parent, bitmap),
495  m_AllowConfigChange(allowConfigChange)
496 {
497  m_pCompilerPanel = new CompilerPanel(this, GetParent());
498 
500  FillCompilerControl(cmb, compilerID, validCompilerIDs);
501  cmb->Enable(allowCompilerChange);
502 
504 
505  ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("scripts"));
506 
507  m_pCompilerPanel->SetWantDebug(cfg->ReadBool(_T("/generic_wizard/want_debug"), true));
508  m_pCompilerPanel->SetDebugName(cfg->Read(_T("/generic_wizard/debug_name"), _T("Debug")));
509  m_pCompilerPanel->SetDebugOutputDir(cfg->Read(_T("/generic_wizard/debug_output"), _T("bin") + wxString(wxFILE_SEP_PATH) + _T("Debug")));
510  m_pCompilerPanel->SetDebugObjectOutputDir(cfg->Read(_T("/generic_wizard/debug_objects_output"), _T("obj") + wxString(wxFILE_SEP_PATH) + _T("Debug")));
511 
512  m_pCompilerPanel->SetWantRelease(cfg->ReadBool(_T("/generic_wizard/want_release"), true));
513  m_pCompilerPanel->SetReleaseName(cfg->Read(_T("/generic_wizard/release_name"), _T("Release")));
514  m_pCompilerPanel->SetReleaseOutputDir(cfg->Read(_T("/generic_wizard/release_output"), _T("bin") + wxString(wxFILE_SEP_PATH) + _T("Release")));
515  m_pCompilerPanel->SetReleaseObjectOutputDir(cfg->Read(_T("/generic_wizard/release_objects_output"), _T("obj") + wxString(wxFILE_SEP_PATH) + _T("Release")));
516 }
517 
518 //------------------------------------------------------------------------------
520 {
521 }
522 
523 //------------------------------------------------------------------------------
525 {
527  if (compiler)
528  return compiler->GetID();
529  return wxEmptyString;
530 }
531 
532 //------------------------------------------------------------------------------
534 {
535  return m_pCompilerPanel->GetWantDebug();
536 }
537 
538 //------------------------------------------------------------------------------
540 {
541  return m_pCompilerPanel->GetDebugName();
542 }
543 
544 //------------------------------------------------------------------------------
546 {
548 }
549 
550 //------------------------------------------------------------------------------
552 {
554 }
555 
556 //------------------------------------------------------------------------------
558 {
560 }
561 
562 //------------------------------------------------------------------------------
564 {
566 }
567 
568 //------------------------------------------------------------------------------
570 {
572 }
573 
574 //------------------------------------------------------------------------------
576 {
578 }
579 
580 //------------------------------------------------------------------------------
582 {
583  if (event.GetDirection() != 0) // !=0 forward, ==0 backward
584  {
585  if (GetCompilerID().IsEmpty())
586  {
587  cbMessageBox(_("You must select a compiler for your project..."), _("Error"), wxICON_ERROR, GetParent());
588  event.Veto();
589  return;
590  }
592  {
593  cbMessageBox(_("You must select at least one configuration..."), _("Error"), wxICON_ERROR, GetParent());
594  event.Veto();
595  return;
596  }
597 
599  {
600  ConfigManager* cfg = Manager::Get()->GetConfigManager(_T("scripts"));
601 
602  cfg->Write(_T("/generic_wizard/want_debug"), (bool)GetWantDebug());
603  cfg->Write(_T("/generic_wizard/debug_name"), GetDebugName());
604  cfg->Write(_T("/generic_wizard/debug_output"), GetDebugOutputDir());
605  cfg->Write(_T("/generic_wizard/debug_objects_output"), GetDebugObjectOutputDir());
606 
607  cfg->Write(_T("/generic_wizard/want_release"), (bool)GetWantRelease());
608  cfg->Write(_T("/generic_wizard/release_name"), GetReleaseName());
609  cfg->Write(_T("/generic_wizard/release_output"), GetReleaseOutputDir());
610  cfg->Write(_T("/generic_wizard/release_objects_output"), GetReleaseObjectOutputDir());
611  }
612  }
613  WizPageBase::OnPageChanging(event); // let the base class handle it too
614 }
615 
617 // WizBuildTargetPanel
619 
620 WizBuildTargetPanel::WizBuildTargetPanel(const wxString& targetName, bool isDebug,
621  wxWizard* parent, const wxBitmap& bitmap,
622  bool showCompiler,
623  const wxString& compilerID, const wxString& validCompilerIDs,
624  bool allowCompilerChange)
625  : WizPageBase(_T("BuildTargetPage"), parent, bitmap)
626 {
628  m_pBuildTargetPanel->SetTargetName(targetName);
630  m_pBuildTargetPanel->ShowCompiler(showCompiler);
631 
632  if (showCompiler)
633  {
635  FillCompilerControl(cmb, compilerID, validCompilerIDs);
636  cmb->Enable(allowCompilerChange);
637  }
638 }
639 
640 //------------------------------------------------------------------------------
642 {
643 }
644 
645 //------------------------------------------------------------------------------
647 {
648  if (!m_pBuildTargetPanel->GetCompilerCombo()->IsShown())
649  return wxEmptyString;
650 
652  if (compiler)
653  return compiler->GetID();
654  return wxEmptyString;
655 }
656 
657 //------------------------------------------------------------------------------
659 {
661 }
662 
663 //------------------------------------------------------------------------------
665 {
667 }
668 
669 //------------------------------------------------------------------------------
671 {
673 }
674 
675 //------------------------------------------------------------------------------
677 {
679 }
680 
681 //------------------------------------------------------------------------------
683 {
684  if (event.GetDirection() != 0) // !=0 forward, ==0 backward
685  {
687  {
688  cbMessageBox(_("You must select a compiler for your build target..."), _("Error"), wxICON_ERROR, GetParent());
689  event.Veto();
690  return;
691  }
692 
693  cbProject* theproject = Manager::Get()->GetProjectManager()->GetActiveProject(); // can't fail; if no project, the wizard didn't even run
695  {
696  cbMessageBox(_("A build target with that name already exists in the active project..."), _("Error"), wxICON_ERROR, GetParent());
697  event.Veto();
698  return;
699  }
700  }
701  WizPageBase::OnPageChanging(event); // let the base class handle it too
702 }
703 
705 // WizGenericSingleChoiceList
707 
708 WizGenericSingleChoiceList::WizGenericSingleChoiceList(const wxString& pageId, const wxString& descr, const wxArrayString& choices, int defChoice, wxWizard* parent, const wxBitmap& bitmap)
709  : WizPageBase(pageId, parent, bitmap)
710 {
711  int savedValue = Manager::Get()->GetConfigManager(_T("project_wizard"))->ReadInt(_T("/generic_single_choices/") + pageId, -1);
712  if (savedValue == -1)
713  savedValue = defChoice;
714 
717  m_pGenericSingleChoiceList->SetChoices(choices, savedValue);
718 }
719 
720 //------------------------------------------------------------------------------
722 {
723 }
724 
725 //------------------------------------------------------------------------------
727 {
729 }
730 
731 //------------------------------------------------------------------------------
733 {
735 }
736 
737 //------------------------------------------------------------------------------
739 {
740  WizPageBase::OnPageChanging(event); // let the base class handle it too
741 
742  // save selection value
743  if (event.GetDirection() != 0 && event.IsAllowed())
744  {
745  Manager::Get()->GetConfigManager(_T("project_wizard"))->Write(_T("/generic_single_choices/") + GetPageName(), (int)m_pGenericSingleChoiceList->GetChoice());
746  }
747 }
wxString F(const wxChar *msg,...)
sprintf-like function
Definition: logmanager.h:20
void SetDefaultPath(const wxString &path)
Set the default path for new projects.
DLLIMPORT wxArrayString GetArrayFromString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool trimSpaces=true)
Definition: globals.cpp:134
void SetSkipPage(bool skip)
Definition: wizpage.h:48
wxString GetReleaseObjectOutputDir() const
Definition: compilerpanel.h:46
#define wxICON_QUESTION
bool m_AllowConfigChange
Definition: wizpage.h:154
void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:682
void SetChoice(int choice)
Definition: wizpage.cpp:732
virtual wxWizardPage * GetPrev() const=0
wxString GetTargetName() const
ConfigManager * GetConfigManager(const wxString &name_space) const
Definition: manager.cpp:474
int ReadInt(const wxString &name, int defaultVal=0)
void SetFilePathSelectionFilter(const wxString &filter)
Definition: wizpage.cpp:297
bool GetSkipPage() const
Definition: wizpage.h:47
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
Definition: manager.cpp:182
virtual void OnPageChanged(wxWizardEvent &event)
Definition: wizpage.cpp:421
bool GetDirection() const
void SetReleaseObjectOutputDir(const wxString &dir)
Definition: compilerpanel.h:45
wxString GetPageName() const
Definition: wizpage.h:46
void SetIntroText(const wxString &intro_msg)
Definition: infopanel.h:31
wxString GetTargetName() const
Definition: wizpage.cpp:664
#define wxICON_ERROR
bool wxFileExists(const wxString &filename)
void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:302
wxString GetPath() const
Definition: wizpage.cpp:343
wxString GetReleaseObjectOutputDir() const
Definition: wizpage.cpp:575
wxString GetCompilerID() const
Definition: wizpage.cpp:646
bool ReadBool(const wxString &name, bool defaultVal=false)
DLLIMPORT wxString ChooseDirectory(wxWindow *parent, const wxString &message=_("Select directory"), const wxString &initialPath=_T(""), const wxString &basePath=_T(""), bool askToMakeRelative=false, bool showCreateDirButton=false)
Definition: globals.cpp:639
std::map< wxString, WizPageBase * > PagesByName
Definition: wizpage.h:24
bool m_AddToProject
Definition: wizpage.h:96
wxCheckBox * chkSkip
Definition: infopanel.h:44
wxString GetDefaultPath()
Retrieve the default path for new projects.
void OnButton(wxCommandEvent &event)
Definition: wizpage.cpp:220
bool wxDirExists(const wxString &dirname)
static Compiler * GetCompiler(size_t index)
bool GetWantRelease() const
Definition: wizpage.cpp:557
#define _T(string)
static const wxString & GetDefaultCompilerID()
#define wxYES_NO
void SetDebugName(const wxString &name)
Definition: compilerpanel.h:32
void SetFilePathSelectionFilter(const wxString &filter)
Definition: filepathpanel.h:34
void OnButton(wxCommandEvent &event)
Definition: wizpage.cpp:459
wxString GetTargetOutputDir() const
Definition: wizpage.cpp:670
wxString GetReleaseOutputDir() const
Definition: compilerpanel.h:44
void SetReleaseOutputDir(const wxString &dir)
Definition: compilerpanel.h:43
InfoPanel * m_InfoPanel
Definition: wizpage.h:76
CompilerPanel * m_pCompilerPanel
Definition: wizpage.h:153
wxString GetReleaseOutputDir() const
Definition: wizpage.cpp:569
virtual wxWizardPage * GetNext() const
Definition: wizpage.cpp:138
bool GetWantDebug() const
Definition: wizpage.cpp:533
wxPanel * LoadPanel(wxWindow *parent, const wxString &name)
DLLIMPORT const wxWX2MBbuf cbU2C(const wxString &str)
Return multibyte (C string) representation of the string.
Definition: globals.cpp:743
wxComboBox * GetCompilerCombo()
wxString GetDebugName() const
Definition: wizpage.cpp:539
ProjectManager * GetProjectManager() const
Functions returning pointers to the respective sub-manager instances.
Definition: manager.cpp:429
const wxString & GetID() const
Get this compiler&#39;s unique ID.
Definition: compiler.h:351
WizCompilerPanel(const wxString &compilerID, const wxString &validCompilerIDs, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap, bool allowCompilerChange=true, bool allowConfigChange=true)
Definition: wizpage.cpp:492
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:581
Represents a Code::Blocks project.
Definition: cbproject.h:96
void ShowCompiler(bool show)
wxString GetFilename() const
Definition: filepathpanel.h:29
wxString GetDebugName() const
Definition: compilerpanel.h:33
bool GetEnableDebug() const
Definition: wizpage.cpp:658
FilePathPanel * m_pFilePathPanel
Definition: wizpage.h:93
virtual void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:258
wxString GetObjectOutputDir() const
BuildTargetPanel * m_pBuildTargetPanel
Definition: wizpage.h:175
wxString wxPathOnly(const wxString &path)
wxString GetName() const
Definition: wizpage.cpp:349
bool IsSameAs(const wxString &s, bool caseSensitive=true) const
void SetTargetName(const wxString &name)
WizFilePathPanel(bool showHeaderGuard, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap)
Definition: wizpage.cpp:272
LogManager * GetLogManager() const
Definition: manager.cpp:439
wxComboBox * GetCompilerCombo()
Definition: compilerpanel.h:27
cbProject * GetActiveProject()
Retrieve the active project.
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
bool GetAddToProject() const
Definition: filepathpanel.h:31
void DisplayErrors(SquirrelError *exception=nullptr, bool clearErrors=true)
Display error dialog.
void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:738
void EnableConfigurationTargets(bool en)
wxString wxEmptyString
void SetWantRelease(bool want)
Definition: compilerpanel.h:39
MacrosManager * GetMacrosManager() const
Definition: manager.cpp:454
const wxString & _(const wxString &string)
void ShowHeaderGuard(bool show)
Definition: filepathpanel.h:35
void ReplaceMacros(wxString &buffer, ProjectBuildTarget *target=nullptr, bool subrequest=false)
#define cbThrow(message)
Definition: cbexception.h:42
static bool CompilerInheritsFrom(const wxString &id, const wxString &from_id)
void FillCompilerControl(wxItemContainer *control, const wxString &compilerID, const wxString &validCompilerIDs)
Definition: wizpage.cpp:38
ProjectBuildTarget * GetBuildTarget(int index)
Access a build target.
Definition: cbproject.cpp:1392
void SetReleaseName(const wxString &name)
Definition: compilerpanel.h:41
bool GetEnableDebug() const
Abstract base class for compilers.
Definition: compiler.h:274
wxString GetReleaseName() const
Definition: compilerpanel.h:42
void SetWantDebug(bool want)
Definition: compilerpanel.h:30
bool IsEmpty() const
~WizPage()
Definition: wizpage.cpp:215
void SetChoices(const wxArrayString &choices, int defChoice)
void SetAddToProject(bool add)
wxString GetTargetObjectOutputDir() const
Definition: wizpage.cpp:676
virtual const wxString & GetName() const
Get the compiler&#39;s name.
Definition: compiler.h:293
void DebugLog(const wxString &msg, Logger::level lv=Logger::info)
Definition: logmanager.h:146
void OnButton(wxCommandEvent &event)
Definition: wizpage.cpp:367
virtual void OnPageChanged(wxWizardEvent &event)
Definition: wizpage.cpp:179
wxString GetHeaderGuard() const
Definition: filepathpanel.h:30
static size_t GetCompilersCount()
wxString GetDebugObjectOutputDir() const
Definition: compilerpanel.h:37
size_t GetCount() const
virtual void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:468
static wxXmlResource * Get()
virtual wxWizardPage * GetPrev() const
Definition: wizpage.cpp:116
wxString GetOutputDir() const
wxUniChar Last() const
static Compiler * GetCompilerByName(const wxString &title)
void SetDescription(const wxString &descr)
void SetDebugOutputDir(const wxString &dir)
Definition: compilerpanel.h:34
bool GetWantDebug() const
Definition: compilerpanel.h:31
virtual void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:376
wxString m_HeaderGuard
Definition: wizpage.h:95
wxString GetCompilerID() const
Definition: wizpage.cpp:524
ScriptingManager * GetScriptingManager() const
Definition: manager.cpp:469
wxString GetDebugOutputDir() const
Definition: compilerpanel.h:35
virtual bool GetValue() const
wxString AppendPathSepIfNeeded(const wxString &path)
Definition: wizpage.cpp:73
wxString GetFullFileName() const
Definition: wizpage.cpp:355
wxString m_Filename
Definition: wizpage.h:94
wxString GetDebugObjectOutputDir() const
Definition: wizpage.cpp:551
virtual wxWizardPage * GetNext() const=0
void SetEnableDebug(bool debug)
static PagesByName s_PagesByName
Definition: wizpage.h:51
GenericSingleChoiceList * m_pGenericSingleChoiceList
Definition: wizpage.h:189
WizGenericSingleChoiceList(const wxString &pageId, const wxString &descr, const wxArrayString &choices, int defChoice, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap)
Definition: wizpage.cpp:708
WizInfoPanel(const wxString &pageId, const wxString &intro_msg, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap)
Definition: wizpage.cpp:246
wxString GetReleaseName() const
Definition: wizpage.cpp:563
void SetDebugObjectOutputDir(const wxString &dir)
Definition: compilerpanel.h:36
WizBuildTargetPanel(const wxString &targetName, bool isDebug, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap, bool showCompiler=false, const wxString &compilerID=wxEmptyString, const wxString &validCompilerIDs=_T("*"), bool allowCompilerChange=true)
Definition: wizpage.cpp:620
wxString GetTitle() const
Definition: wizpage.cpp:361
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
Definition: globals.cpp:1395
int GetTargetIndex() const
Definition: wizpage.cpp:288
wxString GetDebugOutputDir() const
Definition: wizpage.cpp:545
bool GetWantRelease() const
Definition: compilerpanel.h:40
virtual void OnPageChanging(wxWizardEvent &event)
Definition: wizpage.cpp:158