Code::Blocks  SVN r11506
databreakpointdlg.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: 10655 $
6  * $Id: databreakpointdlg.cpp 10655 2016-01-17 13:58:05Z fuscated $
7  * $HeadURL: https://svn.code.sf.net/p/codeblocks/code/trunk/src/plugins/debuggergdb/databreakpointdlg.cpp $
8  */
9 
10 #include "databreakpointdlg.h"
11 #include "debugger_defs.h"
12 
13 //(*InternalHeaders(DataBreakpointDlg)
14 #include <wx/button.h>
15 #include <wx/string.h>
16 #include <wx/intl.h>
17 //*)
18 
19 //(*IdInit(DataBreakpointDlg)
23 //*)
24 
25 BEGIN_EVENT_TABLE(DataBreakpointDlg,wxScrollingDialog)
26  //(*EventTable(DataBreakpointDlg)
27  //*)
28 END_EVENT_TABLE()
29 
30 DataBreakpointDlg::DataBreakpointDlg(wxWindow *parent, const wxString& dataExpression, bool enabled, int selection)
31 {
32  //(*Initialize(DataBreakpointDlg)
33  wxBoxSizer* bszMain;
34 
35  Create(parent, wxID_ANY, _("Data breakpoint"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE, _T("wxID_ANY"));
36  bszMain = new wxBoxSizer(wxVERTICAL);
37  m_enabled = new wxCheckBox(this, ID_CHK_ENABLED, _("Enabled"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_CHK_ENABLED"));
38  m_enabled->SetValue(false);
39  bszMain->Add(m_enabled, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND, 8);
40  m_dataExpression = new wxTextCtrl(this, ID_TXT_DATA_EXPRESION, wxEmptyString, wxDefaultPosition, wxSize(265,23), wxTE_PROCESS_ENTER, wxDefaultValidator, _T("ID_TXT_DATA_EXPRESION"));
41  m_dataExpression->SetFocus();
42  bszMain->Add(m_dataExpression, 1, wxTOP|wxLEFT|wxRIGHT|wxEXPAND, 8);
43  wxString __wxRadioBoxChoices_1[3] =
44  {
45  _("Break on read"),
46  _("Break on write"),
47  _("Break on read or write")
48  };
49  m_condition = new wxRadioBox(this, ID_RDO_CONDITION, _("Condition"), wxDefaultPosition, wxDefaultSize, 3, __wxRadioBoxChoices_1, 1, 0, wxDefaultValidator, _T("ID_RDO_CONDITION"));
50  bszMain->Add(m_condition, 0, wxTOP|wxLEFT|wxRIGHT|wxEXPAND, 8);
51  StdDialogButtonSizer1 = new wxStdDialogButtonSizer();
52  StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_OK, wxEmptyString));
53  StdDialogButtonSizer1->AddButton(new wxButton(this, wxID_CANCEL, wxEmptyString));
54  StdDialogButtonSizer1->Realize();
55  bszMain->Add(StdDialogButtonSizer1, 0, wxALL|wxEXPAND, 8);
56  SetSizer(bszMain);
57  bszMain->Fit(this);
58  bszMain->SetSizeHints(this);
59  Center();
60  //*)
61 
62  m_enabled->SetValue(enabled);
63  m_condition->SetSelection(selection);
64  m_dataExpression->SetValue(dataExpression);
65 }
66 
68 {
69  //(*Destroy(DataBreakpointDlg)
70  //*)
71 }
72 
74 {
75  return m_enabled->IsChecked();
76 }
77 
79 {
80  return m_condition->GetSelection();
81 }
82 
84 {
85  return CleanStringValue(m_dataExpression->GetValue());
86 }
wxSize Fit(wxWindow *window)
int wxNewId()
const wxValidator wxDefaultValidator
wxTextCtrl * m_dataExpression
wxRadioBox * m_condition
#define wxTE_PROCESS_ENTER
#define _T(string)
static const long ID_RDO_CONDITION
wxSizerItem * Add(wxWindow *window, const wxSizerFlags &flags)
const wxSize wxDefaultSize
const wxPoint wxDefaultPosition
wxCheckBox * m_enabled
#define wxDEFAULT_DIALOG_STYLE
wxString wxEmptyString
static const long ID_TXT_DATA_EXPRESION
const wxString & _(const wxString &string)
bool IsChecked() const
wxString CleanStringValue(wxString value)
void SetSizeHints(wxWindow *window)
static const long ID_CHK_ENABLED
wxString GetDataExpression() const
virtual int GetSelection() const