Browse Source

removed transparency from DebuggeeExceptionForm, added buttons for Break and Terminate again

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@4074 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Siegfried Pammer 16 years ago
parent
commit
71480d693b
  1. 1
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs
  2. 46
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.Designer.cs
  3. 44
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.cs
  4. 7
      src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/WindowsDebugger.cs

1
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Options/DebuggingOptions.cs

@ -31,6 +31,5 @@ namespace ICSharpCode.SharpDevelop.Services
// Properties for the DebuggeeExceptionForm // Properties for the DebuggeeExceptionForm
public FormWindowState DebuggeeExceptionWindowState = FormWindowState.Normal; public FormWindowState DebuggeeExceptionWindowState = FormWindowState.Normal;
public double DebuggeeExceptionWindowOpacity = 0.75;
} }
} }

46
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.Designer.cs generated

@ -55,12 +55,14 @@ namespace ICSharpCode.SharpDevelop.Services
this.pictureBox = new System.Windows.Forms.PictureBox(); this.pictureBox = new System.Windows.Forms.PictureBox();
this.lblExceptionText = new System.Windows.Forms.Label(); this.lblExceptionText = new System.Windows.Forms.Label();
this.exceptionView = new System.Windows.Forms.RichTextBox(); 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(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).BeginInit();
this.SuspendLayout(); this.SuspendLayout();
// //
// pictureBox // 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.Name = "pictureBox";
this.pictureBox.Size = new System.Drawing.Size(48, 52); this.pictureBox.Size = new System.Drawing.Size(48, 52);
this.pictureBox.TabIndex = 0; 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) this.lblExceptionText.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | 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.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.TabIndex = 1;
this.lblExceptionText.Text = "Exception Message Text"; this.lblExceptionText.Text = "Exception Message Text";
// //
@ -83,25 +85,55 @@ namespace ICSharpCode.SharpDevelop.Services
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.exceptionView.BackColor = System.Drawing.SystemColors.Control; 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.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.Name = "exceptionView";
this.exceptionView.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.ForcedBoth; 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.TabIndex = 2;
this.exceptionView.Text = ""; 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 // 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.exceptionView);
this.Controls.Add(this.lblExceptionText); this.Controls.Add(this.lblExceptionText);
this.Controls.Add(this.pictureBox); this.Controls.Add(this.pictureBox);
this.Name = "DebuggeeExceptionForm"; this.Name = "DebuggeeExceptionForm";
this.ShowInTaskbar = false; this.ShowInTaskbar = false;
this.Resize += new System.EventHandler(this.debugeeExceptionFormResize); this.Resize += new System.EventHandler(this.FormResize);
((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pictureBox)).EndInit();
this.ResumeLayout(false); 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.RichTextBox exceptionView;
private System.Windows.Forms.Label lblExceptionText; private System.Windows.Forms.Label lblExceptionText;
private System.Windows.Forms.PictureBox pictureBox; private System.Windows.Forms.PictureBox pictureBox;

44
src/AddIns/Misc/Debugger/Debugger.AddIn/Project/Src/Service/DebuggeeExceptionForm.cs

@ -37,6 +37,7 @@
// //
#endregion #endregion
using ICSharpCode.Core.WinForms;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
@ -54,7 +55,6 @@ namespace ICSharpCode.SharpDevelop.Services
internal sealed partial class DebuggeeExceptionForm internal sealed partial class DebuggeeExceptionForm
{ {
Process process; Process process;
bool active;
DebuggeeExceptionForm(Process process) DebuggeeExceptionForm(Process process)
{ {
@ -66,39 +66,26 @@ namespace ICSharpCode.SharpDevelop.Services
this.process.Resumed += ProcessHandler; this.process.Resumed += ProcessHandler;
this.FormClosed += FormClosedHandler; 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; this.WindowState = DebuggingOptions.Instance.DebuggeeExceptionWindowState;
FormLocationHelper.Apply(this, "DebuggeeExceptionForm", true); 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.MinimizeBox = this.MaximizeBox = this.ShowIcon = false;
this.exceptionView.Font = WinFormsResourceService.DefaultMonospacedFont;
this.exceptionView.DoubleClick += ExceptionViewDoubleClick; this.exceptionView.DoubleClick += ExceptionViewDoubleClick;
} this.exceptionView.WordWrap = false;
void ProcessHandler(object sender, EventArgs e) this.btnBreak.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Break}");
{ this.btnStop.Text = StringParser.Parse("${res:MainWindow.Windows.Debug.ExceptionForm.Terminate}");
this.Close();
}
void FormEnter(object sender, EventArgs e) this.btnBreak.Image = WinFormsResourceService.GetBitmap("Icons.16x16.Debug.Break");
{ this.btnStop.Image = WinFormsResourceService.GetBitmap("Icons.16x16.StopProcess");
this.Opacity = 1;
} }
void FormLeave(object sender, EventArgs e) void ProcessHandler(object sender, EventArgs e)
{ {
if (!this.active) this.Close();
this.Opacity = DebuggingOptions.Instance.DebuggeeExceptionWindowOpacity;
} }
void FormClosedHandler(object sender, EventArgs e) void FormClosedHandler(object sender, EventArgs e)
@ -143,9 +130,20 @@ namespace ICSharpCode.SharpDevelop.Services
} }
} }
void debugeeExceptionFormResize(object sender, EventArgs e) void FormResize(object sender, EventArgs e)
{ {
DebuggingOptions.Instance.DebuggeeExceptionWindowState = WindowState; DebuggingOptions.Instance.DebuggeeExceptionWindowState = WindowState;
} }
void BtnBreakClick(object sender, EventArgs e)
{
Close();
}
void BtnStopClick(object sender, EventArgs e)
{
this.process.Terminate();
Close();
}
} }
} }

7
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 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"); 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); 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() public void JumpToCurrentLine()

Loading…
Cancel
Save