diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs index 8feb20fa8b..57d8382f81 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs @@ -31,6 +31,5 @@ namespace ICSharpCode.SharpDevelop.Services // Properties for the DebuggeeExceptionForm public FormWindowState DebuggeeExceptionWindowState = FormWindowState.Normal; - public double DebuggeeExceptionWindowOpacity = 0.75; } } diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.Designer.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.Designer.cs index 03e4d3620f..21ce6152db 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.Designer.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.Designer.cs @@ -55,12 +55,14 @@ namespace ICSharpCode.SharpDevelop.Services this.pictureBox = new System.Windows.Forms.PictureBox(); this.lblExceptionText = new System.Windows.Forms.Label(); this.exceptionView = new System.Windows.Forms.RichTextBox(); + this.btnStop = new System.Windows.Forms.Button(); + this.btnBreak = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit(); this.SuspendLayout(); // // pictureBox // - this.pictureBox.Location = new System.Drawing.Point(12, 12); + this.pictureBox.Location = new System.Drawing.Point(4, 12); this.pictureBox.Name = "pictureBox"; this.pictureBox.Size = new System.Drawing.Size(48, 52); this.pictureBox.TabIndex = 0; @@ -70,9 +72,9 @@ namespace ICSharpCode.SharpDevelop.Services // this.lblExceptionText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.lblExceptionText.Location = new System.Drawing.Point(66, 12); + this.lblExceptionText.Location = new System.Drawing.Point(58, 12); this.lblExceptionText.Name = "lblExceptionText"; - this.lblExceptionText.Size = new System.Drawing.Size(560, 52); + this.lblExceptionText.Size = new System.Drawing.Size(564, 52); this.lblExceptionText.TabIndex = 1; this.lblExceptionText.Text = "Exception Message Text"; // @@ -83,25 +85,55 @@ namespace ICSharpCode.SharpDevelop.Services | System.Windows.Forms.AnchorStyles.Right))); this.exceptionView.BackColor = System.Drawing.SystemColors.Control; this.exceptionView.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.exceptionView.Location = new System.Drawing.Point(12, 70); + this.exceptionView.Location = new System.Drawing.Point(4, 70); this.exceptionView.Name = "exceptionView"; this.exceptionView.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth; - this.exceptionView.Size = new System.Drawing.Size(614, 317); + this.exceptionView.Size = new System.Drawing.Size(635, 290); this.exceptionView.TabIndex = 2; this.exceptionView.Text = ""; // + // btnStop + // + this.btnStop.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.btnStop.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnStop.Location = new System.Drawing.Point(340, 366); + this.btnStop.Name = "btnStop"; + this.btnStop.Size = new System.Drawing.Size(115, 30); + this.btnStop.TabIndex = 3; + this.btnStop.Text = "Stop"; + this.btnStop.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnStop.UseVisualStyleBackColor = true; + this.btnStop.Click += new System.EventHandler(this.BtnStopClick); + // + // btnBreak + // + this.btnBreak.Anchor = System.Windows.Forms.AnchorStyles.Bottom; + this.btnBreak.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; + this.btnBreak.Location = new System.Drawing.Point(219, 366); + this.btnBreak.Name = "btnBreak"; + this.btnBreak.Size = new System.Drawing.Size(115, 30); + this.btnBreak.TabIndex = 4; + this.btnBreak.Text = "Break"; + this.btnBreak.TextImageRelation = System.Windows.Forms.TextImageRelation.ImageBeforeText; + this.btnBreak.UseVisualStyleBackColor = true; + this.btnBreak.Click += new System.EventHandler(this.BtnBreakClick); + // // DebuggeeExceptionForm // - this.ClientSize = new System.Drawing.Size(638, 399); + this.ClientSize = new System.Drawing.Size(642, 399); + this.Controls.Add(this.btnBreak); + this.Controls.Add(this.btnStop); this.Controls.Add(this.exceptionView); this.Controls.Add(this.lblExceptionText); this.Controls.Add(this.pictureBox); this.Name = "DebuggeeExceptionForm"; this.ShowInTaskbar = false; - this.Resize += new System.EventHandler(this.debugeeExceptionFormResize); + this.Resize += new System.EventHandler(this.FormResize); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); this.ResumeLayout(false); } + private System.Windows.Forms.Button btnBreak; + private System.Windows.Forms.Button btnStop; private System.Windows.Forms.RichTextBox exceptionView; private System.Windows.Forms.Label lblExceptionText; private System.Windows.Forms.PictureBox pictureBox; diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.cs index e8586cdae8..62b108de38 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.cs @@ -37,6 +37,7 @@ // #endregion +using ICSharpCode.Core.WinForms; using System; using System.Collections.Generic; using System.Drawing; @@ -54,7 +55,6 @@ namespace ICSharpCode.SharpDevelop.Services internal sealed partial class DebuggeeExceptionForm { Process process; - bool active; DebuggeeExceptionForm(Process process) { @@ -66,23 +66,21 @@ namespace ICSharpCode.SharpDevelop.Services this.process.Resumed += ProcessHandler; this.FormClosed += FormClosedHandler; - this.Activated += delegate { this.active = true; this.Opacity = 1; }; - this.Deactivate += delegate { this.active = false; this.Opacity = DebuggingOptions.Instance.DebuggeeExceptionWindowOpacity; }; this.WindowState = DebuggingOptions.Instance.DebuggeeExceptionWindowState; FormLocationHelper.Apply(this, "DebuggeeExceptionForm", true); - this.Opacity = DebuggingOptions.Instance.DebuggeeExceptionWindowOpacity; - - this.MouseLeave += FormLeave; - this.MouseEnter += FormEnter; - this.lblExceptionText.MouseEnter += FormEnter; - this.pictureBox.MouseEnter += FormEnter; - this.exceptionView.MouseEnter += FormEnter; - this.MinimizeBox = this.MaximizeBox = this.ShowIcon = false; + this.exceptionView.Font = WinFormsResourceService.DefaultMonospacedFont; this.exceptionView.DoubleClick += ExceptionViewDoubleClick; + this.exceptionView.WordWrap = false; + + this.btnBreak.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Break}"); + this.btnStop.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Terminate}"); + + this.btnBreak.Image = WinFormsResourceService.GetBitmap("Icons.16x16.Debug.Break"); + this.btnStop.Image = WinFormsResourceService.GetBitmap("Icons.16x16.StopProcess"); } void ProcessHandler(object sender, EventArgs e) @@ -90,17 +88,6 @@ namespace ICSharpCode.SharpDevelop.Services this.Close(); } - void FormEnter(object sender, EventArgs e) - { - this.Opacity = 1; - } - - void FormLeave(object sender, EventArgs e) - { - if (!this.active) - this.Opacity = DebuggingOptions.Instance.DebuggeeExceptionWindowOpacity; - } - void FormClosedHandler(object sender, EventArgs e) { this.process.Exited -= ProcessHandler; @@ -143,9 +130,20 @@ namespace ICSharpCode.SharpDevelop.Services } } - void debugeeExceptionFormResize(object sender, EventArgs e) + void FormResize(object sender, EventArgs e) { DebuggingOptions.Instance.DebuggeeExceptionWindowState = WindowState; } + + void BtnBreakClick(object sender, EventArgs e) + { + Close(); + } + + void BtnStopClick(object sender, EventArgs e) + { + this.process.Terminate(); + Close(); + } } } diff --git a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs index 4602e46059..2e70a50543 100644 --- a/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs +++ b/src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs @@ -680,15 +680,10 @@ namespace ICSharpCode.SharpDevelop.Services } string title = e.IsUnhandled ? StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Title.Unhandled}") : StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Title.Handled}"); - string message = string.Format("An exception of type {0} was thrown:\n{1}", e.Exception.Type, e.Exception.Message); + string message = string.Format(StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Message}"), e.Exception.Type, e.Exception.Message); Bitmap icon = WinFormsResourceService.GetBitmap(e.IsUnhandled ? "Icons.32x32.Error" : "Icons.32x32.Warning"); - bool canContinue = !e.IsUnhandled; - //DebuggerEventForm.Result result = DebuggerEventForm.Show(title, message, icon, canContinue); DebuggeeExceptionForm.Show(debuggedProcess, title, message, stacktraceBuilder.ToString(), icon); - - // If the process was killed while the exception form is still being displayed - if (e.Process.HasExited) return; } public void JumpToCurrentLine()