1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
/*
* This file is part of the Code::Blocks IDE and licensed under the GNU General Public License, version 3
* http://www.gnu.org/licenses/gpl-3.0.html
*/
#ifndef COMPILEROPTIONSDLG_H
#define COMPILEROPTIONSDLG_H
#include <vector>
#include <wx/intl.h>
#include <wx/string.h>
#include "configurationpanel.h"
#include "compileroptions.h"
class wxListBox;
class ScopeTreeData;
class cbProject;
class ProjectBuildTarget;
class CompilerGCC;
class wxSpinEvent;
class wxTreeEvent;
class wxCommandEvent;
class wxKeyEvent;
class wxPropertyGrid;
class wxPropertyGridEvent;
class wxUpdateUIEvent;
class CompilerOptionsDlg : public cbConfigurationPanel
{
public:
CompilerOptionsDlg(wxWindow* parent, CompilerGCC* compiler, cbProject* project = 0L, ProjectBuildTarget* target = 0L);
~CompilerOptionsDlg();
virtual wxString GetTitle() const { return _("Global compiler settings"); }
virtual wxString GetBitmapBaseName() const { return _T("compiler"); }
virtual void OnApply();
virtual void OnCancel(){}
private:
enum CustomVarActionType
{
CVA_Add,
CVA_Edit,
CVA_Remove
};
struct CustomVarAction
{
CustomVarActionType m_Action;
wxString m_Key;
wxString m_KeyValue;
};
void TextToOptions();
void OptionsToText();
void DoFillCompilerSets(int compilerIdx);
void DoFillCompilerPrograms();
void DoFillVars();
void DoFillOthers();
void DoFillOptions();
void DoFillCompilerDependentSettings();
void DoSaveCompilerDependentSettings();
void DoFillTree();
void DoSaveOptions();
void DoLoadOptions();
void DoSaveCompilerPrograms();
void DoSaveVars();
void DoSaveCompilerDefinition();
void CompilerChanged();
void UpdateCompilerForTargets(int compilerIdx);
void AutoDetectCompiler();
wxListBox* GetDirsListBox();
CompileOptionsBase* GetVarsOwner();
void ProjectTargetCompilerAdjust(); //!< checks if compiler changed for project/target and takes actions accordingly
void OnRealApply(); // user clicked the "Apply" button (so not the Ok button !!!)
void OnTreeSelectionChange(wxTreeEvent& event);
void OnTreeSelectionChanging(wxTreeEvent& event);
void OnCompilerChanged(wxCommandEvent& event);
void OnCategoryChanged(wxCommandEvent& event);
void OnOptionChanged(wxPropertyGridEvent& event);
void OnAddDirClick(wxCommandEvent& event);
void OnEditDirClick(wxCommandEvent& event);
void OnRemoveDirClick(wxCommandEvent& event);
void OnClearDirClick(wxCommandEvent& event);
void OnCopyDirsClick(wxCommandEvent& event);
void OnAddVarClick(wxCommandEvent& event);
void OnEditVarClick(wxCommandEvent& event);
void OnRemoveVarClick(wxCommandEvent& event);
void OnClearVarClick(wxCommandEvent& event);
void OnSetDefaultCompilerClick(wxCommandEvent& event);
void OnAddCompilerClick(wxCommandEvent& event);
void OnEditCompilerClick(wxCommandEvent& event);
void OnRemoveCompilerClick(wxCommandEvent& event);
void OnResetCompilerClick(wxCommandEvent& event);
void OnAddLibClick(wxCommandEvent& event);
void OnEditLibClick(wxCommandEvent& event);
void OnRemoveLibClick(wxCommandEvent& event);
void OnClearLibClick(wxCommandEvent& event);
void OnCopyLibsClick(wxCommandEvent& event);
void OnMoveLibUpClick(wxSpinEvent& event);
void OnMoveLibDownClick(wxSpinEvent& event);
void OnMoveDirUpClick(wxSpinEvent& event);
void OnMoveDirDownClick(wxSpinEvent& event);
void OnMasterPathClick(wxCommandEvent& event);
void OnAutoDetectClick(wxCommandEvent& event);
void OnSelectProgramClick(wxCommandEvent& event);
void OnAdvancedClick(wxCommandEvent& event);
void OnAddExtraPathClick(wxCommandEvent& event);
void OnEditExtraPathClick(wxCommandEvent& event);
void OnRemoveExtraPathClick(wxCommandEvent& event);
void OnClearExtraPathClick(wxCommandEvent& event);
void OnIgnoreAddClick(wxCommandEvent& event);
void OnIgnoreRemoveClick(wxCommandEvent& event);
void OnUpdateUI(wxUpdateUIEvent& event);
void OnDirty(wxCommandEvent& event); // some controls who change their value -> dirty
void OnMyCharHook(wxKeyEvent& event);
void OnFlagsPopup(wxPropertyGridEvent& event);
void OnFlagsPopupClick(wxCommandEvent& event);
void OnOptionDoubleClick(wxPropertyGridEvent& event);
private:
wxPropertyGrid* m_FlagsPG;
CompilerGCC* m_Compiler;
CompilerOptions m_Options;
wxArrayString m_LinkerOptions;
wxArrayString m_LinkLibs;
wxArrayString m_CompilerOptions;
wxArrayString m_ResourceCompilerOptions;
int m_CurrentCompilerIdx;
cbProject* m_pProject;
ProjectBuildTarget* m_pTarget;
bool m_bDirty; //!< true if a setting has changed since last save
bool m_bFlagsDirty; //!< true if a flag (not its value) has changed since last save
std::vector<CustomVarAction> m_CustomVarActions; //!< the actions carried out on the custom vars that need to be saved/applied
wxString m_NewProjectOrTargetCompilerId; //!< keeps track of the changes of compiler of the selected project/target
bool m_BuildingTree; //!< flag to ignore tree changing events while building it
static int m_MenuOption;
DECLARE_EVENT_TABLE()
};
#endif // COMPILEROPTIONSDLG_H
|