forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcppchecksettingsdlgbase.cpp
More file actions
201 lines (162 loc) · 7.67 KB
/
Copy pathcppchecksettingsdlgbase.cpp
File metadata and controls
201 lines (162 loc) · 7.67 KB
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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: cppchecksettingsdlg.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////
#include "cppchecksettingsdlgbase.h"
// Declare the bitmap loading function
extern void wxCrafterRo2g8MInitBitmapResources();
namespace
{
// return the wxBORDER_SIMPLE that matches the current application theme
wxBorder get_border_simple_theme_aware_bit()
{
#if wxVERSION_NUMBER >= 3300 && defined(__WXMSW__)
return wxSystemSettings::GetAppearance().IsDark() ? wxBORDER_SIMPLE : wxBORDER_DEFAULT;
#else
return wxBORDER_DEFAULT;
#endif
} // DoGetBorderSimpleBit
bool bBitmapLoaded = false;
} // namespace
CppCheckSettingsDialogBase::CppCheckSettingsDialogBase(wxWindow* parent, wxWindowID id, const wxString& title,
const wxPoint& pos, const wxSize& size, long style)
: wxDialog(parent, id, title, pos, size, style)
{
if(!bBitmapLoaded) {
// We need to initialise the default bitmap handler
wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
wxCrafterRo2g8MInitBitmapResources();
bBitmapLoaded = true;
}
wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
this->SetSizer(bSizer1);
m_staticText46 = new wxStaticText(this, wxID_ANY, _("Configure cppcheck command here:"), wxDefaultPosition,
wxDLG_UNIT(this, wxSize(-1, -1)), 0);
bSizer1->Add(m_staticText46, 0, wxALL, WXC_FROM_DIP(5));
m_stcCommand =
new clThemedSTC(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxBORDER_STATIC);
// Configure the fold margin
m_stcCommand->SetMarginType(4, wxSTC_MARGIN_SYMBOL);
m_stcCommand->SetMarginMask(4, wxSTC_MASK_FOLDERS);
m_stcCommand->SetMarginSensitive(4, true);
m_stcCommand->SetMarginWidth(4, 0);
// Configure the tracker margin
m_stcCommand->SetMarginWidth(1, 0);
// Configure the symbol margin
m_stcCommand->SetMarginType(2, wxSTC_MARGIN_SYMBOL);
m_stcCommand->SetMarginMask(2, ~(wxSTC_MASK_FOLDERS));
m_stcCommand->SetMarginWidth(2, 0);
m_stcCommand->SetMarginSensitive(2, true);
// Configure the line numbers margin
m_stcCommand->SetMarginType(0, wxSTC_MARGIN_NUMBER);
m_stcCommand->SetMarginWidth(0, 0);
// Configure the line symbol margin
m_stcCommand->SetMarginType(3, wxSTC_MARGIN_FORE);
m_stcCommand->SetMarginMask(3, 0);
m_stcCommand->SetMarginWidth(3, 0);
// Select the lexer
m_stcCommand->SetLexer(wxSTC_LEX_NULL);
// Set default font / styles
m_stcCommand->StyleClearAll();
m_stcCommand->SetWrapMode(1);
m_stcCommand->SetIndentationGuides(0);
m_stcCommand->SetKeyWords(0, wxT(""));
m_stcCommand->SetKeyWords(1, wxT(""));
m_stcCommand->SetKeyWords(2, wxT(""));
m_stcCommand->SetKeyWords(3, wxT(""));
m_stcCommand->SetKeyWords(4, wxT(""));
bSizer1->Add(m_stcCommand, 1, wxALL | wxEXPAND, WXC_FROM_DIP(5));
m_stdBtnSizer43 = new wxStdDialogButtonSizer();
bSizer1->Add(m_stdBtnSizer43, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(10));
m_button44 = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
m_button44->SetDefault();
m_stdBtnSizer43->AddButton(m_button44);
m_button45 = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
m_stdBtnSizer43->AddButton(m_button45);
m_stdBtnSizer43->Realize();
SetName(wxT("CppCheckSettingsDialogBase"));
SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
if(GetSizer()) {
GetSizer()->Fit(this);
}
if(GetParent()) {
CentreOnParent();
} else {
CentreOnScreen();
}
if(!wxPersistenceManager::Get().Find(this)) {
wxPersistenceManager::Get().RegisterAndRestore(this);
} else {
wxPersistenceManager::Get().Restore(this);
}
}
CppCheckSettingsDialogBase::~CppCheckSettingsDialogBase() {}
CppCheckAddSuppressionDialogBase::CppCheckAddSuppressionDialogBase(wxWindow* parent, wxWindowID id,
const wxString& title, const wxPoint& pos,
const wxSize& size, long style)
: wxDialog(parent, id, title, pos, size, style)
{
if(!bBitmapLoaded) {
// We need to initialise the default bitmap handler
wxXmlResource::Get()->AddHandler(new wxBitmapXmlHandler);
wxCrafterRo2g8MInitBitmapResources();
bBitmapLoaded = true;
}
wxBoxSizer* bSizer1 = new wxBoxSizer(wxVERTICAL);
this->SetSizer(bSizer1);
m_staticText12 = new wxStaticText(this, wxID_ANY, _("Description to show in the dialog"), wxDefaultPosition,
wxDLG_UNIT(this, wxSize(-1, -1)), 0);
bSizer1->Add(m_staticText12, 0, wxALL, WXC_FROM_DIP(5));
m_txtDescription = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
m_txtDescription->SetToolTip(
_("This is what you'll see in the settings dialog. Put whatever you like here; it's not used internally"));
#if wxVERSION_NUMBER >= 3000
m_txtDescription->SetHint(wxT(""));
#endif
bSizer1->Add(m_txtDescription, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));
m_staticText13 = new wxStaticText(this, wxID_ANY, _("The ID string that cppchecker will recognise"),
wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
bSizer1->Add(m_staticText13, 0, wxALL, WXC_FROM_DIP(5));
m_txtKey = new wxTextCtrl(this, wxID_ANY, wxT(""), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
m_txtKey->SetToolTip(
_("Enter here the unique ID string that cppchecker can recognise. Examples are \"operatorEqVarError\" and "
"\"uninitMemberVar\". You can find these by grepping the cppchecker source, or by running cppchecker on your "
"app in a terminal and passing the additional parameter '--xml'."));
#if wxVERSION_NUMBER >= 3000
m_txtKey->SetHint(wxT(""));
#endif
bSizer1->Add(m_txtKey, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));
m_staticline1 =
new wxStaticLine(this, wxID_ANY, wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), wxLI_HORIZONTAL);
bSizer1->Add(m_staticline1, 0, wxALL | wxEXPAND, WXC_FROM_DIP(5));
wxBoxSizer* bSizer2 = new wxBoxSizer(wxHORIZONTAL);
bSizer1->Add(bSizer2, 0, wxALL | wxALIGN_CENTER_HORIZONTAL, WXC_FROM_DIP(5));
m_buttonOK = new wxButton(this, wxID_OK, _("&OK"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
m_buttonOK->SetDefault();
bSizer2->Add(m_buttonOK, 0, wxALL, WXC_FROM_DIP(5));
m_buttonCancel =
new wxButton(this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDLG_UNIT(this, wxSize(-1, -1)), 0);
bSizer2->Add(m_buttonCancel, 0, wxALL, WXC_FROM_DIP(5));
SetName(wxT("CppCheckAddSuppressionDialogBase"));
SetSize(wxDLG_UNIT(this, wxSize(-1, -1)));
if(GetSizer()) {
GetSizer()->Fit(this);
}
if(GetParent()) {
CentreOnParent(wxBOTH);
} else {
CentreOnScreen(wxBOTH);
}
if(!wxPersistenceManager::Get().Find(this)) {
wxPersistenceManager::Get().RegisterAndRestore(this);
} else {
wxPersistenceManager::Get().Restore(this);
}
// Connect events
m_buttonOK->Bind(wxEVT_UPDATE_UI, &CppCheckAddSuppressionDialogBase::OnOKButtonUpdateUI, this);
}
CppCheckAddSuppressionDialogBase::~CppCheckAddSuppressionDialogBase()
{
m_buttonOK->Unbind(wxEVT_UPDATE_UI, &CppCheckAddSuppressionDialogBase::OnOKButtonUpdateUI, this);
}