forked from eranif/codelite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
external_tools.cpp
191 lines (143 loc) · 8.79 KB
/
external_tools.cpp
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
//////////////////////////////////////////////////////////////////////
// This file was auto-generated by codelite's wxCrafter Plugin
// wxCrafter project file: external_tools.wxcp
// Do not modify this file by hand!
//////////////////////////////////////////////////////////////////////
#include "external_tools.h"
// Declare the bitmap loading function
extern void wxC403FInitBitmapResources();
static bool bBitmapLoaded = false;
ExternalToolBaseDlg::ExternalToolBaseDlg(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);
wxC403FInitBitmapResources();
bBitmapLoaded = true;
}
wxBoxSizer* bSizer6 = new wxBoxSizer(wxVERTICAL);
this->SetSizer(bSizer6);
wxBoxSizer* bSizer8 = new wxBoxSizer(wxHORIZONTAL);
bSizer6->Add(bSizer8, 1, wxEXPAND, 5);
m_listCtrlTools = new wxListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1, -1), wxLC_VRULES|wxLC_HRULES|wxLC_SINGLE_SEL|wxLC_REPORT);
m_listCtrlTools->SetFocus();
bSizer8->Add(m_listCtrlTools, 1, wxALL|wxEXPAND, 5);
wxBoxSizer* bSizer9 = new wxBoxSizer(wxVERTICAL);
bSizer8->Add(bSizer9, 0, 0, 5);
m_buttonNewTool = new wxButton(this, wxID_ANY, _("New..."), wxDefaultPosition, wxSize(-1, -1), 0);
bSizer9->Add(m_buttonNewTool, 0, wxALL, 5);
m_buttonEdit = new wxButton(this, wxID_ANY, _("Edit..."), wxDefaultPosition, wxSize(-1, -1), 0);
bSizer9->Add(m_buttonEdit, 0, wxALL, 5);
m_buttonDelete = new wxButton(this, wxID_ANY, _("Delete..."), wxDefaultPosition, wxSize(-1, -1), 0);
bSizer9->Add(m_buttonDelete, 0, wxALL, 5);
m_stdBtnSizer2 = new wxStdDialogButtonSizer();
bSizer6->Add(m_stdBtnSizer2, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5);
m_button4 = new wxButton(this, wxID_OK, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
m_button4->SetDefault();
m_stdBtnSizer2->AddButton(m_button4);
m_button6 = new wxButton(this, wxID_CANCEL, wxT(""), wxDefaultPosition, wxSize(-1, -1), 0);
m_stdBtnSizer2->AddButton(m_button6);
m_stdBtnSizer2->Realize();
SetName(wxT("ExternalToolBaseDlg"));
SetSize(-1,-1);
if (GetSizer()) {
GetSizer()->Fit(this);
}
if(GetParent()) {
CentreOnParent(wxBOTH);
} else {
CentreOnScreen(wxBOTH);
}
#if wxVERSION_NUMBER >= 2900
if(!wxPersistenceManager::Get().Find(this)) {
wxPersistenceManager::Get().RegisterAndRestore(this);
} else {
wxPersistenceManager::Get().Restore(this);
}
#endif
// Connect events
m_listCtrlTools->Connect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(ExternalToolBaseDlg::OnItemActivated), NULL, this);
m_listCtrlTools->Connect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(ExternalToolBaseDlg::OnItemDeSelected), NULL, this);
m_listCtrlTools->Connect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ExternalToolBaseDlg::OnItemSelected), NULL, this);
m_buttonNewTool->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolBaseDlg::OnButtonNew), NULL, this);
m_buttonNewTool->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolBaseDlg::OnButtonNewUI), NULL, this);
m_buttonEdit->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolBaseDlg::OnButtonEdit), NULL, this);
m_buttonEdit->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolBaseDlg::OnButtonEditUI), NULL, this);
m_buttonDelete->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolBaseDlg::OnButtonDelete), NULL, this);
m_buttonDelete->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolBaseDlg::OnButtonDeleteUI), NULL, this);
}
ExternalToolBaseDlg::~ExternalToolBaseDlg()
{
m_listCtrlTools->Disconnect(wxEVT_COMMAND_LIST_ITEM_ACTIVATED, wxListEventHandler(ExternalToolBaseDlg::OnItemActivated), NULL, this);
m_listCtrlTools->Disconnect(wxEVT_COMMAND_LIST_ITEM_DESELECTED, wxListEventHandler(ExternalToolBaseDlg::OnItemDeSelected), NULL, this);
m_listCtrlTools->Disconnect(wxEVT_COMMAND_LIST_ITEM_SELECTED, wxListEventHandler(ExternalToolBaseDlg::OnItemSelected), NULL, this);
m_buttonNewTool->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolBaseDlg::OnButtonNew), NULL, this);
m_buttonNewTool->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolBaseDlg::OnButtonNewUI), NULL, this);
m_buttonEdit->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolBaseDlg::OnButtonEdit), NULL, this);
m_buttonEdit->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolBaseDlg::OnButtonEditUI), NULL, this);
m_buttonDelete->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolBaseDlg::OnButtonDelete), NULL, this);
m_buttonDelete->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolBaseDlg::OnButtonDeleteUI), NULL, this);
}
ExternalToolsManagerBase::ExternalToolsManagerBase(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);
wxC403FInitBitmapResources();
bBitmapLoaded = true;
}
wxBoxSizer* boxSizer10 = new wxBoxSizer(wxVERTICAL);
this->SetSizer(boxSizer10);
wxBoxSizer* boxSizer19 = new wxBoxSizer(wxHORIZONTAL);
boxSizer10->Add(boxSizer19, 1, wxALL|wxEXPAND, 5);
m_dvListCtrlTasks = new wxDataViewListCtrl(this, wxID_ANY, wxDefaultPosition, wxSize(-1,-1), wxDV_VERT_RULES|wxDV_ROW_LINES|wxDV_MULTIPLE|wxDV_SINGLE);
m_dvListCtrlTasks->SetFocus();
boxSizer19->Add(m_dvListCtrlTasks, 1, wxALL|wxEXPAND, 5);
m_dvListCtrlTasks->AppendIconTextColumn(_("PID"), wxDATAVIEW_CELL_INERT, 100, wxALIGN_LEFT);
m_dvListCtrlTasks->AppendTextColumn(_("Command"), wxDATAVIEW_CELL_INERT, -2, wxALIGN_LEFT);
wxBoxSizer* boxSizer21 = new wxBoxSizer(wxVERTICAL);
boxSizer19->Add(boxSizer21, 0, wxEXPAND, 5);
m_buttonKill = new wxButton(this, wxID_STOP, _("Stop"), wxDefaultPosition, wxSize(-1,-1), 0);
boxSizer21->Add(m_buttonKill, 0, wxALL, 5);
m_buttonKillAll = new wxButton(this, wxID_ANY, _("Stop All"), wxDefaultPosition, wxSize(-1,-1), 0);
boxSizer21->Add(m_buttonKillAll, 0, wxALL, 5);
m_buttonRefresh = new wxButton(this, wxID_REFRESH, _("Refresh"), wxDefaultPosition, wxSize(-1,-1), 0);
boxSizer21->Add(m_buttonRefresh, 0, wxALL, 5);
boxSizer21->Add(0, 0, 1, wxALL, 5);
m_button33 = new wxButton(this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize(-1,-1), 0);
boxSizer21->Add(m_button33, 0, wxALL, 5);
SetName(wxT("ExternalToolsManagerBase"));
SetMinClientSize(wxSize(500,300));
SetSize(500,300);
if (GetSizer()) {
GetSizer()->Fit(this);
}
if(GetParent()) {
CentreOnParent(wxBOTH);
} else {
CentreOnScreen(wxBOTH);
}
#if wxVERSION_NUMBER >= 2900
if(!wxPersistenceManager::Get().Find(this)) {
wxPersistenceManager::Get().RegisterAndRestore(this);
} else {
wxPersistenceManager::Get().Restore(this);
}
#endif
// Connect events
m_buttonKill->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolsManagerBase::OnKill), NULL, this);
m_buttonKill->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolsManagerBase::OnKillUI), NULL, this);
m_buttonKillAll->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolsManagerBase::OnKillAll), NULL, this);
m_buttonKillAll->Connect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolsManagerBase::OnKillAllUI), NULL, this);
m_buttonRefresh->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolsManagerBase::OnRefresh), NULL, this);
}
ExternalToolsManagerBase::~ExternalToolsManagerBase()
{
m_buttonKill->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolsManagerBase::OnKill), NULL, this);
m_buttonKill->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolsManagerBase::OnKillUI), NULL, this);
m_buttonKillAll->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolsManagerBase::OnKillAll), NULL, this);
m_buttonKillAll->Disconnect(wxEVT_UPDATE_UI, wxUpdateUIEventHandler(ExternalToolsManagerBase::OnKillAllUI), NULL, this);
m_buttonRefresh->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(ExternalToolsManagerBase::OnRefresh), NULL, this);
}