Code::Blocks  SVN r11506
editbreakpointdlg.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: editbreakpointdlg.cpp 10912 2016-09-25 16:10:13Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/debuggergdb/editbreakpointdlg.cpp $
8  */
9 
10 #include <sdk.h>
11 #ifndef CB_PRECOMP
12  #include <wx/checkbox.h>
13  #include <wx/intl.h>
14  #include <wx/button.h>
15  #include <wx/listbox.h>
16  #include <wx/spinctrl.h>
17  #include <wx/textctrl.h>
18  #include <wx/xrc/xmlres.h>
19 
20  #include <debuggermanager.h>
21 #endif
22 
23 #include "editbreakpointdlg.h"
24 
25 BEGIN_EVENT_TABLE(EditBreakpointDlg, wxScrollingDialog)
26  EVT_UPDATE_UI(-1, EditBreakpointDlg::OnUpdateUI)
27 END_EVENT_TABLE()
28 
30  : m_breakpoint(breakpoint)
31 {
32  //ctor
33  wxXmlResource::Get()->LoadObject(this, parent, _T("dlgEditBreakpoint"),_T("wxScrollingDialog"));
34 
35  XRCCTRL(*this, "chkEnabled", wxCheckBox)->SetValue(m_breakpoint.enabled);
36  XRCCTRL(*this, "chkIgnore", wxCheckBox)->SetValue(m_breakpoint.useIgnoreCount);
37  XRCCTRL(*this, "spnIgnoreCount", wxSpinCtrl)->SetValue(m_breakpoint.ignoreCount);
38  XRCCTRL(*this, "chkExpr", wxCheckBox)->SetValue(m_breakpoint.useCondition);
39  XRCCTRL(*this, "txtExpr", wxTextCtrl)->SetValue(m_breakpoint.condition);
40  XRCCTRL(*this, "wxID_OK", wxButton)->SetDefault();
41 
42  // Limit vertical resizing.
43  SetMaxSize(wxSize(-1, GetMinHeight()));
44 }
45 
47 {
48  //dtor
49 }
50 
51 void EditBreakpointDlg::EndModal(int retCode)
52 {
53  if (retCode == wxID_OK)
54  {
55  m_breakpoint.enabled = XRCCTRL(*this, "chkEnabled", wxCheckBox)->GetValue();
56  m_breakpoint.useIgnoreCount = XRCCTRL(*this, "chkIgnore", wxCheckBox)->IsChecked();
57  m_breakpoint.ignoreCount = XRCCTRL(*this, "spnIgnoreCount", wxSpinCtrl)->GetValue();
58  m_breakpoint.useCondition = XRCCTRL(*this, "chkExpr", wxCheckBox)->IsChecked();
59  m_breakpoint.condition = CleanStringValue(XRCCTRL(*this, "txtExpr", wxTextCtrl)->GetValue());
60  }
62 }
63 
65 {
66  bool en = XRCCTRL(*this, "chkEnabled", wxCheckBox)->IsChecked();
67  XRCCTRL(*this, "chkIgnore", wxCheckBox)->Enable(en && !XRCCTRL(*this, "chkExpr", wxCheckBox)->IsChecked());
68  XRCCTRL(*this, "spnIgnoreCount", wxSpinCtrl)->Enable(en && XRCCTRL(*this, "chkIgnore", wxCheckBox)->IsChecked());
69  XRCCTRL(*this, "chkExpr", wxCheckBox)->Enable(en && !XRCCTRL(*this, "chkIgnore", wxCheckBox)->IsChecked());
70  XRCCTRL(*this, "txtExpr", wxTextCtrl)->Enable(en && XRCCTRL(*this, "chkExpr", wxCheckBox)->IsChecked());
71 }
void EndModal(int retCode)
Definition: sc_dialog.cpp:112
int ignoreCount
The number of passes before this breakpoint should hit. useIgnoreCount must be true.
wxString condition
The condition that must be met for the breakpoint to hit. useCondition must be true.
Debugger breakpoint interface.
#define _T(string)
DebuggerBreakpoint m_breakpoint
bool useIgnoreCount
Should this breakpoint be ignored for the first X passes? (x == ignoreCount)
bool useCondition
Should this breakpoint hit only if a specific condition is met?
void OnUpdateUI(wxUpdateUIEvent &event)
wxString CleanStringValue(wxString value)
bool enabled
Is the breakpoint enabled?
static wxXmlResource * Get()
void EndModal(int retCode)
wxObject * LoadObject(wxWindow *parent, const wxString &name, const wxString &classname)