34
35
//-------------------------------------------------------------------
35
36
DebuggerPage::DebuggerPage(wxWindow *parent, wxString title)
37
: DebuggerPageBase(parent)
39
wxBoxSizer *sz = new wxBoxSizer(wxVERTICAL);
42
wxFlexGridSizer* fgSizer2;
43
fgSizer2 = new wxFlexGridSizer( 2, 2, 0, 0 );
45
fgSizer2->AddGrowableCol( 1 );
46
fgSizer2->SetFlexibleDirection( wxBOTH );
47
fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED );
48
sz->Add(fgSizer2, 0, wxEXPAND|wxALL);
50
wxStaticText *m_staticText2 = new wxStaticText( this, wxID_ANY, wxT("Debugger Path:"), wxDefaultPosition, wxDefaultSize, 0 );
51
m_staticText2->Wrap( -1 );
52
fgSizer2->Add( m_staticText2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
54
m_filePicker = new FilePicker( this );
55
fgSizer2->Add( m_filePicker, 0, wxALL|wxEXPAND, 5 );
57
m_checkBoxEnableLog = new wxCheckBox( this, wxID_ANY, wxT("Enable full debugger logging"), wxDefaultPosition, wxDefaultSize, 0 );
58
sz->Add(m_checkBoxEnableLog, 0, wxEXPAND|wxALL, 5);
60
m_checkBoxEnablePendingBreakpoints = new wxCheckBox(this, wxID_ANY, wxT("Enable pending breakpoint"), wxDefaultPosition, wxDefaultSize, 0 );
61
sz->Add(m_checkBoxEnablePendingBreakpoints, 0, wxEXPAND|wxALL, 5);
63
m_checkBreakAtWinMain = new wxCheckBox(this, wxID_ANY, wxT("Automatically set breakpoint at main"), wxDefaultPosition, wxDefaultSize, 0 );
64
sz->Add(m_checkBreakAtWinMain, 0, wxEXPAND|wxALL, 5);
66
m_checkResolveStarThis = new wxCheckBox(this, wxID_ANY, wxT("Resolve '*this' in the 'Locals' view"), wxDefaultPosition, wxDefaultSize, 0 );
67
sz->Add(m_checkResolveStarThis, 0, wxEXPAND|wxALL, 5);
69
m_checkShowTerminal = new wxCheckBox(this, wxID_ANY, wxT("Show debugger terminal"), wxDefaultPosition, wxDefaultSize, 0 );
70
sz->Add(m_checkShowTerminal, 0, wxEXPAND|wxALL, 5);
72
m_checkUseRelativePaths = new wxCheckBox(this, wxID_ANY, wxT("Use file name only for breakpoints (NO full paths)"), wxDefaultPosition, wxDefaultSize, 0 );
73
sz->Add(m_checkUseRelativePaths, 0, wxEXPAND|wxALL, 5);
77
40
DebuggerInformation info;
78
41
if(DebuggerMgr::Get().GetDebuggerInformation(m_title, info)){
79
m_filePicker->SetPath(info.path);
42
m_textCtrDbgPath->SetValue(info.path);
80
43
m_checkBoxEnableLog->SetValue(info.enableDebugLog);
81
44
m_checkBoxEnablePendingBreakpoints->SetValue(info.enablePendingBreakpoints);
82
45
m_checkBreakAtWinMain->SetValue(info.breakAtWinMain);
83
m_checkResolveStarThis->SetValue(info.resolveThis);
84
46
m_checkShowTerminal->SetValue(info.showTerminal);
85
47
m_checkUseRelativePaths->SetValue(info.useRelativeFilePaths);
48
m_catchThrow->SetValue(info.catchThrow);
49
m_spinCtrlNumElements->SetValue(info.maxDisplayStringSize);
50
m_showTooltips->SetValue(info.showTooltips);
51
m_textCtrlStartupCommands->SetValue( info.startupCommands );
53
m_checkBoxExpandLocals->SetValue(info.resolveLocals);
55
m_checkBoxDebugAssert->SetValue(info.debugAsserts);
60
m_checkBoxDebugAssert->SetValue(false);
61
m_checkBoxDebugAssert->Enable(false);
89
66
DebuggerPage::~DebuggerPage()
70
void DebuggerPage::OnBrowse(wxCommandEvent& e)
73
wxString newfilepath, filepath(m_textCtrDbgPath->GetValue());
74
if ((!filepath.IsEmpty()) && wxFileName::FileExists(filepath)) {
75
newfilepath = wxFileSelector(wxT("Select file:"), filepath.c_str());
77
newfilepath = wxFileSelector(wxT("Select file:"));
80
if (!newfilepath.IsEmpty()) {
81
m_textCtrDbgPath->SetValue(newfilepath);
85
void DebuggerPage::OnDebugAssert(wxCommandEvent& e)
87
if ( e.IsChecked() ) {
88
m_checkBoxEnablePendingBreakpoints->SetValue(true);
93
92
//-------------------------------------------------------------------
95
94
DebuggerSettingsDlg::DebuggerSettingsDlg( wxWindow* parent )
126
127
std::vector<DebuggerCmdData> cmds = m_data.GetCmds();
127
128
for (size_t i=0; i<cmds.size(); i++) {
128
129
DebuggerCmdData cmd = cmds.at(i);
129
wxString subMenu(wxT("No"));
131
if (cmd.GetIsSubMenu()) {
132
subMenu = wxT("Yes");
135
131
long item = AppendListCtrlRow(m_listCtrl1);
136
132
SetColumnText(m_listCtrl1, item, 0, cmd.GetName());
137
133
SetColumnText(m_listCtrl1, item, 1, cmd.GetCommand());
138
SetColumnText(m_listCtrl1, item, 2, subMenu);
134
SetColumnText(m_listCtrl1, item, 2, cmd.GetDbgCommand());
140
136
m_listCtrl1->SetColumnWidth(0, 100);
141
137
m_listCtrl1->SetColumnWidth(1, 200);
153
149
DebuggerMgr::Get().GetDebuggerInformation(page->m_title, info);
155
151
//populate the information and save it
156
info.enableDebugLog = page->m_checkBoxEnableLog->GetValue();
152
info.enableDebugLog = page->m_checkBoxEnableLog->GetValue();
157
153
info.enablePendingBreakpoints = page->m_checkBoxEnablePendingBreakpoints->GetValue();
158
info.path = page->m_filePicker->GetPath();
159
info.name = page->m_title;
160
info.breakAtWinMain = page->m_checkBreakAtWinMain->IsChecked();
161
info.resolveThis = page->m_checkResolveStarThis->IsChecked();
162
info.showTerminal = page->m_checkShowTerminal->IsChecked();
163
info.consoleCommand = EditorConfigST::Get()->GetOptions()->GetProgramConsoleCommand();
164
info.useRelativeFilePaths = page->m_checkUseRelativePaths->IsChecked();
154
info.path = page->m_textCtrDbgPath->GetValue();
155
info.name = page->m_title;
156
info.breakAtWinMain = page->m_checkBreakAtWinMain->IsChecked();
157
info.showTerminal = page->m_checkShowTerminal->IsChecked();
158
info.consoleCommand = EditorConfigST::Get()->GetOptions()->GetProgramConsoleCommand();
159
info.useRelativeFilePaths = page->m_checkUseRelativePaths->IsChecked();
160
info.catchThrow = page->m_catchThrow->IsChecked();
161
info.showTooltips = page->m_showTooltips->IsChecked();
162
info.startupCommands = page->m_textCtrlStartupCommands->GetValue();
163
info.maxDisplayStringSize = page->m_spinCtrlNumElements->GetValue();
164
info.resolveLocals = page->m_checkBoxExpandLocals->IsChecked();
166
info.debugAsserts = page->m_checkBoxDebugAssert->IsChecked();
166
168
DebuggerMgr::Get().SetDebuggerInformation(page->m_title, info);
171
173
std::vector<DebuggerCmdData> cmdArr;
172
174
for(int i=0; i<count; i++){
173
175
DebuggerCmdData cmd;
174
cmd.SetName( GetColumnText(m_listCtrl1, i, 0) );
175
cmd.SetCommand( GetColumnText(m_listCtrl1, i, 1) );
177
cmd.SetIsSubMenu( false );
178
if(GetColumnText(m_listCtrl1, i, 2) == wxT("Yes")){
179
cmd.SetIsSubMenu( true );
176
cmd.SetName ( GetColumnText(m_listCtrl1, i, 0) );
177
cmd.SetCommand ( GetColumnText(m_listCtrl1, i, 1) );
178
cmd.SetDbgCommand( GetColumnText(m_listCtrl1, i, 2) );
182
179
cmdArr.push_back(cmd);
184
181
m_data.SetCmds(cmdArr);
228
218
info.SetColumn(0);
229
219
item = m_listCtrl1->InsertItem(info);
231
SetColumnText(m_listCtrl1, item, 0, name);
232
SetColumnText(m_listCtrl1, item, 1, cmd);
233
SetColumnText(m_listCtrl1, item, 2, subMenu);
221
SetColumnText(m_listCtrl1, item, 0, name );
222
SetColumnText(m_listCtrl1, item, 1, expression );
223
SetColumnText(m_listCtrl1, item, 2, dbgCmd);
235
225
m_listCtrl1->SetColumnWidth(0, 100);
236
m_listCtrl1->SetColumnWidth(1, 400);
237
m_listCtrl1->SetColumnWidth(2, 100);
226
m_listCtrl1->SetColumnWidth(1, 200);
227
m_listCtrl1->SetColumnWidth(1, 200);
279
269
//popup edit dialog
280
DbgCommandDlg *dlg = new DbgCommandDlg(this);
281
wxString name = GetColumnText(m_listCtrl1, m_selectedItem, 0);
282
wxString cmd = GetColumnText(m_listCtrl1, m_selectedItem, 1);
283
wxString sm = GetColumnText(m_listCtrl1, m_selectedItem, 2);
286
if (sm == wxT("Yes")) {
291
dlg->SetCommand(cmd);
292
dlg->SetAsSubMenu(subMenu);
294
if (dlg->ShowModal() == wxID_OK) {
297
if (dlg->IsSubMenu()) {
301
SetColumnText(m_listCtrl1, m_selectedItem, 0, dlg->GetName());
302
SetColumnText(m_listCtrl1, m_selectedItem, 1, dlg->GetCommand());
303
SetColumnText(m_listCtrl1, m_selectedItem, 2, sm);
270
DbgCommandDlg dlg(this);
272
wxString name = GetColumnText(m_listCtrl1, m_selectedItem, 0);
273
wxString expr = GetColumnText(m_listCtrl1, m_selectedItem, 1);
274
wxString dbgCmd= GetColumnText(m_listCtrl1, m_selectedItem, 2);
277
dlg.SetExpression(expr);
278
dlg.SetDbgCommand(dbgCmd);
280
if (dlg.ShowModal() == wxID_OK) {
281
SetColumnText(m_listCtrl1, m_selectedItem, 0, dlg.GetName());
282
SetColumnText(m_listCtrl1, m_selectedItem, 1, dlg.GetExpression());
283
SetColumnText(m_listCtrl1, m_selectedItem, 2, dlg.GetDbgCommand());
309
287
void DebuggerSettingsDlg::DoDeleteItem()