Code::Blocks  SVN r11506
debuggersettingscommonpanel.cpp
Go to the documentation of this file.
1 #include "sdk.h"
3 
4 #ifndef CB_PRECOMP
5  //(*InternalHeadersPCH(DebuggerSettingsCommonPanel)
6  #include <wx/string.h>
7  #include <wx/intl.h>
8  //*)
9 
10  #include <wx/fontutil.h>
11 #endif
12 
13 #include <wx/fontdlg.h>
14 
15 #include "debuggermanager.h"
16 
17 //(*InternalHeaders(DebuggerSettingsCommonPanel)
18 //*)
19 
20 //(*IdInit(DebuggerSettingsCommonPanel)
29 //*)
30 
31 BEGIN_EVENT_TABLE(DebuggerSettingsCommonPanel,wxPanel)
32  //(*EventTable(DebuggerSettingsCommonPanel)
33  //*)
34 END_EVENT_TABLE()
35 
37 {
38  //(*Initialize(DebuggerSettingsCommonPanel)
39  wxFlexGridSizer* flexSizer;
40  wxBoxSizer* mainSizer;
41  wxButton* chooseFont;
42  wxStaticBoxSizer* valueTooltipSizer;
43  wxBoxSizer* BoxSizer1;
44  wxStaticText* labelPerspective;
45 
46  Create(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _T("wxID_ANY"));
47  mainSizer = new wxBoxSizer(wxVERTICAL);
48  flexSizer = new wxFlexGridSizer(0, 1, 0, 0);
49  m_autoBuild = new wxCheckBox(this, ID_AUTOBUILD, _("Auto-build project if it is not up-to-date"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_AUTOBUILD"));
50  m_autoBuild->SetValue(false);
51  flexSizer->Add(m_autoBuild, 1, wxTOP|wxLEFT|wxRIGHT|wxALIGN_TOP, 5);
52  m_autoSwitch = new wxCheckBox(this, ID_AUTOSWITCH, _("When stopping, auto-switch to the first frame with valid source info"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_AUTOSWITCH"));
53  m_autoSwitch->SetValue(false);
54  flexSizer->Add(m_autoSwitch, 1, wxTOP|wxLEFT|wxRIGHT|wxALIGN_TOP, 5);
55  m_debuggersLog = new wxCheckBox(this, ID_DEBUGGERS_LOG, _("Full (Debug) log"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_DEBUGGERS_LOG"));
56  m_debuggersLog->SetValue(false);
57  flexSizer->Add(m_debuggersLog, 1, wxTOP|wxLEFT|wxRIGHT|wxALIGN_TOP, 5);
58  m_jumpOnDoubleClick = new wxCheckBox(this, ID_JUMP_ON_DOUBLE_CLICK, _("Jump on Double-click in Stack trace window"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_JUMP_ON_DOUBLE_CLICK"));
59  m_jumpOnDoubleClick->SetValue(false);
60  flexSizer->Add(m_jumpOnDoubleClick, 1, wxTOP|wxLEFT|wxRIGHT|wxALIGN_TOP, 5);
61  m_requireCtrlForTooltips = new wxCheckBox(this, ID_REQUIRE_CTRL_FOR_TOOLTIPS, _("Require Control key to show the \'Evaluate expression\' tooltips"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_REQUIRE_CTRL_FOR_TOOLTIPS"));
62  m_requireCtrlForTooltips->SetValue(false);
63  flexSizer->Add(m_requireCtrlForTooltips, 1, wxTOP|wxLEFT|wxRIGHT|wxALIGN_TOP, 5);
64  valueTooltipSizer = new wxStaticBoxSizer(wxHORIZONTAL, this, _("Value Tooltip Font"));
65  m_valueTooltipLabel = new wxStaticText(this, ID_VALUE_TOOLTIP_LABEL, _("This is a sample text"), wxDefaultPosition, wxDefaultSize, 0, _T("ID_VALUE_TOOLTIP_LABEL"));
66  valueTooltipSizer->Add(m_valueTooltipLabel, 1, wxALIGN_CENTER_VERTICAL, 5);
67  chooseFont = new wxButton(this, ID_BUTTON_CHOOSE_FONT, _("Choose"), wxDefaultPosition, wxDefaultSize, 0, wxDefaultValidator, _T("ID_BUTTON_CHOOSE_FONT"));
68  valueTooltipSizer->Add(chooseFont, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5);
69  flexSizer->Add(valueTooltipSizer, 1, wxTOP|wxLEFT|wxRIGHT|wxEXPAND, 5);
70  BoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
71  labelPerspective = new wxStaticText(this, wxID_ANY, _("Perspective:"), wxDefaultPosition, wxDefaultSize, 0, _T("wxID_ANY"));
72  BoxSizer1->Add(labelPerspective, 0, wxALIGN_CENTER_VERTICAL, 5);
73  m_perspective = new wxChoice(this, ID_CHOICE_PERSPECTIVE, wxDefaultPosition, wxDefaultSize, 0, 0, 0, wxDefaultValidator, _T("ID_CHOICE_PERSPECTIVE"));
74  m_perspective->Append(_("Only one perspective"));
75  m_perspective->Append(_("One perspective per Debugger"));
76  m_perspective->SetSelection( m_perspective->Append(_("One perspective per Debugger configuration")) );
77  BoxSizer1->Add(m_perspective, 1, wxLEFT|wxEXPAND, 5);
78  flexSizer->Add(BoxSizer1, 1, wxTOP|wxLEFT|wxRIGHT|wxEXPAND, 5);
79  mainSizer->Add(flexSizer, 1, wxALL|wxALIGN_LEFT, 0);
80  SetSizer(mainSizer);
81  mainSizer->Fit(this);
82  mainSizer->SetSizeHints(this);
83 
84  Connect(ID_BUTTON_CHOOSE_FONT,wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&DebuggerSettingsCommonPanel::OnChooseFontClick);
85  //*)
86 
88  m_autoBuild->SetToolTip(_("Automatic project build before debug session is started."));
89 
91  m_autoSwitch->SetToolTip(_("When stopping, auto-switch to first frame with valid source info."));
92 
94  m_debuggersLog->SetToolTip(_("If enabled, the debugger's raw input/output will be logged in a separate log page."));
95 
97 
99  m_requireCtrlForTooltips->SetToolTip(_("If enabled, show 'Evaluate expression' tooltips only if the Control key is pressed."));
100 
101  m_valueTooltipFontInfo = cbDebuggerCommonConfig::GetValueTooltipFont();
102  UpdateValueTooltipFont();
103 
104  m_perspective->Select(cbDebuggerCommonConfig::GetPerspective());
105 }
106 
108 {
109  //(*Destroy(DebuggerSettingsCommonPanel)
110  //*)
111 }
112 
114 {
123 }
124 
126 {
127  wxNativeFontInfo fontInfo;
129 
130  wxFontData data;
131  data.SetInitialFont(wxFont(fontInfo));
132  wxFontDialog dlg(this, data);
133  PlaceWindow(&dlg);
134  if (dlg.ShowModal() == wxID_OK)
135  {
138  }
139 }
140 
142 {
143  wxNativeFontInfo fontInfo;
145  m_valueTooltipLabel->SetFont(wxFont(fontInfo));
146 }
147 
wxSize Fit(wxWindow *window)
int wxNewId()
bool FromString(const wxString &s)
static bool GetFlag(Flags flag)
static Perspective GetPerspective()
wxString ToString() const
const wxValidator wxDefaultValidator
virtual int GetSelection() const
#define _T(string)
static void SetPerspective(int perspective)
wxFont GetChosenFont() const
const wxNativeFontInfo * GetNativeFontInfo() const
static void SetValueTooltipFont(const wxString &font)
void SetInitialFont(const wxFont &font)
#define wxTAB_TRAVERSAL
wxSizerItem * Add(wxWindow *window, const wxSizerFlags &flags)
const wxSize wxDefaultSize
const wxPoint wxDefaultPosition
const wxString & _(const wxString &string)
void OnChooseFontClick(wxCommandEvent &event)
static wxString GetValueTooltipFont()
DLLIMPORT void PlaceWindow(wxTopLevelWindow *w, cbPlaceDialogMode mode=pdlBest, bool enforce=false)
Definition: globals.cpp:1177
void SetSizeHints(wxWindow *window)
static void SetFlag(Flags flag, bool value)
virtual bool GetValue() const
const wxFontData & GetFontData() const