Code::Blocks  SVN r11506
advancedcompileroptionsdlg.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: 10912 $
6  * $Id: advancedcompileroptionsdlg.cpp 10912 2016-09-25 16:10:13Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/compilergcc/advancedcompileroptionsdlg.cpp $
8  */
9 
10 #include "sdk.h"
11 #ifndef CB_PRECOMP
12  #include <wx/button.h>
13  #include <wx/checkbox.h>
14  #include <wx/choice.h>
15  #include <wx/combobox.h>
16  #include <wx/intl.h>
17  #include <wx/listbox.h>
18  #include <wx/sizer.h>
19  #include <wx/spinctrl.h>
20  #include <wx/textctrl.h>
21  #include <wx/xrc/xmlres.h>
22  #include "compilerfactory.h"
23  #include "globals.h"
24 #endif
26 
27 // TODO : implement full IsDirty mechanism, now always forced to true when OK is pressed
28 // NOTE : when OK pressed settings are already applied to the compiler, although in the compiler settings
29 // that the parent dialog that spawned this dialog the user can still click on cancel there,
30 // meaning also the changes here should not be applied, but as it is now : too late, applied (TO FIX)
31 
32 
34 {
35  wxString ret = src;
36  ret.Replace(_T("\t"), _T("\\t"));
37  ret.Replace(_T("\n"), _T("\\n"));
38  ret.Replace(_T("\r"), _T("\\r"));
39  ret.Replace(_T("\a"), _T("\\a"));
40  ret.Replace(_T("\b"), _T("\\b"));
41  return ret;
42 }
43 
45 {
46  wxString ret = src;
47  ret.Replace(_T("\\t"), _T("\t"));
48  ret.Replace(_T("\\n"), _T("\n"));
49  ret.Replace(_T("\\r"), _T("\r"));
50  ret.Replace(_T("\\a"), _T("\a"));
51  ret.Replace(_T("\\b"), _T("\b"));
52  return ret;
53 }
54 
56  EVT_CHOICE(XRCID("lstCommands"), AdvancedCompilerOptionsDlg::OnCommandsChange)
57  EVT_CHOICE(XRCID("lstExt"), AdvancedCompilerOptionsDlg::OnExtChange)
58  EVT_BUTTON(XRCID("btnAddExt"), AdvancedCompilerOptionsDlg::OnAddExt)
59  EVT_BUTTON(XRCID("btnRemoveExt"), AdvancedCompilerOptionsDlg::OnDelExt)
60  EVT_LISTBOX(XRCID("lstRegex"), AdvancedCompilerOptionsDlg::OnRegexChange)
61  EVT_BUTTON(XRCID("btnRegexTest"), AdvancedCompilerOptionsDlg::OnRegexTest)
62  EVT_BUTTON(XRCID("btnRegexAdd"), AdvancedCompilerOptionsDlg::OnRegexAdd)
63  EVT_BUTTON(XRCID("btnRegexDelete"), AdvancedCompilerOptionsDlg::OnRegexDelete)
64  EVT_BUTTON(XRCID("btnRegexDefaults"), AdvancedCompilerOptionsDlg::OnRegexDefaults)
65  EVT_SPIN_UP(XRCID("spnRegexOrder"), AdvancedCompilerOptionsDlg::OnRegexUp)
66  EVT_SPIN_DOWN(XRCID("spnRegexOrder"), AdvancedCompilerOptionsDlg::OnRegexDown)
67 END_EVENT_TABLE()
68 
70  : m_CompilerId(compilerId),
71  m_LastCmdIndex(-1),
72  m_LastExtIndex(-1)
73 {
74  //ctor
75  wxXmlResource::Get()->LoadObject(this, parent, _T("dlgAdvancedCompilerOptions"),_T("wxScrollingDialog"));
76  XRCCTRL(*this, "wxID_OK", wxButton)->SetDefault();
77  ReadCompilerOptions();
78  m_bDirty = false;
79 
80  GetSizer()->SetSizeHints(this);
81 }
82 
84 {
85  //dtor
86 }
87 
89 {
91  if (!compiler)
92  return;
93 
94  wxChoice* lst = XRCCTRL(*this, "lstCommands", wxChoice);
95  lst->Clear();
96  for (int i = 0; i < ctCount; ++i)
97  {
98  m_Commands[i] = compiler->GetCommandToolsVector((CommandType)i);
99  lst->Append(Compiler::CommandTypeDescriptions[i]);
100  }
101  lst->SetSelection(0);
102  DisplayCommand(0,0);
103  ReadExtensions(0);
104 
105  // switches
106  const CompilerSwitches& switches = compiler->GetSwitches();
107  XRCCTRL(*this, "txtAddIncludePath", wxTextCtrl)->SetValue(switches.includeDirs);
108  XRCCTRL(*this, "txtAddLibPath", wxTextCtrl)->SetValue(switches.libDirs);
109  XRCCTRL(*this, "txtAddLib", wxTextCtrl)->SetValue(switches.linkLibs);
110  XRCCTRL(*this, "txtLibPrefix", wxTextCtrl)->SetValue(switches.libPrefix);
111  XRCCTRL(*this, "txtLibExt", wxTextCtrl)->SetValue(switches.libExtension);
112  XRCCTRL(*this, "txtDefine", wxTextCtrl)->SetValue(switches.defines);
113  XRCCTRL(*this, "txtGenericSwitch", wxTextCtrl)->SetValue(switches.genericSwitch);
114  XRCCTRL(*this, "txtObjectExt", wxTextCtrl)->SetValue(switches.objectExtension);
115  XRCCTRL(*this, "chkFwdSlashes", wxCheckBox)->SetValue(switches.forceFwdSlashes);
116  XRCCTRL(*this, "chkLinkerNeedsLibPrefix", wxCheckBox)->SetValue(switches.linkerNeedsLibPrefix);
117  XRCCTRL(*this, "chkLinkerNeedsLibExt", wxCheckBox)->SetValue(switches.linkerNeedsLibExtension);
118  XRCCTRL(*this, "chkLinkerNeedsPathRes", wxCheckBox)->SetValue(switches.linkerNeedsPathResolved);
119  XRCCTRL(*this, "chkNeedDeps", wxCheckBox)->SetValue(switches.needDependencies);
120  XRCCTRL(*this, "chkForceCompilerQuotes", wxCheckBox)->SetValue(switches.forceCompilerUseQuotes);
121  XRCCTRL(*this, "chkForceLinkerQuotes", wxCheckBox)->SetValue(switches.forceLinkerUseQuotes);
122  XRCCTRL(*this, "chkSupportsPCH", wxCheckBox)->SetValue(switches.supportsPCH);
123  XRCCTRL(*this, "txtPCHExt", wxTextCtrl)->SetValue(switches.PCHExtension);
124  XRCCTRL(*this, "chkUseFlatObjects", wxCheckBox)->SetValue(switches.UseFlatObjects);
125  XRCCTRL(*this, "chkUseFullSourcePaths", wxCheckBox)->SetValue(switches.UseFullSourcePaths);
126  XRCCTRL(*this, "txtIncludeDirSeparator", wxTextCtrl)->SetValue(switches.includeDirSeparator);
127  XRCCTRL(*this, "txtLibDirSeparator", wxTextCtrl)->SetValue(switches.libDirSeparator);
128  XRCCTRL(*this, "txtObjectSeparator", wxTextCtrl)->SetValue(switches.objectSeparator);
129  XRCCTRL(*this, "spnStatusSuccess", wxSpinCtrl)->SetValue(switches.statusSuccess);
130  XRCCTRL(*this, "chkUse83Paths", wxCheckBox)->SetValue(switches.Use83Paths);
131 
132  m_Regexes = compiler->GetRegExArray();
133  m_SelectedRegex = m_Regexes.size() > 0 ? 0 : -1;
134  FillRegexes();
135 }
136 
138 {
140  if (!compiler)
141  return;
142 
143  for (int i = 0; i < ctCount; ++i)
144  compiler->GetCommandToolsVector((CommandType)i) = m_Commands[i];
145 
146  // switches
147  CompilerSwitches switches;
148  switches.includeDirs = XRCCTRL(*this, "txtAddIncludePath", wxTextCtrl)->GetValue();
149  switches.libDirs = XRCCTRL(*this, "txtAddLibPath", wxTextCtrl)->GetValue();
150  switches.linkLibs = XRCCTRL(*this, "txtAddLib", wxTextCtrl)->GetValue();
151  switches.libPrefix = XRCCTRL(*this, "txtLibPrefix", wxTextCtrl)->GetValue();
152  switches.libExtension = XRCCTRL(*this, "txtLibExt", wxTextCtrl)->GetValue();
153  switches.defines = XRCCTRL(*this, "txtDefine", wxTextCtrl)->GetValue();
154  switches.genericSwitch = XRCCTRL(*this, "txtGenericSwitch", wxTextCtrl)->GetValue();
155  switches.objectExtension = XRCCTRL(*this, "txtObjectExt", wxTextCtrl)->GetValue();
156  switches.forceFwdSlashes = XRCCTRL(*this, "chkFwdSlashes", wxCheckBox)->GetValue();
157  switches.linkerNeedsLibPrefix = XRCCTRL(*this, "chkLinkerNeedsLibPrefix", wxCheckBox)->GetValue();
158  switches.linkerNeedsLibExtension = XRCCTRL(*this, "chkLinkerNeedsLibExt", wxCheckBox)->GetValue();
159  switches.linkerNeedsPathResolved = XRCCTRL(*this, "chkLinkerNeedsPathRes", wxCheckBox)->GetValue();
160  switches.needDependencies = XRCCTRL(*this, "chkNeedDeps", wxCheckBox)->GetValue();
161  switches.forceCompilerUseQuotes = XRCCTRL(*this, "chkForceCompilerQuotes", wxCheckBox)->GetValue();
162  switches.forceLinkerUseQuotes = XRCCTRL(*this, "chkForceLinkerQuotes", wxCheckBox)->GetValue();
163  switches.supportsPCH = XRCCTRL(*this, "chkSupportsPCH", wxCheckBox)->GetValue();
164  switches.PCHExtension = XRCCTRL(*this, "txtPCHExt", wxTextCtrl)->GetValue();
165  switches.UseFlatObjects = XRCCTRL(*this, "chkUseFlatObjects", wxCheckBox)->GetValue();
166  switches.UseFullSourcePaths = XRCCTRL(*this, "chkUseFullSourcePaths", wxCheckBox)->GetValue();
167  {
168  wxString value = XRCCTRL(*this, "txtIncludeDirSeparator", wxTextCtrl)->GetValue();
169  if (!value.IsEmpty())
170  switches.includeDirSeparator = value[0];
171  }
172  {
173  wxString value = XRCCTRL(*this, "txtLibDirSeparator", wxTextCtrl)->GetValue();
174  if (!value.IsEmpty())
175  switches.libDirSeparator = value[0];
176  }
177  {
178  wxString value = XRCCTRL(*this, "txtObjectSeparator", wxTextCtrl)->GetValue();
179  if (!value.IsEmpty())
180  switches.objectSeparator = value[0];
181  }
182  switches.statusSuccess = XRCCTRL(*this, "spnStatusSuccess", wxSpinCtrl)->GetValue();
183  switches.Use83Paths = XRCCTRL(*this, "chkUse83Paths", wxCheckBox)->GetValue();
184 
185  compiler->SetSwitches(switches);
186 }
187 
189 {
190  wxChoice* cmb = XRCCTRL(*this, "lstExt", wxChoice);
191  cmb->Clear();
192  for (size_t i = 0; i < m_Commands[nr].size(); ++i)
193  cmb->Append(GetStringFromArray(m_Commands[nr][i].extensions, DEFAULT_ARRAY_SEP, false));
195 }
196 
198 {
199  const wxChoice* cmb = XRCCTRL(*this, "lstExt", wxChoice);
200  for (size_t i = 0; i < m_Commands[cmd].size(); ++i)
201  {
202  if (cmb->GetString(ext).IsEmpty() && m_Commands[cmd][i].extensions.GetCount() == 0)
203  return &m_Commands[cmd][i];
204 
205  int selExt = m_Commands[cmd][i].extensions.Index(cmb->GetString(ext));
206  if (selExt != -1)
207  return &m_Commands[cmd][i];
208  }
209  return 0;
210 }
211 
213 {
214  wxTextCtrl* text = XRCCTRL(*this, "txtCommand", wxTextCtrl);
215  wxTextCtrl* gen = XRCCTRL(*this, "txtGenerated", wxTextCtrl);
216  if (CompilerTool* tool = GetCompilerTool(cmd,ext))
217  {
218  text->SetValue(tool->command);
219  gen->SetValue(GetStringFromArray(tool->generatedFiles, _T("\n"), false));
220  }
221  else
222  {
223  text->Clear();
224  gen->Clear();
225  }
226  m_LastCmdIndex = cmd;
227  m_LastExtIndex = ext;
228 }
229 
231 {
232  // changes can only happen after constructor : aka no longer (-1, -1)
233  if (m_LastCmdIndex != -1 && m_LastExtIndex != -1)
235 }
236 
238 {
239  if (cmd == -1 || ext == -1)
240  return;
241  if (CompilerTool* tool = GetCompilerTool(cmd, ext))
242  {
243  wxTextCtrl* text = XRCCTRL(*this, "txtCommand", wxTextCtrl);
244  wxTextCtrl* gen = XRCCTRL(*this, "txtGenerated", wxTextCtrl);
245  if (text->GetValue() != tool->command) // last command was changed; save it
246  tool->command = text->GetValue();
247  wxString gens = GetStringFromArray(tool->generatedFiles, _T("\n"), false);
248  if (gen->GetValue() != gens) // last genfiles are changed; save it
249  tool->generatedFiles = GetArrayFromString(gen->GetValue(), _T("\n"));
250  }
251 }
252 
254 {
255  wxListBox* list = XRCCTRL(*this, "lstRegex", wxListBox);
256  list->Clear();
257 
258  for (size_t i = 0; i < m_Regexes.size(); ++i)
259  {
260  RegExStruct& rs = m_Regexes[i];
261  list->Append(rs.desc);
262  }
263  list->SetSelection(m_SelectedRegex);
265 }
266 
268 {
269  if (index == -1)
270  {
271  XRCCTRL(*this, "txtRegexDesc", wxTextCtrl)->SetValue(_T(""));
272  XRCCTRL(*this, "cmbRegexType", wxComboBox)->SetSelection(-1);
273  XRCCTRL(*this, "txtRegex", wxTextCtrl)->SetValue(_T(""));
274  XRCCTRL(*this, "spnRegexMsg1", wxSpinCtrl)->SetValue(0);
275  XRCCTRL(*this, "spnRegexMsg2", wxSpinCtrl)->SetValue(0);
276  XRCCTRL(*this, "spnRegexMsg3", wxSpinCtrl)->SetValue(0);
277  XRCCTRL(*this, "spnRegexFilename", wxSpinCtrl)->SetValue(0);
278  XRCCTRL(*this, "spnRegexLine", wxSpinCtrl)->SetValue(0);
279  return;
280  }
281 
282  RegExStruct& rs = m_Regexes[index];
283  XRCCTRL(*this, "txtRegexDesc", wxTextCtrl)->SetValue(rs.desc);
284  XRCCTRL(*this, "cmbRegexType", wxComboBox)->SetSelection((int)rs.lt);
285  XRCCTRL(*this, "txtRegex", wxTextCtrl)->SetValue(ControlCharsToString(rs.GetRegExString()));
286  XRCCTRL(*this, "spnRegexMsg1", wxSpinCtrl)->SetValue(rs.msg[0]);
287  XRCCTRL(*this, "spnRegexMsg2", wxSpinCtrl)->SetValue(rs.msg[1]);
288  XRCCTRL(*this, "spnRegexMsg3", wxSpinCtrl)->SetValue(rs.msg[2]);
289  XRCCTRL(*this, "spnRegexFilename", wxSpinCtrl)->SetValue(rs.filename);
290  XRCCTRL(*this, "spnRegexLine", wxSpinCtrl)->SetValue(rs.line);
291 }
292 
294 {
295  if (index == -1)
296  return;
297 
298  RegExStruct& rs = m_Regexes[index];
299  rs.desc = XRCCTRL(*this, "txtRegexDesc", wxTextCtrl)->GetValue();
300  rs.lt = (CompilerLineType)XRCCTRL(*this, "cmbRegexType", wxComboBox)->GetSelection();
301  rs.SetRegExString(StringToControlChars(XRCCTRL(*this, "txtRegex", wxTextCtrl)->GetValue()));
302  rs.msg[0] = XRCCTRL(*this, "spnRegexMsg1", wxSpinCtrl)->GetValue();
303  rs.msg[1] = XRCCTRL(*this, "spnRegexMsg2", wxSpinCtrl)->GetValue();
304  rs.msg[2] = XRCCTRL(*this, "spnRegexMsg3", wxSpinCtrl)->GetValue();
305  rs.filename = XRCCTRL(*this, "spnRegexFilename", wxSpinCtrl)->GetValue();
306  rs.line = XRCCTRL(*this, "spnRegexLine", wxSpinCtrl)->GetValue();
307 }
308 
310 {
311  CheckForChanges();
312  int cmd = XRCCTRL(*this, "lstCommands", wxChoice)->GetSelection();
313  ReadExtensions(cmd); // can change the extension cmb list !!!!!!!!!!!!!!!
314  int ext = XRCCTRL(*this, "lstExt", wxChoice)->GetSelection();
315  DisplayCommand(cmd, ext);
316 }
317 
319 {
320  CheckForChanges();
321  int cmd = XRCCTRL(*this, "lstCommands", wxChoice)->GetSelection();
322  int ext = XRCCTRL(*this, "lstExt", wxChoice)->GetSelection();
323  DisplayCommand(cmd, ext);
324 }
325 
327 {
328  wxString ext = cbGetTextFromUser(_("Please enter a semi-colon separated list of extensions, without the leading dot:"), _("New extension"));
329  ext.Trim(false);
330  ext.Trim(true);
331  if (!ext.IsEmpty())
332  {
333  int nr = XRCCTRL(*this, "lstCommands", wxChoice)->GetSelection();
334  CompilerTool* ptool = GetCompilerTool(nr,0);
335  CompilerTool tool(ptool ? ptool->command : wxString(), ext);
336  m_Commands[nr].push_back(tool);
337  ReadExtensions(nr);
338  wxChoice* cmb = XRCCTRL(*this, "lstExt", wxChoice);
339  cmb->SetStringSelection(ext);
340  DisplayCommand(nr,cmb->GetSelection());
341  }
342 }
343 
345 {
346  if (cbMessageBox(_("Are you sure you want to remove this extension set from the list?"), _T("Confirmation"), wxYES_NO, this) == wxID_YES)
347  {
348  int nr = XRCCTRL(*this, "lstCommands", wxChoice)->GetSelection();
349  wxChoice* cmb = XRCCTRL(*this, "lstExt", wxChoice);
350  wxString extS = cmb->GetStringSelection();
351  if (!extS.IsEmpty())
352  {
353  int ext = cmb->GetSelection();
354  m_Commands[nr].erase(m_Commands[nr].begin() + ext);
355  ReadExtensions(nr);
356  cmb->SetSelection(0);
357  m_LastExtIndex = -1;
358  DisplayCommand(nr,0);
359  }
360  else
361  cbMessageBox(_("Can't remove default commands!"), _("Error"), wxICON_ERROR, this);
362  }
363 }
364 
366 {
367  // If we just have deleted the actual item or cleared the list, we should leave,
368  // otherwise m_Regexes will be broken, because the regex details of an invalid
369  // item will be saved
370  wxListBox* list = XRCCTRL(*this, "lstRegex", wxListBox);
371  if (list->GetSelection() == wxNOT_FOUND)
372  return;
373 
375 
376  // update regex list, in case desc was changed
377  XRCCTRL(*this, "lstRegex", wxListBox)->SetString(m_SelectedRegex, XRCCTRL(*this, "txtRegexDesc", wxTextCtrl)->GetValue());
378 
379  m_SelectedRegex = XRCCTRL(*this, "lstRegex", wxListBox)->GetSelection();
381 }
382 
384 {
386  m_Regexes.push_back(RegExStruct(_("New regular expression"), cltError, _T(""), 0));
387  m_SelectedRegex = m_Regexes.size() - 1;
388  FillRegexes();
389 }
390 
392 {
393  if (cbMessageBox(_("Are you sure you want to delete this regular expression?"), _("Confirmation"), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT, this) == wxID_YES)
394  {
395  m_Regexes.erase((m_Regexes.begin() + m_SelectedRegex));
396  if (m_SelectedRegex >= (int)m_Regexes.size())
397  --m_SelectedRegex;
398  FillRegexes();
399  }
400 }
401 
403 {
404  if (cbMessageBox(_("Are you sure you want to load the default regular expressions "
405  "for this compiler?\n"
406  "ALL regular expressions will be erased and replaced with their default "
407  "counterparts!\n\n"
408  "Are you REALLY sure?"), _("Confirmation"), wxICON_QUESTION | wxYES_NO | wxNO_DEFAULT, this) == wxID_YES)
409  {
411  if (!compiler)
412  return;
413  compiler->LoadDefaultRegExArray(true);
414  m_Regexes = compiler->GetRegExArray();
415  while (m_SelectedRegex >= (int)m_Regexes.size())
416  --m_SelectedRegex;
417  FillRegexes();
418  }
419 }
420 
422 {
423  if (m_SelectedRegex <= 0)
424  return;
425 
428  m_Regexes.erase(m_Regexes.begin() + m_SelectedRegex);
429  m_Regexes.insert((m_Regexes.begin() + (m_SelectedRegex - 1)), rs);
430  --m_SelectedRegex;
431  FillRegexes();
432 }
433 
435 {
436  if (m_SelectedRegex >= (int)m_Regexes.size() - 1)
437  return;
438 
441  m_Regexes.erase(m_Regexes.begin() + m_SelectedRegex);
442  m_Regexes.insert((m_Regexes.begin() + (m_SelectedRegex + 1)), rs);
443  ++m_SelectedRegex;
444  FillRegexes();
445 }
446 
448 {
449  if (m_SelectedRegex == -1)
450  return;
451  wxString text = XRCCTRL(*this, "txtRegexTest", wxTextCtrl)->GetValue();
452  if (text.IsEmpty())
453  {
454  cbMessageBox(_("Please enter a compiler line in the \"Compiler output\" text box..."), _("Error"), wxICON_ERROR, this);
455  return;
456  }
457 
459  if (!compiler)
460  return;
461 
462  // backup regexes
463  RegExArray regex_copy = m_Regexes;
465 
466  // test-run
467  compiler->SetRegExArray(m_Regexes);
468  CompilerLineType clt = compiler->CheckForWarningsAndErrors(text);
469 
470  // restore regexes
471  compiler->SetRegExArray(regex_copy);
472  m_Regexes = regex_copy;
473 
474  wxString msg;
475  msg.Printf(_("Regular expression analyzed as follows:\n\n"
476  "Type: %s message\n"
477  "Filename: %s\n"
478  "Line number: %s\n"
479  "Message: %s"),
480  clt == cltNormal ? _("Normal")
481  : (clt == cltInfo ? _("Info")
482  : (clt == cltError ? _("Error") : _("Warning") ) ),
483  compiler->GetLastErrorFilename().wx_str(),
484  compiler->GetLastErrorLine().wx_str(),
485  compiler->GetLastError().wx_str()
486  );
487 
488  cbMessageBox(msg, _("Test results"), wxICON_INFORMATION, this);
489 }
490 
492 {
493  if (retCode == wxID_OK)
494  {
495  m_bDirty = true;
497 
498  // make sure we update the first command, if it changed
499  CheckForChanges();
500  // write options
502  // save regexes
504  if (compiler)
505  compiler->SetRegExArray(m_Regexes);
506  }
508 }
static wxString CommandTypeDescriptions[ctCount]
Get the command type descriptions (used in advanced compiler options)
Definition: compiler.h:356
bool linkerNeedsLibExtension
Definition: compiler.h:226
virtual const RegExArray & GetRegExArray()
Get the array of regexes used in errors/warnings recognition.
Definition: compiler.h:314
DLLIMPORT wxArrayString GetArrayFromString(const wxString &text, const wxString &separator=DEFAULT_ARRAY_SEP, bool trimSpaces=true)
Definition: globals.cpp:134
void EndModal(int retCode)
Definition: sc_dialog.cpp:112
wxString PCHExtension
Definition: compiler.h:229
void OnRegexTest(wxCommandEvent &event)
#define wxICON_QUESTION
virtual wxString GetLastError()
Returns warning/error actual string.
Definition: compiler.h:291
wxString genericSwitch
Definition: compiler.h:216
wxString libDirs
Definition: compiler.h:213
void OnRegexDefaults(wxCommandEvent &event)
virtual int GetSelection() const
virtual wxString GetString(unsigned int n) const
wxString StringToControlChars(const wxString &src)
#define wxICON_ERROR
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)
Definition: globals.cpp:1465
static Compiler * GetCompiler(size_t index)
#define wxNO_DEFAULT
#define _T(string)
int filename
Definition: compiler.h:145
#define wxYES_NO
DLLIMPORT wxString GetStringFromArray(const wxArrayString &array, const wxString &separator=DEFAULT_ARRAY_SEP, bool SeparatorAtEnd=true)
Definition: globals.cpp:122
#define wxICON_INFORMATION
void SetRegExString(const wxString &str)
Definition: compiler.h:131
void OnAddExt(wxCommandEvent &event)
bool UseFullSourcePaths
Definition: compiler.h:231
CompilerLineType lt
Definition: compiler.h:143
CompilerToolsVector m_Commands[ctCount]
virtual wxString GetLastErrorLine()
Returns warning/error line number (as a string).
Definition: compiler.h:289
#define wxNOT_FOUND
wxString defines
Definition: compiler.h:215
CompilerLineType
Enum categorizing compiler&#39;s output line as warning/error/info/normal.
Definition: compiler.h:66
bool forceFwdSlashes
Definition: compiler.h:218
std::vector< RegExStruct > RegExArray
Definition: compiler.h:163
virtual void SetRegExArray(const RegExArray &regexes)
Set the array of regexes used in errors/warnings recognition.
Definition: compiler.h:331
wxString ControlCharsToString(const wxString &src)
Struct for compiler/linker commands.
Definition: compiler.h:249
wxString objectExtension
Definition: compiler.h:217
CompilerTool * GetCompilerTool(int cmd, int ext)
size_t Replace(const wxString &strOld, const wxString &strNew, bool replaceAll=true)
void OnRegexDelete(wxCommandEvent &event)
wxChar includeDirSeparator
Definition: compiler.h:240
wxString libExtension
Definition: compiler.h:224
wxChar objectSeparator
Definition: compiler.h:242
wxString linkLibs
Definition: compiler.h:214
const wxStringCharType * wx_str() const
wxString includeDirs
Definition: compiler.h:212
wxString wxEmptyString
wxString command
command to execute
Definition: compiler.h:262
virtual void LoadDefaultRegExArray(bool globalPrecedence=false)
Load the default (preset) array of regexes used in errors/warnings recognition.
Definition: compiler.cpp:183
const wxString & _(const wxString &string)
wxString & Trim(bool fromRight=true)
void OnRegexChange(wxCommandEvent &event)
CommandType
Helper enum to retrieve compiler commands.
Definition: compiler.h:166
Abstract base class for compilers.
Definition: compiler.h:274
DLLIMPORT const wxString DEFAULT_ARRAY_SEP
Definition: globals.cpp:56
wxString libPrefix
Definition: compiler.h:223
bool IsEmpty() const
virtual CompilerLineType CheckForWarningsAndErrors(const wxString &line)
Check if the supplied string is a compiler warning/error.
Definition: compiler.cpp:773
bool forceLinkerUseQuotes
Definition: compiler.h:219
void OnRegexAdd(wxCommandEvent &event)
void OnCommandsChange(wxCommandEvent &event)
virtual const CompilerSwitches & GetSwitches() const
Get the compiler&#39;s generic switches.
Definition: compiler.h:301
wxChar libDirSeparator
Definition: compiler.h:241
virtual CompilerToolsVector & GetCommandToolsVector(CommandType ct)
Get a command tool vector based on CommandType (used by advanced compiler dialog) ...
Definition: compiler.h:312
virtual wxString GetLastErrorFilename()
Returns warning/error filename.
Definition: compiler.h:287
wxString GetRegExString() const
Definition: compiler.h:130
bool linkerNeedsLibPrefix
Definition: compiler.h:225
bool m_bDirty
Have changes being made to settings in the dialog.
static wxXmlResource * Get()
virtual void SetSwitches(const CompilerSwitches &switches)
Set the compiler&#39;s generic switches.
Definition: compiler.h:327
void OnExtChange(wxCommandEvent &event)
wxString desc
Definition: compiler.h:142
int Printf(const wxString &pszFormat,...)
virtual void SetSelection(int n)
bool forceCompilerUseQuotes
Definition: compiler.h:220
Struct to keep switches.
Definition: compiler.h:209
Do NOT use.
Definition: compiler.h:177
void OnDelExt(wxCommandEvent &event)
wxObject * LoadObject(wxWindow *parent, const wxString &name, const wxString &classname)
bool needDependencies
Definition: compiler.h:221
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
bool linkerNeedsPathResolved
Definition: compiler.h:227
virtual int FindString(const wxString &s, bool bCase=false) const
int msg[3]
Definition: compiler.h:144
bool UseFlatObjects
Definition: compiler.h:230