226 m_Compiler(compiler),
227 m_CurrentCompilerIdx(0),
231 m_BuildingTree(false)
247 if (!hasBuildScripts)
259 XRCCTRL(*
this,
"lblBuildScriptsNote",
wxStaticText)->Show(hasBuildScripts);
263 wxSizer* sizer = tree->GetContainingSizer();
268 SetLabel(
_(
"Compiler Settings"));
269 sizer->Show(tree,
false);
283 wxSizer* sizer2 = win->GetContainingSizer();
290 XRCCTRL(*
this,
"txtMakeCmd_Build",
wxTextCtrl)->Enable(en);
291 XRCCTRL(*
this,
"txtMakeCmd_Compile",
wxTextCtrl)->Enable(en);
292 XRCCTRL(*
this,
"txtMakeCmd_Clean",
wxTextCtrl)->Enable(en);
293 XRCCTRL(*
this,
"txtMakeCmd_DistClean",
wxTextCtrl)->Enable(en);
294 XRCCTRL(*
this,
"txtMakeCmd_AskRebuildNeeded",
wxTextCtrl)->Enable(en);
295 XRCCTRL(*
this,
"txtMakeCmd_SilentBuild",
wxTextCtrl)->Enable(en);
320 msg.
Printf(
_(
"The defined compiler cannot be located (ID: %s).\n" 321 "Please choose the compiler you want to use instead and click \"OK\".\n" 322 "If you click \"Cancel\", the project/target will remain configured for\n" 323 "that compiler and consequently can not be configured and will not be built."),
358 nb->GetPage(0)->Disable();
359 nb->GetPage(1)->Disable();
360 nb->GetPage(2)->Disable();
361 nb->GetPage(5)->Disable();
368 GetSizer()->Layout();
369 GetSizer()->SetSizeHints(
this);
372 int min_width, min_height;
373 GetSize(&min_width, &min_height);
374 this->SetSizeHints(min_width+140,min_height,-1,-1);
376 this->SetSize(-1, -1, 0, 0);
384 XRCCTRL(*
this,
"tabCompiler",
wxPanel)->Show(
false);
385 XRCCTRL(*
this,
"tabLinker",
wxPanel)->Show(
false);
386 XRCCTRL(*
this,
"tabDirs",
wxPanel)->Show(
false);
415 if (compilerIdx != -1)
448 for (
int i = 0; i < count; ++i)
450 if (!array[i].IsEmpty())
451 control->Append(array[i]);
458 int count = control->GetCount();
459 for (
int i = 0; i < count; ++i)
461 wxString tmp = control->GetString(i);
478 XRCCTRL(*
this,
"txtCcompiler",
wxTextCtrl)->SetValue(progs.
C);
479 XRCCTRL(*
this,
"txtCPPcompiler",
wxTextCtrl)->SetValue(progs.
CPP);
480 XRCCTRL(*
this,
"txtLinker",
wxTextCtrl)->SetValue(progs.
LD);
481 XRCCTRL(*
this,
"txtLibLinker",
wxTextCtrl)->SetValue(progs.
LIB);
485 cmbDebugger->Clear();
491 for (DebuggerManager::RegisteredPlugins::const_iterator it = plugins.begin(); it != plugins.end(); ++it)
494 for (DebuggerManager::ConfigurationVector::const_iterator itConf = data.
GetConfigurations().begin();
498 const wxString &def = it->first->GetSettingsName() +
wxT(
":") + (*itConf)->GetName();
499 int index = cmbDebugger->Append(it->first->GetGUIName() +
wxT(
" : ") + (*itConf)->GetName(),
520 const StringHash* vars = 0;
528 for (StringHash::const_iterator it = vars->begin(); it != vars->end(); ++it)
530 wxString text = it->first +
_T(
" = ") + it->second;
544 chk = XRCCTRL(*
this,
"chkIncludePrjCwd",
wxCheckBox);
548 chk = XRCCTRL(*
this,
"chkSkipIncludeDeps",
wxCheckBox);
552 chk = XRCCTRL(*
this,
"chkSaveHtmlLog",
wxCheckBox);
556 chk = XRCCTRL(*
this,
"chkFullHtmlLog",
wxCheckBox);
558 chk->
SetValue(
Manager::Get()->GetConfigManager(
_T(
"compiler"))->ReadBool(
_T(
"/save_html_build_log/full_command_line"),
false));
560 chk = XRCCTRL(*
this,
"chkBuildProgressBar",
wxCheckBox);
564 chk = XRCCTRL(*
this,
"chkBuildProgressPerc",
wxCheckBox);
572 spn = XRCCTRL(*
this,
"spnMaxErrors",
wxSpinCtrl);
579 chk = XRCCTRL(*
this,
"chkRebuildSeperately",
wxCheckBox);
591 chk = XRCCTRL(*
this,
"chkNonPlatComp",
wxCheckBox);
608 root = tc->
AddRoot(
_(
"Global options"), -1, -1);
624 selectedItem = targetItem;
629 if (selectedItem == root)
641 typedef std::map<wxString, wxPropertyCategory*> MapCategories;
642 MapCategories categories;
650 wxPropertyCategory *categoryProp =
new wxPropertyCategory(option->
category);
652 categories[option->
category] = categoryProp;
661 wxPropertyCategory *categoryProp =
nullptr;
662 MapCategories::iterator itCat = categories.find(option->
category);
663 if (itCat != categories.end())
664 categoryProp = itCat->second;
667 categoryProp =
new wxPropertyCategory(option->
category);
669 categories[option->
category] = categoryProp;
672 wxPGProperty *prop =
new wxBoolProperty(option->name, wxPG_LABEL, option->enabled);
681 for (
unsigned ii = 0; ii < count; ++ii)
697 copt->enabled =
false;
704 XRCCTRL(*
this,
"txtCompilerDefines",
wxTextCtrl)->Clear();
709 opt = opt.
Strip(wxString::both);
720 XRCCTRL(*
this,
"txtCompilerDefines",
wxTextCtrl)->AppendText(rest);
721 XRCCTRL(*
this,
"txtCompilerDefines",
wxTextCtrl)->AppendText(
_T(
"\n"));
731 opt = opt.
Strip(wxString::both);
743 XRCCTRL(*
this,
"lstLibs",
wxListBox)->Clear();
754 for (
int i = 0; i < count; ++i)
756 if (!array[i].IsEmpty())
758 control->AppendText(array[i]);
759 control->AppendText(
_T(
'\n'));
772 int nl = tmp.
Find(
_T(
'\n'));
781 while (nl != -1 || !line.
IsEmpty())
789 array.
Add(line.
Strip(wxString::both));
802 int count = control->GetNumberOfLines();
803 for (
int i = 0; i < count; ++i)
805 wxString tmp = control->GetLineText(i);
810 array.
Add(tmp.
Strip(wxString::both));
820 bool AlwaysUsePost =
false;
848 SetLabel(
_(
"Project build options"));
910 XRCCTRL(*
this,
"chkAlwaysRunPost",
wxCheckBox)->SetValue(AlwaysUsePost);
919 int compilerIdx = XRCCTRL(*
this,
"cmbCompiler",
wxChoice)->GetSelection();
922 for (
unsigned int i = 0; i < array.
GetCount(); ++i)
924 if (!array[i].IsEmpty())
965 if (!compilerOpConflicts.
IsEmpty() || !linkerOpConflicts.
IsEmpty())
967 wxString msg =
_(
"The compiler flags\n ")
971 msg +=
_(
"were stated in 'Other Options' but unchecked in 'Compiler Flags'.\n" 972 "Do you want to enable these flags?");
979 for (
size_t i = 0; i < compilerOpConflicts.
GetCount(); ++i)
981 for (
size_t i = 0; i < linkerOpConflicts.
GetCount(); ++i)
988 for (
size_t i = 0; i < lstLibs->GetCount(); ++i)
1033 bool AlwaysUsePost =
false;
1036 AlwaysUsePost = XRCCTRL(*
this,
"chkAlwaysRunPost",
wxCheckBox)->GetValue();
1100 progs.
C = (XRCCTRL(*
this,
"txtCcompiler",
wxTextCtrl)->GetValue()).Trim();
1101 progs.
CPP = (XRCCTRL(*
this,
"txtCPPcompiler",
wxTextCtrl)->GetValue()).Trim();
1102 progs.
LD = (XRCCTRL(*
this,
"txtLinker",
wxTextCtrl)->GetValue()).Trim();
1103 progs.
LIB = (XRCCTRL(*
this,
"txtLibLinker",
wxTextCtrl)->GetValue()).Trim();
1105 progs.
MAKE = (XRCCTRL(*
this,
"txtMake",
wxTextCtrl)->GetValue()).Trim();
1145 if (Action.
m_Key != NewKey)
1149 pBase->
SetVar(NewKey, NewValue);
1335 for (
int i = 0; i <
ctCount; ++i)
1340 op =
wxT(
"CompileObject");
1342 op =
wxT(
"GenDependencies");
1344 op =
wxT(
"CompileResource");
1346 op =
wxT(
"LinkExe");
1348 op =
wxT(
"LinkConsoleExe");
1350 op =
wxT(
"LinkDynamic");
1352 op =
wxT(
"LinkStatic");
1354 op =
wxT(
"LinkNative");
1355 for (
size_t j = 0; j < vec.size(); ++j)
1361 if (!vec[j].extensions.IsEmpty())
1363 if (!vec[j].generatedFiles.IsEmpty())
1369 for (
size_t i = 0; i < regexes.size(); ++i)
1378 tp =
wxT(
"warning");
1384 tp =
wxString::Format(
wxT(
"%d;%d;%d"), regexes[i].msg[0], regexes[i].msg[1], regexes[i].msg[2]);
1387 if (regexes[i].filename != 0)
1389 if (regexes[i].line != 0)
1391 tp = regexes[i].GetRegExString();
1436 cbMessageBox(
_(
"You changed the compiler used for this target.\n" 1437 "It is recommended that you fully rebuild this target, " 1438 "otherwise linking errors might occur..."),
1449 cbMessageBox(
_(
"You changed the compiler used for this project.\n" 1450 "It is recommended that you fully rebuild this project, " 1451 "otherwise linking errors might occur..."),
1469 XRCCTRL(*
this,
"cmbCompiler",
wxChoice)->GetSelection());
1477 if (compilerIdx != -1)
1480 XRCCTRL(*
this,
"cmbCompiler",
wxChoice)->SetSelection(compilerIdx);
1497 nb->GetPage(0)->Enable(!cmd);
1498 nb->GetPage(1)->Enable(!cmd);
1499 nb->GetPage(2)->Enable(!cmd);
1504 nb->GetPage(pageOffset + 2)->Enable(!cmd);
1528 msg.
Printf(
_(
"The defined compiler cannot be located (ID: %s).\n" 1529 "Please choose the compiler you want to use instead and click \"OK\".\n" 1530 "If you click \"Cancel\", the project/target will remain configured for that compiler and consequently can not be configured and will not be built."),
1541 XRCCTRL(*
this,
"cmbCompiler",
wxChoice)->SetSelection(NewCompilerIdx);
1567 _(
"You have changed some settings. Do you want these settings saved ?\n\n" 1568 "Yes : will apply the changes\n" 1569 "No : will undo the changes\n" 1570 "Cancel : will revert your selection in the project/target tree"),
1599 bool bChanged =
true;
1602 switch(
cbMessageBox(
_(
"You have changed some settings. Do you want these settings saved ?\n\n" 1603 "Yes : will apply the changes\n" 1604 "No : will undo the changes\n" 1605 "Cancel : will revert your compiler change."),
1606 _(
"Compiler change with changed settings"),
1653 int ret =
cbMessageBox(
_(
"You have changed the compiler used for the project.\n" 1654 "Do you want to use the same compiler for all the project's build targets too?"),
1694 msg.
Printf(
_(
"Could not auto-detect installation path of \"%s\"...\n" 1695 "Do you want to use this compiler's default installation directory?"),
1709 XRCCTRL(*
this,
"lstExtraPaths",
wxListBox)->Clear();
1723 return XRCCTRL(*
this,
"lstIncludeDirs",
wxListBox);
1725 return XRCCTRL(*
this,
"lstLibDirs",
wxListBox);
1727 return XRCCTRL(*
this,
"lstResDirs",
wxListBox);
1751 if (!property->IsKindOf(CLASSINFO(wxBoolProperty)))
1755 if (value.
IsNull() || !option)
1763 for (
size_t i = 0; i < check.Count(); ++i)
1768 if (against && against->
enabled)
1771 wxT(
"\"") + option->
name +
_(
"\" conflicts with \"") + against->
name +
wxT(
"\".") :
1785 for (
size_t i = 0; i < supersede.Count(); ++i)
1837 _(
"Add directory"));
1840 if (dlg.ShowModal() ==
wxID_OK)
1847 control->Append(path);
1857 if (!control || control->GetSelections(selections) < 1)
1860 if (selections.GetCount()>1)
1862 cbMessageBox(
_(
"Please select only one directory you would like to edit."),
1868 control->GetString(selections[0]),
1870 _(
"Edit directory"));
1873 if (dlg.ShowModal() ==
wxID_OK)
1876 control->SetString(selections[0], path);
1885 if (!control || control->GetSelections(selections) < 1)
1888 if (
cbMessageBox(
_(
"Remove selected folders from the list?"),
1892 std::sort(selections.begin(), selections.end());
1893 for (
unsigned int i=selections.GetCount(); i>0; --i)
1894 control->Delete(selections[i-1]);
1902 if (!control || control->GetCount() == 0)
1905 if (
cbMessageBox(
_(
"Remove all directories from the list?"),
1921 if (!control || control->GetSelections(selections) < 1)
1933 _(
"Copy directories"), choices,
this);
1940 for (wxArrayInt::const_iterator itr = sel.begin(); itr != sel.end(); ++itr)
1954 for (
size_t i = 0; i < selections.GetCount(); ++i)
1956 switch (notebookPage)
1962 base->
AddLibDir(control->GetString(selections[i]));
1979 _(
"The value contains spaces or strange characters. Do you want to quote it?"),
1981 _(
"&Quote"),
_(
"&Leave unquoted"));
2008 int sel = list->GetSelection();
2024 if (value != data->
value || key != data->
key)
2028 list->SetString(sel, key +
_T(
" = ") + value);
2030 data->
value = value;
2039 int sel = list->GetSelection();
2046 if (
cbMessageBox(
_(
"Are you sure you want to delete this variable?"),
2060 if (lstVars->IsEmpty())
2063 if (
cbMessageBox(
_(
"Are you sure you want to clear all variables?"),
2068 for (
size_t i=0; i < lstVars->GetCount(); ++i)
2089 #if wxCHECK_VERSION(3, 0, 0) 2090 msg.
Printf(
_(
"%s is now selected as the default compiler for new projects"), compiler ? compiler->
GetName().
wx_str() :
_(
"[invalid]").
wx_str());
2092 msg.
Printf(
_(
"%s is now selected as the default compiler for new projects"), compiler ? compiler->
GetName().
c_str() :
_(
"[invalid]"));
2101 switch(
cbMessageBox(
_(
"You have changed some settings. Do you want these settings saved ?\n\n" 2102 "Yes : will apply the changes\n" 2103 "No : will undo the changes\n" 2104 "Cancel : will cancel your compiler addition."),
2105 _(
"Compiler change with changed settings"),
2122 cmb = XRCCTRL(*
this,
"cmbCompiler",
wxChoice);
2124 _(
"Add new compiler"),
2143 cbMessageBox(
_(
"The new compiler could not be created.\n(maybe a compiler with the same name already exists?)"),
2155 cbMessageBox(
_(
"The new compiler has been added! Don't forget to update the \"Toolchain executables\" page..."));
2181 if (
cbMessageBox(
_(
"Are you sure you want to remove this compiler?"),
2188 cmb->Delete(compilerIdx);
2189 while (compilerIdx >= (
int)(cmb->
GetCount()))
2199 if (
cbMessageBox(
_(
"Reset this compiler's settings to the defaults?"),
2202 if (
cbMessageBox(
_(
"Reset this compiler's settings to the defaults?\n" 2203 "\nAre you REALLY sure?"),
2235 _(
"Choose library to link"),
2238 _(
"Library files (*.a, *.so, *.lib, *.dylib, *.bundle)|*.a;*.so;*.lib;*.dylib;*.bundle|All files (*)|*"));
2241 if (dlg.ShowModal() ==
wxID_OK)
2244 for (
size_t i = 0; i < paths.
GetCount(); ++i)
2245 lstLibs->Append(paths[i]);
2257 int num = lstLibs->GetSelections(sels);
2260 cbMessageBox(
_(
"Please select a library you wish to edit."),
2266 lstLibs->GetString(sels[0]),
2269 _(
"Choose library to link"),
2272 _(
"Library files (*.a, *.so, *.lib, *.dylib, *.bundle)|*.a;*.so;*.lib;*.dylib;*.bundle|All files (*)|*"));
2275 if (dlg.ShowModal() ==
wxID_OK)
2277 lstLibs->SetString(sels[0], dlg.GetPath());
2283 cbMessageBox(
_(
"Please select only *one* library you wish to edit."),
2295 int num = lstLibs->GetSelections(sels);
2298 if (
cbMessageBox(
_(
"Remove library '")+lstLibs->GetString(sels[0])+
_(
"' from the list?"),
2301 lstLibs->Delete(sels[0]);
2307 wxString msg; msg.
Printf(
_(
"Remove all (%d) selected libraries from the list?"), num);
2311 for (
size_t i = sels.GetCount(); i>0; --i)
2312 lstLibs->Delete(sels[i-1]);
2322 if (!lstLibs || lstLibs->GetCount() == 0)
2336 if (!lstLibs || lstLibs->GetCount() == 0)
2348 _(
"Copy libraries"), choices,
this);
2352 for (wxArrayInt::const_iterator itr = sel.begin(); itr != sel.end(); ++itr)
2366 for (
size_t i = 0; i < lstLibs->GetCount(); ++i)
2368 if (lstLibs->IsSelected(i))
2395 control->Append(path);
2405 if (!control || control->GetSelection() < 0)
2409 wxString initial = control->GetString(control->GetSelection());
2410 if (dir.DirExists())
2411 initial = dir.GetPath(wxPATH_GET_VOLUME);
2429 control->SetString(control->GetSelection(), path);
2438 if (!control || control->GetSelection() < 0)
2440 control->Delete(control->GetSelection());
2447 if (!control || control->IsEmpty())
2462 wxString ignore_str = text->GetValue().Trim();
2463 if ( (ignore_str.
Len()>0)
2466 list->Append(ignore_str);
2474 if (!list || list->IsEmpty())
2477 int selection = list->GetSelection();
2480 list->Delete(selection);
2492 int num = lstLibs->GetSelections(sels);
2498 for (
size_t i=1; i<lstLibs->GetCount(); ++i)
2501 if (lstLibs->IsSelected(i) && !lstLibs->IsSelected(i-1))
2503 wxString lib = lstLibs->GetString(i);
2506 lstLibs->InsertItems(1, &lib, i - 1);
2507 lstLibs->SetSelection(i - 1);
2521 int num = lstLibs->GetSelections(sels);
2527 for (
size_t i=lstLibs->GetCount()-1; i>0; --i)
2532 if (lstLibs->IsSelected(i-1) && !lstLibs->IsSelected(i))
2534 wxString lib = lstLibs->GetString(i-1);
2535 lstLibs->Delete(i-1);
2537 lstLibs->InsertItems(1, &lib, i);
2538 lstLibs->SetSelection(i);
2549 if (!lst || lst->GetSelections(sels) < 1)
2554 for (
size_t i=1; i<lst->GetCount(); ++i)
2557 if (lst->IsSelected(i) && !lst->IsSelected(i-1))
2562 lst->InsertItems(1, &dir, i - 1);
2563 lst->SetSelection(i - 1);
2574 if (!lst || lst->GetSelections(sels) < 1)
2579 for (
size_t i=lst->GetCount()-1; i>0; --i)
2584 if (lst->IsSelected(i-1) && !lst->IsSelected(i))
2586 wxString dir = lst->GetString(i-1);
2589 lst->InsertItems(1, &dir, i);
2590 lst->SetSelection(i);
2600 _(
"Select directory"),
2601 XRCCTRL(*
this,
"txtMasterPath",
wxTextCtrl)->GetValue());
2604 XRCCTRL(*
this,
"txtMasterPath",
wxTextCtrl)->SetValue(path);
2618 if (event.GetId() == XRCID(
"btnCcompiler"))
2619 obj = XRCCTRL(*
this,
"txtCcompiler",
wxTextCtrl);
2620 else if (event.GetId() == XRCID(
"btnCPPcompiler"))
2621 obj = XRCCTRL(*
this,
"txtCPPcompiler",
wxTextCtrl);
2622 else if (event.GetId() == XRCID(
"btnLinker"))
2623 obj = XRCCTRL(*
this,
"txtLinker",
wxTextCtrl);
2624 else if (event.GetId() == XRCID(
"btnLibLinker"))
2625 obj = XRCCTRL(*
this,
"txtLibLinker",
wxTextCtrl);
2626 else if (event.GetId() == XRCID(
"btnResComp"))
2627 obj = XRCCTRL(*
this,
"txtResComp",
wxTextCtrl);
2628 else if (event.GetId() == XRCID(
"btnMake"))
2635 wxString file_selection =
_(
"All files (*)|*");
2636 if (platform::windows)
2637 file_selection =
_(
"Executable files (*.exe)|*.exe");
2640 XRCCTRL(*
this,
"txtMasterPath",
wxTextCtrl)->GetValue() +
_T(
"/bin"),
2647 if (dlg.ShowModal() !=
wxID_OK)
2650 obj->SetValue(fname.GetFullName());
2657 _(
"The compiler's advanced settings, need command-line " 2658 "compiler knowledge to be tweaked.\nIf you don't know " 2659 "*exactly* what you 're doing, it is suggested to " 2660 "NOT tamper with these...\n\n" 2661 "Are you sure you want to proceed?"),
2682 int num = list.GetSelections(selections);
2683 int itemCount = list.GetCount();
2684 bool en = (num > 0);
2686 edit.Enable(num == 1);
2688 clear.Enable(itemCount != 0);
2693 int minIndex = selections.size();
2695 for (
int index : selections)
2697 minIndex = std::min(index, minIndex);
2698 maxIndex = std::max(index, maxIndex);
2700 up.Enable(minIndex > 0);
2701 down.Enable(maxIndex < itemCount - 1);
2718 *XRCCTRL(*
this,
"btnDelDir",
wxButton), *XRCCTRL(*
this,
"btnClearDir",
wxButton),
2719 *XRCCTRL(*
this,
"btnCopyDirs",
wxButton), *XRCCTRL(*
this,
"btnMoveDirUp",
wxButton),
2720 *XRCCTRL(*
this,
"btnMoveDirDown",
wxButton));
2728 *XRCCTRL(*
this,
"btnDelLib",
wxButton), *XRCCTRL(*
this,
"btnClearLib",
wxButton),
2729 *XRCCTRL(*
this,
"btnCopyLibs",
wxButton), *XRCCTRL(*
this,
"btnMoveLibUp",
wxButton),
2730 *XRCCTRL(*
this,
"btnMoveLibDown",
wxButton));
2736 en = XRCCTRL(*
this,
"lstExtraPaths",
wxListBox)->GetSelection() >= 0;
2737 XRCCTRL(*
this,
"btnExtraEdit",
wxButton)->Enable(en);
2738 XRCCTRL(*
this,
"btnExtraDelete",
wxButton)->Enable(en);
2739 XRCCTRL(*
this,
"btnExtraClear",
wxButton)->Enable(XRCCTRL(*
this,
"lstExtraPaths",
wxListBox)->GetCount() != 0);
2743 en = XRCCTRL(*
this,
"lstVars",
wxListBox)->GetSelection() >= 0;
2744 XRCCTRL(*
this,
"btnEditVar",
wxButton)->Enable(en);
2745 XRCCTRL(*
this,
"btnDeleteVar",
wxButton)->Enable(en);
2746 XRCCTRL(*
this,
"btnClearVar",
wxButton)->Enable(XRCCTRL(*
this,
"lstVars",
wxListBox)->GetCount() != 0);
2752 XRCCTRL(*
this,
"cmbCompilerPolicy",
wxChoice)->Enable(en);
2753 XRCCTRL(*
this,
"cmbLinkerPolicy",
wxChoice)->Enable(en);
2754 XRCCTRL(*
this,
"cmbIncludesPolicy",
wxChoice)->Enable(en);
2755 XRCCTRL(*
this,
"cmbLibDirsPolicy",
wxChoice)->Enable(en);
2756 XRCCTRL(*
this,
"cmbResDirsPolicy",
wxChoice)->Enable(en);
2762 int idx = XRCCTRL(*
this,
"cmbCompiler",
wxChoice)->GetSelection();
2763 int count = XRCCTRL(*
this,
"cmbCompiler",
wxChoice)->GetCount();
2767 XRCCTRL(*
this,
"btnAddCompiler",
wxButton)->Enable(en);
2768 XRCCTRL(*
this,
"btnRenameCompiler",
wxButton)->Enable(en && count);
2769 XRCCTRL(*
this,
"btnDelCompiler",
wxButton)->Enable(en &&
2772 XRCCTRL(*
this,
"btnResetCompiler",
wxButton)->Enable(en &&
2776 XRCCTRL(*
this,
"chkFullHtmlLog",
wxCheckBox)->Enable(XRCCTRL(*
this,
"chkSaveHtmlLog",
wxCheckBox)->IsChecked());
2777 XRCCTRL(*
this,
"btnIgnoreRemove",
wxButton)->Enable(XRCCTRL(*
this,
"lstIgnore",
wxListBox)->GetCount()>0);
2778 XRCCTRL(*
this,
"btnIgnoreAdd",
wxButton)->Enable(XRCCTRL(*
this,
"txtIgnore",
wxTextCtrl)->GetValue().Trim().Len()>0);
2795 chk = XRCCTRL(*
this,
"chkIncludePrjCwd",
wxCheckBox);
2798 chk = XRCCTRL(*
this,
"chkSkipIncludeDeps",
wxCheckBox);
2801 chk = XRCCTRL(*
this,
"chkSaveHtmlLog",
wxCheckBox);
2804 chk = XRCCTRL(*
this,
"chkFullHtmlLog",
wxCheckBox);
2806 cfg->
Write(
_T(
"/save_html_build_log/full_command_line"), (
bool)chk->
IsChecked());
2807 chk = XRCCTRL(*
this,
"chkBuildProgressBar",
wxCheckBox);
2810 chk = XRCCTRL(*
this,
"chkBuildProgressPerc",
wxCheckBox);
2817 if (spn && (((
int)spn->
GetValue()) != cfg->
ReadInt(
_T(
"/parallel_processes"), 0)))
2820 cbMessageBox(
_(
"You can't change the number of parallel processes while building!\nSetting ignored..."),
_(
"Warning"),
wxICON_WARNING);
2827 spn = XRCCTRL(*
this,
"spnMaxErrors",
wxSpinCtrl);
2831 chk = XRCCTRL(*
this,
"chkRebuildSeperately",
wxCheckBox);
2840 cfg->
Write(
_T(
"/ignore_output"), IgnoreOutput);
2843 chk = XRCCTRL(*
this,
"chkNonPlatComp",
wxCheckBox);
2847 cbMessageBox(
_(
"You can't change the option to enable or disable non-platform compilers while building!\nSetting ignored..."),
_(
"Warning"),
wxICON_WARNING);
2866 wxWindow* focused = wxWindow::FindFocus();
2872 int keycode =
event.GetKeyCode();
2873 int id = focused->GetId();
2876 unsigned int myidx = 0;
2878 const wxChar* str_libs[4] = {
_T(
"btnEditLib"),
_T(
"btnAddLib"),
_T(
"btnDelLib"),
_T(
"btnClearLib") };
2879 const wxChar* str_dirs[4] = {
_T(
"btnEditDir"),
_T(
"btnAddDir"),
_T(
"btnDelDir"),
_T(
"btnClearDir") };
2880 const wxChar* str_vars[4] = {
_T(
"btnEditVar"),
_T(
"btnAddVar"),
_T(
"btnDeleteVar"),
_T(
"btnClearVar") };
2881 const wxChar* str_xtra[4] = {
_T(
"btnExtraEdit"),
_T(
"btnExtraAdd"),
_T(
"btnExtraDelete"),
_T(
"btnExtraClear") };
2895 if (
id == XRCID(
"lstLibs"))
2897 else if (
id == XRCID(
"lstIncludeDirs") ||
id == XRCID(
"lstLibDirs") ||
id == XRCID(
"lstResDirs"))
2899 else if (
id == XRCID(
"lstVars"))
2901 else if (
id == XRCID(
"lstExtraPaths"))
2912 this->ProcessEvent(newevent);
2916 int CompilerOptionsDlg::m_MenuOption = -1;
2923 enum FlagsMenuOptions
2936 pop->
Append(FMO_New,
_(
"New flag..."));
2937 if (property && !property->IsCategory())
2939 pop->
Append(FMO_Modify,
_(
"Modify flag..."));
2940 pop->
Append(FMO_Delete,
_(
"Delete flag"));
2943 pop->
Append(FMO_COnly,
_(
"C - only flags..."));
2944 pop->
Append(FMO_CPPOnly,
_(
"C++ - only flags..."));
2946 pop->
Append(FMO_ExpandAll,
_(
"Expand all categories"));
2947 pop->
Append(FMO_CollapseAll,
_(
"Collapse all categories"));
2960 if (dlg.GetSize().GetHeight() < 220)
2962 dlg.SetSize(dlg.GetPosition().x, dlg.GetPosition().y - (220 - dlg.GetSize().GetHeight()) / 2,
2963 dlg.GetSize().GetWidth(), 220);
2985 if (dlg.GetSize().GetHeight() < 220)
2987 dlg.SetSize(dlg.GetPosition().x, dlg.GetPosition().y - (220 - dlg.GetSize().GetHeight()) / 2,
2988 dlg.GetSize().GetWidth(), 220);
3030 for (
size_t j = 0; j < categ.
GetCount(); ++j)
3042 categ.
Add(
wxT(
"General"));
3051 if (property->IsCategory())
3052 categoryName = property->GetLabel();
3057 categoryName = category->
GetLabel();
3070 if (property->IsCategory())
3077 name =
property->GetLabel();
3125 if (property && property->IsKindOf(CLASSINFO(wxBoolProperty)))
void DoSaveCompilerPrograms()
bool linkerNeedsLibExtension
void OnClearLibClick(wxCommandEvent &event)
virtual const RegExArray & GetRegExArray()
Get the array of regexes used in errors/warnings recognition.
DLLIMPORT wxArrayString GetArrayFromString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool trimSpaces=true)
virtual bool IsRunning() const
Is the plugin currently compiling?
virtual void SetOptionRelation(OptionsRelationType type, OptionsRelation rel)
Set the target's options relation for type to rel.
void UpdateCompilerForTargets(int compilerIdx)
const wxString & GetLabel() const
CompilerLoggingType logging
virtual void AddAttribute(const wxString &name, const wxString &value)
DLLIMPORT bool NeedQuotes(const wxString &str)
void OnRemoveDirClick(wxCommandEvent &event)
virtual void SetMakeCommandFor(MakeCommand cmd, const wxString &make)
Set the "make" command used for cmd.
static int GetXRCID(const wxString &str_id, int value_if_not_found=wxID_NONE)
virtual bool UnsetVar(const wxString &key)
void Remove(const wxString &sz)
void OnAddDirClick(wxCommandEvent &event)
#define wxTextEntryDialogStyle
static wxString GetFolder(SearchDirs dir)
Access one of Code::Blocks' folders.
void DoFillCompilerDependentSettings()
bool wxRemoveFile(const wxString &file)
Data folder in user's dir.
const wxString empty(_T(""))
virtual const wxString & GetMasterPath() const
Get the compiler's master path (must contain "bin", "include" and "lib")
virtual void SetName(const wxString &name)
Set the compiler's name.
ConfigurationVector & GetConfigurations()
virtual void SetPrograms(const CompilerPrograms &programs)
Set the compiler's programs.
static const CompilerLoggingType defaultLogging
virtual void SetResourceCompilerOptions(const wxArrayString &resourceCompilerOpts)
CompileOptionsBase * GetVarsOwner()
CompilerLoggingType
Helper enum for type of compiler logging.
ConfigManager * GetConfigManager(const wxString &name_space) const
std::vector< CustomVarAction > m_CustomVarActions
the actions carried out on the custom vars that need to be saved/applied
void SetNext(wxXmlNode *next)
void DoRegisterCompilers()
int ReadInt(const wxString &name, int defaultVal=0)
void DoSaveCompilerDefinition()
static Manager * Get()
Use Manager::Get() to get a pointer to its instance Manager::Get() is guaranteed to never return an i...
virtual const CompilerOptions & GetOptions() const
Get the compiler's options.
void OnSetDefaultCompilerClick(wxCommandEvent &event)
wxPGProperty * Item(unsigned int i) const
Linker include dir option.
wxString m_NewProjectOrTargetCompilerId
keeps track of the changes of compiler of the selected project/target
void OnEditLibClick(wxCommandEvent &event)
ProjectBuildTarget * m_pTarget
wxPGProperty * Append(wxPGProperty *property)
virtual int GetSelection() const
wxPropertyGridIterator GetIterator(int flags=wxPG_ITERATE_DEFAULT, wxPGProperty *firstProp=NULL)
void OnCompilerChanged(wxCommandEvent &event)
void OnTreeSelectionChange(wxTreeEvent &event)
virtual void DeleteAllItems()
bool wxFileExists(const wxString &filename)
void LogWarning(const wxString &msg, int i=app_log)
DLLIMPORT wxString cbGetTextFromUser(const wxString &message, const wxString &caption=cbGetTextFromUserPromptStr, const wxString &default_value=wxEmptyString, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord, bool centre=true)
wxString Strip(stripType s=trailing) const
static Compiler * GetDefaultCompiler()
virtual void SetLibDirs(const wxArrayString &libDirs)
Link console executable command, e.g. "$linker $libdirs -o $exe_output $link_objects $libs"...
wxTreeItemId GetOldItem() const
void OnClearVarClick(wxCommandEvent &event)
VariableListClientData(const wxString &key, const wxString &value)
virtual void OnApply()
Called when the user chooses to apply the configuration.
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)
Generate dependencies command.
int Index(const wxString &sz, bool bCase=true, bool bFromEnd=false) const
virtual void SetFilterIndex(int filterIndex)
void AutoDetectCompiler()
DebuggerClientData(const wxString &s)
virtual wxTreeItemId GetSelection() const
CompOption * GetOption(int index)
virtual const wxArrayString & GetCompilerOptions() const
wxArrayString m_ResourceCompilerOptions
bool wxDirExists(const wxString &dirname)
static Compiler * GetCompiler(size_t index)
static int GetCompilerIndex(const wxString &id)
void OnRemoveLibClick(wxCommandEvent &event)
virtual void Reset()
Reset settings to defaults.
ScopeTreeData(cbProject *project, ProjectBuildTarget *target)
void SetPropertyAttribute(wxPGPropArg id, const wxString &attrName, wxVariant value, long argFlags=0)
virtual void AddIncludeDir(const wxString &option)
static const wxString & GetDefaultCompilerID()
wxArrayString m_LinkerOptions
CustomVarActionType m_Action
void OnResetCompilerClick(wxCommandEvent &event)
bool SetColumnProportion(unsigned int column, int proportion)
void OnMoveDirUpClick(wxCommandEvent &event)
DLLIMPORT wxString GetStringFromArray(const wxArrayString &array, const wxString &separator=DEFAULT_ARRAY_SEP, bool SeparatorAtEnd=true)
const wxString & GetCPPOnlyFlags()
Compile object command, e.g. "$compiler $options $includes -c $file -o $object".
virtual wxTreeItemData * GetItemData(const wxTreeItemId &item) const
void SetCPPOnlyFlags(const wxString &flags)
wxString & Remove(size_t pos)
void OnMasterPathClick(wxCommandEvent &event)
virtual unsigned int GetCount() const
void ProjectTargetCompilerAdjust()
checks if compiler changed for project/target and takes actions accordingly
void SetRange(int minVal, int maxVal)
void OnEditVarClick(wxCommandEvent &event)
virtual void SetLinkLibs(const wxArrayString &linkLibs)
wxString AfterFirst(wxUniChar ch) const
virtual const wxArrayString & GetBuildScripts() const
static void UnregisterCompilers()
Unregister all compilers.
bool wxMkdir(const wxString &dir, int perm=wxS_DIR_DEFAULT)
virtual void RecalcSizes()=0
CompilerOptions m_Options
wxArrayString ReadArrayString(const wxString &name)
void OnRemoveVarClick(wxCommandEvent &event)
CompOption * GetOptionByName(const wxString &name)
#define wxPG_BOOL_USE_CHECKBOX
virtual void SetCompilerID(const wxString &id)
! Set the flag if the host app should be run in terminal
wxPanel * LoadPanel(wxWindow *parent, const wxString &name)
wxTreeItemId GetItem() const
bool ExpandAll(bool expand=true)
void OnTreeSelectionChanging(wxTreeEvent &event)
void ListBox2ArrayString(wxArrayString &array, const wxListBox *control)
static Compiler * CreateCompilerCopy(Compiler *compiler, const wxString &newName)
Create a copy of a compiler.
void OnOptionChanged(wxPropertyGridEvent &event)
wxPGProperty * GetFirstChild(wxPGPropArg id)
#define wxICON_EXCLAMATION
virtual TargetType GetTargetType() const
Read the target's type.
void SetPropertyValue(wxPGPropArg id, long value)
wxXmlNode * GetNext() const
void DoFillCompilerSets(int compilerIdx)
virtual void SetCompilerOptions(const wxArrayString &compilerOpts)
wxUSE_UNICODE_dependent wxChar
static void RemoveCompiler(Compiler *compiler)
Remove a compiler.
void DoFillCompilerPrograms()
std::vector< RegExStruct > RegExArray
wxString BeforeFirst(wxUniChar ch, wxString *rest=NULL) const
static Compiler * SelectCompilerUI(const wxString &message=_("Select compiler"), const wxString &preselectedID=wxEmptyString)
void OnIgnoreAddClick(wxCommandEvent &event)
virtual void SetString(unsigned int pos, const wxString &s)
const wxString & GetID() const
Get this compiler's unique ID.
virtual bool DeletePage(size_t page)
virtual void AddResourceIncludeDir(const wxString &option)
void SetCompilerID(const wxString &id) override
! Set the flag if the host app should be run in terminal
virtual OptionsRelation GetOptionRelation(OptionsRelationType type) const
Read the target's options relation for type.
void Write(const wxString &name, const wxString &value, bool ignoreEmpty=false)
DebuggerManager * GetDebuggerManager() const
void OnMoveLibUpClick(wxCommandEvent &event)
virtual const wxArrayString & GetResourceIncludeDirs() const
void Insert(wxString lItem, size_t nIndex, size_t copies=1)
Represents a Code::Blocks project.
void OnMyCharHook(wxKeyEvent &event)
void OnAddCompilerClick(wxCommandEvent &event)
void ArrayString2ListBox(const wxArrayString &array, wxListBox *control)
virtual const wxArrayString & GetLinkerOptions() const
const wxString & GetCOnlyFlags()
virtual void AddLinkLib(const wxString &option)
Link dynamic (dll) lib command, e.g. "$linker -shared -Wl,--output-def=$def_output -Wl...
void OnClearDirClick(wxCommandEvent &event)
ProjectBuildTarget * m_Target
wxString & RemoveLast(size_t n=1)
virtual const wxArrayString & GetLinkLibs() const
void OnDirty(wxCommandEvent &event)
virtual wxString GetMakeCommandFor(MakeCommand cmd) const
Get the "make" command used for cmd.
virtual bool Save(const wxString &filename, int indentstep=2) const
virtual const wxString & GetTitle() const
Read the target's title.
Resource compiler include dir option.
virtual void AddLibDir(const wxString &option)
wxString Left(size_t count) const
virtual const wxArrayString & GetResourceCompilerOptions() const
static void QuoteString(wxString &value, const wxString &caption)
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
OptionsRelation
Option's relation.
virtual void SelectItem(const wxTreeItemId &item, bool select=true)
bool m_LogBuildProgressPercentage
const wxSize wxDefaultSize
const wxPoint wxDefaultPosition
#define wxCHECK_VERSION(major, minor, release)
wxChar includeDirSeparator
unsigned int GetCount() const
static void SetDefaultCompiler(size_t index)
virtual const CompilerPrograms & GetPrograms() const
Get the compiler's programs.
LogManager * GetLogManager() const
const wxString & GetPath()
wxString & Item(size_t nIndex)
virtual void SetIncludeDirs(const wxArrayString &includeDirs)
void OnRemoveCompilerClick(wxCommandEvent &event)
virtual wxString GetBasePath() const
Read the target's base path, e.g. if GetFilename() returns "/usr/local/bin/xxx", base path will retur...
wxPGProperty * GetParent() const
void OnAddLibClick(wxCommandEvent &event)
virtual void SetCommandsBeforeBuild(const wxArrayString &commands)
static void SaveSettings()
Compiler include dir option.
virtual const wxArrayString & GetCommandsAfterBuild() const
void OnAdvancedClick(wxCommandEvent &event)
This is a base class for all classes needing compilation parameters.
static wxUniChar GetPathSeparator(wxPathFormat format=wxPATH_NATIVE)
void SortChildren(wxPGPropArg id, int flags=0)
const wxStringCharType * wx_str() const
DLLIMPORT wxArrayInt cbGetMultiChoiceDialog(const wxString &message, const wxString &caption, const wxArrayString &choices, wxWindow *parent=nullptr, const wxSize &size=wxSize(300, 300), const wxArrayInt &initialSelection=wxArrayInt())
wxMultiChoiceDialog wrapper.
Link executable command, e.g. "$linker $libdirs -o $exe_output $link_objects $libs -mwindows"...
wxPropertyGrid * m_FlagsPG
void OnAddVarClick(wxCommandEvent &event)
void OnAutoDetectClick(wxCommandEvent &event)
wxVariant GetPropertyValue(wxPGPropArg id)
virtual void SetAlwaysRunPostBuildSteps(bool always)
virtual void SetValue(const wxString &text)
MacrosManager * GetMacrosManager() const
unsigned int GetChildCount() const
const wxString & _(const wxString &string)
DLLIMPORT void QuoteStringIfNeeded(wxString &str)
wxString & Trim(bool fromRight=true)
void ShowErrorMessage(bool safe=true)
Display exception error message.
int cbMessageBox(const wxString &message, const wxString &caption=wxEmptyString, int style=wxOK, wxWindow *parent=NULL, int x=-1, int y=-1)
Call global cbMessageBox with m_parentDialog as parent window when no parent window specified...
std::map< cbDebuggerPlugin *, PluginData > RegisteredPlugins
int GetBuildTargetsCount()
virtual void SetOptions(const CompilerOptions &options)
Set the compiler's options.
ProjectBuildTarget * GetTarget()
void OnSelectProgramClick(wxCommandEvent &event)
void OnEditDirClick(wxCommandEvent &event)
void ArrayString2TextCtrl(const wxArrayString &array, wxTextCtrl *control)
bool ChangePropertyValue(wxPGPropArg id, wxVariant newValue)
virtual const wxArrayString & GetIncludeDirs() const
CommandType
Helper enum to retrieve compiler commands.
wxPGProperty * AppendIn(wxPGPropArg id, wxPGProperty *newProperty)
wxArrayString m_CompilerOptions
wxArray< int > wxArrayInt
static wxString GetDataFolder(bool global=true)
ProjectBuildTarget * GetBuildTarget(int index)
Access a build target.
virtual void Expand(const wxTreeItemId &item)
Compile Win32 resources command, e.g. "$rescomp -i $file -J rc -o $resource_output -O coff $includes"...
Abstract base class for compilers.
bool m_bDirty
true if a setting has changed since last save
DLLIMPORT const wxString DEFAULT_ARRAY_SEP
virtual void SetLinkerOptions(const wxArrayString &linkerOpts)
void SetRoot(wxXmlNode *node)
wxListBox * GetDirsListBox()
void OnCopyDirsClick(wxCommandEvent &event)
void OnMoveLibDownClick(wxCommandEvent &event)
DLLIMPORT void PlaceWindow(wxTopLevelWindow *w, cbPlaceDialogMode mode=pdlBest, bool enforce=false)
virtual bool GetAlwaysRunPostBuildSteps() const
virtual const wxArrayString & GetLibDirs() const
void OnCopyLibsClick(wxCommandEvent &event)
virtual int GetSelection() const
void OnOptionDoubleClick(wxPropertyGridEvent &event)
RegisteredPlugins const & GetAllDebuggers() const
virtual const wxString & GetCompilerID() const
Read the target's compiler.
bool forceLinkerUseQuotes
void AddOption(CompOption *coption, int index=-1)
virtual bool SetVar(const wxString &key, const wxString &value, bool onlyIfExists=false)
bool AttachUnknownControl(const wxString &name, wxWindow *control, wxWindow *parent=NULL)
CompOption * GetOptionByAdditionalLibs(const wxString &libs)
virtual const wxString & GetName() const
Get the compiler's name.
const wxString & GetParentID() const
Get this compiler's parent's unique ID.
virtual int SetSelection(size_t page)
virtual const CompilerSwitches & GetSwitches() const
Get the compiler's generic switches.
bool EndsWith(const wxString &suffix, wxString *rest=NULL) const
void RemoveOption(int index)
void OnEditCompilerClick(wxCommandEvent &event)
virtual void SetResourceIncludeDirs(const wxArrayString &resIncludeDirs)
void DoGetCompileOptions(wxArrayString &array, const wxTextCtrl *control)
void SetVersion(const wxString &version)
virtual wxTreeItemId AddRoot(const wxString &text, int image=-1, int selImage=-1, wxTreeItemData *data=NULL)
DLLIMPORT wxString MakeUniqueString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool caseSens=true)
size_t Add(const wxString &str, size_t copies=1)
bool StartsWith(const wxString &prefix, wxString *rest=NULL) const
bool linkerNeedsLibPrefix
Represents a Code::Blocks project build target.
void OnIgnoreRemoveClick(wxCommandEvent &event)
static size_t GetCompilersCount()
void DoSaveCompilerDependentSettings()
wxPGProperty * GetRoot() const
int Find(wxUniChar ch, bool fromEnd=false) const
Link native binary command.
static wxXmlResource * Get()
void OnUpdateUI(wxUpdateUIEvent &event)
virtual void SetSwitches(const CompilerSwitches &switches)
Set the compiler's generic switches.
Link static lib command, e.g. "ar -r $output $link_objects\n\tranlib $static_output".
bool m_bFlagsDirty
true if a flag (not its value) has changed since last save
bool m_BuildingTree
flag to ignore tree changing events while building it
void RemoveAt(size_t nIndex, size_t count=1)
virtual AutoDetectResult AutoDetectInstallationDir()=0
Try to auto-detect the compiler's installation directory.
virtual bool RemovePage(size_t page)
int Printf(const wxString &pszFormat,...)
virtual void SetSelection(int n)
void OnMoveDirDownClick(wxCommandEvent &event)
virtual const StringHash & GetAllVars() const
bool forceCompilerUseQuotes
virtual void SetValue(bool state)
CompOption * GetOptionByOption(const wxString &option)
Code::Blocks error handling unit.
wxArtID wxART_INFORMATION
virtual void SetCommandsAfterBuild(const wxArrayString &commands)
static wxString Format(const wxString &format,...)
CompilerOptionsDlg(wxWindow *parent, CompilerGCC *compiler, cbProject *project=0L, ProjectBuildTarget *target=0L)
Dialog that contains a "Don't annoy me" checkbox.
const wxString lt(_T("<"))
virtual void SetMasterPath(const wxString &path)
Set the compiler's master path (must contain "bin", "include" and "lib")
void OnCategoryChanged(wxCommandEvent &event)
virtual void AddChild(wxXmlNode *child)
wxTreeItemId AppendItem(const wxTreeItemId &parent, const wxString &text, int image=-1, int selImage=-1, wxTreeItemData *data=NULL)
void SetCOnlyFlags(const wxString &flags)
bool linkerNeedsPathResolved
Target only runs commands in pre-build and/or post-build steps.
virtual const wxArrayString & GetCommandsBeforeBuild() const