- Allow to delete the content of the rawtraffic tab from the edit menu (requested by Stefan Ludowicy)

- Don't send commands to KDBG if it isn't there
- Remove old code and related events

svn path=/trunk/tools/reactosdbg/; revision=1099
This commit is contained in:
Gregor Schneider 2009-08-26 17:01:26 +00:00
parent 147298aa4a
commit a35c2ddbf8
3 changed files with 26 additions and 33 deletions

View File

@ -33,6 +33,7 @@
this.menuStrip1 = new System.Windows.Forms.MenuStrip();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripSeparator();
this.selectAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
@ -61,7 +62,6 @@
this.RawTrafficText.Size = new System.Drawing.Size(425, 268);
this.RawTrafficText.TabIndex = 0;
this.RawTrafficText.WordWrap = false;
this.RawTrafficText.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.RawTrafficText_KeyPress);
this.RawTrafficText.MouseUp += new System.Windows.Forms.MouseEventHandler(this.RawTrafficText_MouseUp);
//
// menuStrip1
@ -70,7 +70,7 @@
this.editToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(397, 24);
this.menuStrip1.Size = new System.Drawing.Size(425, 24);
this.menuStrip1.TabIndex = 4;
this.menuStrip1.Text = "menuStrip1";
this.menuStrip1.Visible = false;
@ -79,12 +79,13 @@
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyToolStripMenuItem,
this.clearToolStripMenuItem,
this.toolStripMenuItem1,
this.selectAllToolStripMenuItem});
this.editToolStripMenuItem.MergeAction = System.Windows.Forms.MergeAction.Insert;
this.editToolStripMenuItem.MergeIndex = 1;
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(39, 20);
this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.editToolStripMenuItem.Text = "&Edit";
this.editToolStripMenuItem.Click += new System.EventHandler(this.editToolStripMenuItem_Click);
//
@ -93,19 +94,26 @@
this.copyToolStripMenuItem.Enabled = false;
this.copyToolStripMenuItem.Image = global::RosDBG.Properties.Resources.copyToolStripMenuItem_Image;
this.copyToolStripMenuItem.Name = "copyToolStripMenuItem";
this.copyToolStripMenuItem.Size = new System.Drawing.Size(120, 22);
this.copyToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
this.copyToolStripMenuItem.Text = "&Copy";
this.copyToolStripMenuItem.Click += new System.EventHandler(this.copyToolStripMenuItem_Click);
//
// clearToolStripMenuItem
//
this.clearToolStripMenuItem.Name = "clearToolStripMenuItem";
this.clearToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
this.clearToolStripMenuItem.Text = "C&lear";
this.clearToolStripMenuItem.Click += new System.EventHandler(this.clearToolStripMenuItem_Click);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Size = new System.Drawing.Size(117, 6);
this.toolStripMenuItem1.Size = new System.Drawing.Size(124, 6);
//
// selectAllToolStripMenuItem
//
this.selectAllToolStripMenuItem.Name = "selectAllToolStripMenuItem";
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(120, 22);
this.selectAllToolStripMenuItem.Size = new System.Drawing.Size(127, 22);
this.selectAllToolStripMenuItem.Text = "&Select all";
this.selectAllToolStripMenuItem.Click += new System.EventHandler(this.selectAllToolStripMenuItem_Click);
//
@ -210,5 +218,6 @@
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.TextBox RawTrafficTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ToolStripMenuItem clearToolStripMenuItem;
}
}

View File

@ -137,7 +137,7 @@ namespace RosDBG
private void SendCommandToDebugger()
{
if (RawTrafficTextBox.Text.Length > 0 && mConnection.Debugger != null)
if (RawTrafficTextBox.Text.Length > 0 && mConnection.Debugger != null && !mConnection.Running)
{
String cmd = RawTrafficTextBox.Text;
RawTrafficText.AppendText(kdbPrompt);
@ -248,29 +248,6 @@ namespace RosDBG
}
private void RawTrafficText_KeyPress(object sender, KeyPressEventArgs e)
{
if ((mConnection.ConnectionMode != DebugConnection.Mode.ClosedMode) && (!mConnection.Running))
{
switch ((int)e.KeyChar)
{
case 8: /* Backspace */
if (RawTrafficTextBox.Text.Length > 0)
RawTrafficTextBox.Text = RawTrafficTextBox.Text.Substring(0, RawTrafficTextBox.Text.Length - 1);
break;
case 13: /* Return */
if (RawTrafficTextBox.Text.ToLower().CompareTo("cont") == 0)
mConnection.Running = true;
RawTrafficTextBox.Text += e.KeyChar;
SendCommandToDebugger();
break;
default:
RawTrafficTextBox.Text += e.KeyChar;
break;
}
}
}
private void RawTrafficText_MouseUp(object sender, MouseEventArgs e)
{
copyToolStripMenuItem.Enabled = (RawTrafficText.SelectionLength > 0);
@ -289,7 +266,9 @@ namespace RosDBG
private void editToolStripMenuItem_Click(object sender, EventArgs e)
{
selectAllToolStripMenuItem.Enabled = (RawTrafficText.Text.Length != 0);
bool hasText = RawTrafficText.Text.Length != 0;
selectAllToolStripMenuItem.Enabled = hasText;
clearToolStripMenuItem.Enabled = hasText;
}
private void printDoc_PrintPage(object sender, PrintPageEventArgs e)
@ -358,5 +337,10 @@ namespace RosDBG
}
#endregion
private void clearToolStripMenuItem_Click(object sender, EventArgs e)
{
RawTrafficText.Clear();
}
}
}

View File

@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
// will be increased as well. MSI installers must not be generated with the same Build Number
// otherwise they won't upgrade the old installation!
[assembly: AssemblyVersion("1.0.2.76")]
[assembly: AssemblyFileVersion("1.0.2.76")]
[assembly: AssemblyVersion("1.0.2.80")]
[assembly: AssemblyFileVersion("1.0.2.80")]