1
// BreakpointPropertiesDialog.cs
4
// Lluis Sanchez Gual <lluis@novell.com>
6
// Copyright (c) 2008 Novell, Inc (http://www.novell.com)
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to deal
10
// in the Software without restriction, including without limitation the rights
11
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
15
// The above copyright notice and this permission notice shall be included in
16
// all copies or substantial portions of the Software.
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
29
using MonoDevelop.Core.Gui;
30
using MonoDevelop.Core;
31
using Mono.Debugging.Client;
33
namespace MonoDevelop.Ide.Gui.Dialogs
35
public partial class BreakpointPropertiesDialog : Gtk.Dialog
39
public BreakpointPropertiesDialog (Breakpoint bp, bool isNew)
44
entryFile.Text = bp.FileName;
45
entryLine.Text = bp.Line.ToString ();
48
entryFile.IsEditable = false;
49
entryLine.IsEditable = false;
50
entryFile.ModifyBase (Gtk.StateType.Normal, Style.Backgrounds [(int)Gtk.StateType.Insensitive]);
51
entryFile.ModifyBase (Gtk.StateType.Active, Style.Backgrounds [(int)Gtk.StateType.Insensitive]);
52
entryLine.ModifyBase (Gtk.StateType.Normal, Style.Backgrounds [(int)Gtk.StateType.Insensitive]);
53
entryLine.ModifyBase (Gtk.StateType.Active, Style.Backgrounds [(int)Gtk.StateType.Insensitive]);
56
if (string.IsNullOrEmpty (bp.ConditionExpression)) {
57
radioBreakAlways.Active = true;
59
entryCondition.Text = bp.ConditionExpression;
60
if (bp.BreakIfConditionChanges)
61
radioBreakChange.Active = true;
63
radioBreakTrue.Active = true;
66
spinHitCount.Value = bp.HitCount;
68
if (bp.HitAction == HitAction.Break)
69
radioActionBreak.Active = true;
71
radioActionTrace.Active = true;
72
entryTraceExpr.Text = bp.TraceExpression;
78
void UpdateControls ()
80
boxTraceExpression.Sensitive = radioActionTrace.Active;
81
boxCondition.Sensitive = !radioBreakAlways.Active;
86
if (!radioBreakAlways.Active && entryCondition.Text.Length == 0) {
87
MessageService.ShowError (GettextCatalog.GetString ("Condition expression not specified"));
90
if (radioActionTrace.Active && entryTraceExpr.Text.Length == 0) {
91
MessageService.ShowError (GettextCatalog.GetString ("Trace expression not specified"));
99
if (!radioBreakAlways.Active) {
100
bp.ConditionExpression = entryCondition.Text;
101
bp.BreakIfConditionChanges = radioBreakChange.Active;
103
bp.ConditionExpression = null;
105
bp.HitCount = (int) spinHitCount.Value;
107
if (radioActionBreak.Active)
108
bp.HitAction = HitAction.Break;
110
bp.HitAction = HitAction.PrintExpression;
111
bp.TraceExpression = entryTraceExpr.Text;
116
protected virtual void OnButtonOkClicked (object sender, System.EventArgs e)
120
Respond (Gtk.ResponseType.Ok);
124
protected virtual void OnRadioBreakAlwaysToggled (object sender, System.EventArgs e)
129
protected virtual void OnRadioActionBreakToggled (object sender, System.EventArgs e)