51 for (
size_t n = 0; n < valids.
GetCount(); ++n)
56 control->Append(compiler->
GetName());
58 id = control->GetCount() < 1 ? 0 : (control->GetCount() - 1);
64 control->SetSelection(
id);
77 return path + wxFILE_SEP_PATH;
97 if (s_PagesByName[m_PageName])
98 cbThrow(
_T(
"Page ID in use:") + pageName);
101 s_PagesByName[m_PageName] =
this;
111 s_PagesByName[m_PageName] = 0;
120 wxString sig =
_T(
"OnGetPrevPage_") + m_PageName;
121 SqPlus::SquirrelFunction<wxString&> cb(
cbU2C(sig));
122 if (cb.func.IsNull())
127 return s_PagesByName[prev];
129 catch (SquirrelError& e)
142 wxString sig =
_T(
"OnGetNextPage_") + m_PageName;
143 SqPlus::SquirrelFunction<wxString&> cb(
cbU2C(sig));
144 if (cb.func.IsNull())
149 return s_PagesByName[next];
151 catch (SquirrelError& e)
165 SqPlus::SquirrelFunction<bool> cb(
cbU2C(sig));
166 if (cb.func.IsNull())
172 catch (SquirrelError& e)
184 SqPlus::SquirrelFunction<void> cb(
cbU2C(sig));
185 if (cb.func.IsNull())
189 catch (SquirrelError& e)
222 wxWindow* win = FindWindowById(event.GetId(),
this);
230 wxString sig =
_T(
"OnClick_") + win->GetName();
231 SqPlus::SquirrelFunction<void> cb(
cbU2C(sig));
232 if (cb.func.IsNull())
236 catch (SquirrelError& e)
274 m_AddToProject(false)
332 :
WizPageBase(_T("ProjectPathPage"), parent, bitmap)
351 return m_pProjectPathPanel->GetName();
357 return m_pProjectPathPanel->GetFullFileName();
363 return m_pProjectPathPanel->GetTitle();
369 wxString dir = m_pProjectPathPanel->GetPath();
372 m_pProjectPathPanel->SetPath(dir);
380 wxString dir = m_pProjectPathPanel->GetPath();
381 wxString name = m_pProjectPathPanel->GetName();
382 wxString fullname = m_pProjectPathPanel->GetFullFileName();
383 wxString title = m_pProjectPathPanel->GetTitle();
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)?"),
426 m_pProjectPathPanel->SetPath(dir);
445 savedValue = defValue;
448 m_pGenericSelectPath->txtFolder->SetValue(savedValue);
449 m_pGenericSelectPath->SetDescription(descr);
450 m_pGenericSelectPath->lblLabel->SetLabel(label);
464 m_pGenericSelectPath->txtFolder->SetValue(dir);
493 bool allowCompilerChange,
bool allowConfigChange)
495 m_AllowConfigChange(allowConfigChange)
501 cmb->Enable(allowCompilerChange);
528 return compiler->
GetID();
624 bool allowCompilerChange)
636 cmb->Enable(allowCompilerChange);
653 return compiler->
GetID();
696 cbMessageBox(
_(
"A build target with that name already exists in the active project..."),
_(
"Error"),
wxICON_ERROR, GetParent());
712 if (savedValue == -1)
713 savedValue = defChoice;
wxString F(const wxChar *msg,...)
sprintf-like function
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)
void SetSkipPage(bool skip)
wxString GetReleaseObjectOutputDir() const
void OnPageChanging(wxWizardEvent &event)
void SetChoice(int choice)
virtual wxWizardPage * GetPrev() const=0
wxString GetTargetName() const
ConfigManager * GetConfigManager(const wxString &name_space) const
int ReadInt(const wxString &name, int defaultVal=0)
void SetFilePathSelectionFilter(const wxString &filter)
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
virtual void OnPageChanged(wxWizardEvent &event)
bool GetDirection() const
void SetReleaseObjectOutputDir(const wxString &dir)
wxString GetPageName() const
~WizGenericSelectPathPanel()
void SetIntroText(const wxString &intro_msg)
wxString GetTargetName() const
~WizGenericSingleChoiceList()
bool wxFileExists(const wxString &filename)
void OnPageChanging(wxWizardEvent &event)
wxString GetReleaseObjectOutputDir() const
wxString GetCompilerID() const
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)
std::map< wxString, WizPageBase * > PagesByName
wxString GetDefaultPath()
Retrieve the default path for new projects.
void OnButton(wxCommandEvent &event)
bool wxDirExists(const wxString &dirname)
static Compiler * GetCompiler(size_t index)
bool GetWantRelease() const
static const wxString & GetDefaultCompilerID()
void SetChoice(int choice)
void SetDebugName(const wxString &name)
void SetFilePathSelectionFilter(const wxString &filter)
wxString GetTargetOutputDir() const
wxString GetReleaseOutputDir() const
void SetReleaseOutputDir(const wxString &dir)
CompilerPanel * m_pCompilerPanel
wxString GetReleaseOutputDir() const
virtual wxWizardPage * GetNext() const
bool GetWantDebug() const
wxPanel * LoadPanel(wxWindow *parent, const wxString &name)
DLLIMPORT const wxWX2MBbuf cbU2C(const wxString &str)
Return multibyte (C string) representation of the string.
wxComboBox * GetCompilerCombo()
wxString GetDebugName() const
ProjectManager * GetProjectManager() const
Functions returning pointers to the respective sub-manager instances.
const wxString & GetID() const
Get this compiler's unique ID.
WizCompilerPanel(const wxString &compilerID, const wxString &validCompilerIDs, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap, bool allowCompilerChange=true, bool allowConfigChange=true)
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
void OnPageChanging(wxWizardEvent &event)
Represents a Code::Blocks project.
void ShowCompiler(bool show)
wxString GetFilename() const
wxString GetDebugName() const
bool GetEnableDebug() const
FilePathPanel * m_pFilePathPanel
virtual void OnPageChanging(wxWizardEvent &event)
wxString GetObjectOutputDir() const
BuildTargetPanel * m_pBuildTargetPanel
wxString wxPathOnly(const wxString &path)
bool IsSameAs(const wxString &s, bool caseSensitive=true) const
void SetTargetName(const wxString &name)
WizFilePathPanel(bool showHeaderGuard, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap)
LogManager * GetLogManager() const
wxComboBox * GetCompilerCombo()
cbProject * GetActiveProject()
Retrieve the active project.
wxString Read(const wxString &key, const wxString &defaultVal=wxEmptyString)
bool GetAddToProject() const
void DisplayErrors(SquirrelError *exception=nullptr, bool clearErrors=true)
Display error dialog.
void OnPageChanging(wxWizardEvent &event)
void EnableConfigurationTargets(bool en)
void SetWantRelease(bool want)
MacrosManager * GetMacrosManager() const
const wxString & _(const wxString &string)
void ReplaceMacros(wxString &buffer, ProjectBuildTarget *target=nullptr, bool subrequest=false)
static bool CompilerInheritsFrom(const wxString &id, const wxString &from_id)
void FillCompilerControl(wxItemContainer *control, const wxString &compilerID, const wxString &validCompilerIDs)
ProjectBuildTarget * GetBuildTarget(int index)
Access a build target.
void SetReleaseName(const wxString &name)
bool GetEnableDebug() const
Abstract base class for compilers.
wxString GetReleaseName() const
void SetWantDebug(bool want)
void SetChoices(const wxArrayString &choices, int defChoice)
void SetAddToProject(bool add)
wxString GetTargetObjectOutputDir() const
virtual const wxString & GetName() const
Get the compiler's name.
void DebugLog(const wxString &msg, Logger::level lv=Logger::info)
virtual void OnPageChanged(wxWizardEvent &event)
static size_t GetCompilersCount()
wxString GetDebugObjectOutputDir() const
virtual void OnPageChanging(wxWizardEvent &event)
static wxXmlResource * Get()
virtual wxWizardPage * GetPrev() const
wxString GetOutputDir() const
static Compiler * GetCompilerByName(const wxString &title)
void SetDescription(const wxString &descr)
void SetDebugOutputDir(const wxString &dir)
bool GetWantDebug() const
virtual void OnPageChanging(wxWizardEvent &event)
wxString GetCompilerID() const
ScriptingManager * GetScriptingManager() const
wxString GetDebugOutputDir() const
virtual bool GetValue() const
wxString AppendPathSepIfNeeded(const wxString &path)
wxString GetFullFileName() const
wxString GetDebugObjectOutputDir() const
virtual wxWizardPage * GetNext() const=0
void SetEnableDebug(bool debug)
static PagesByName s_PagesByName
GenericSingleChoiceList * m_pGenericSingleChoiceList
WizGenericSingleChoiceList(const wxString &pageId, const wxString &descr, const wxArrayString &choices, int defChoice, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap)
WizInfoPanel(const wxString &pageId, const wxString &intro_msg, wxWizard *parent, const wxBitmap &bitmap=wxNullBitmap)
wxString GetReleaseName() const
void SetDebugObjectOutputDir(const wxString &dir)
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)
wxString GetTitle() const
DLLIMPORT int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
wxMessageBox wrapper.
int GetTargetIndex() const
wxString GetDebugOutputDir() const
bool GetWantRelease() const
virtual void OnPageChanging(wxWizardEvent &event)