Debugger - breakpoints - add a toggle button

This commit is contained in:
adelikat 2014-12-13 18:25:02 +00:00
parent 822c8562b0
commit e659dcb8f7
3 changed files with 51 additions and 15 deletions

View File

@ -28,13 +28,16 @@
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
this.AddBreakpointButton = new System.Windows.Forms.Button();
this.RemoveBreakpointButton = new System.Windows.Forms.Button();
this.BreakpointStatsLabel = new System.Windows.Forms.Label();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.ToggleButton = new System.Windows.Forms.Button();
this.BreakpointView = new BizHawk.Client.EmuHawk.VirtualListView();
this.columnHeader1 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader2 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.columnHeader3 = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader()));
this.BreakpointStatsLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// AddBreakpointButton
@ -42,23 +45,46 @@
this.AddBreakpointButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.AddBreakpointButton.Location = new System.Drawing.Point(0, 387);
this.AddBreakpointButton.Name = "AddBreakpointButton";
this.AddBreakpointButton.Size = new System.Drawing.Size(60, 23);
this.AddBreakpointButton.Size = new System.Drawing.Size(38, 23);
this.AddBreakpointButton.TabIndex = 6;
this.AddBreakpointButton.Text = "&Add";
this.toolTip1.SetToolTip(this.AddBreakpointButton, "Add a new breakpoint");
this.AddBreakpointButton.UseVisualStyleBackColor = true;
this.AddBreakpointButton.Click += new System.EventHandler(this.AddBreakpointButton_Click);
//
// RemoveBreakpointButton
//
this.RemoveBreakpointButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.RemoveBreakpointButton.Location = new System.Drawing.Point(130, 387);
this.RemoveBreakpointButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Delete;
this.RemoveBreakpointButton.Location = new System.Drawing.Point(167, 387);
this.RemoveBreakpointButton.Name = "RemoveBreakpointButton";
this.RemoveBreakpointButton.Size = new System.Drawing.Size(60, 23);
this.RemoveBreakpointButton.Size = new System.Drawing.Size(23, 23);
this.RemoveBreakpointButton.TabIndex = 7;
this.RemoveBreakpointButton.Text = "&Remove";
this.toolTip1.SetToolTip(this.RemoveBreakpointButton, "Remove selected breakpoints");
this.RemoveBreakpointButton.UseVisualStyleBackColor = true;
this.RemoveBreakpointButton.Click += new System.EventHandler(this.RemoveBreakpointButton_Click);
//
// BreakpointStatsLabel
//
this.BreakpointStatsLabel.AutoSize = true;
this.BreakpointStatsLabel.Location = new System.Drawing.Point(3, 3);
this.BreakpointStatsLabel.Name = "BreakpointStatsLabel";
this.BreakpointStatsLabel.Size = new System.Drawing.Size(35, 13);
this.BreakpointStatsLabel.TabIndex = 8;
this.BreakpointStatsLabel.Text = "label1";
//
// ToggleButton
//
this.ToggleButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.ToggleButton.Image = global::BizHawk.Client.EmuHawk.Properties.Resources.Refresh;
this.ToggleButton.Location = new System.Drawing.Point(138, 387);
this.ToggleButton.Name = "ToggleButton";
this.ToggleButton.Size = new System.Drawing.Size(23, 23);
this.ToggleButton.TabIndex = 9;
this.toolTip1.SetToolTip(this.ToggleButton, "Toggle the selected breakpoints");
this.ToggleButton.UseVisualStyleBackColor = true;
this.ToggleButton.Click += new System.EventHandler(this.ToggleButton_Click);
//
// BreakpointView
//
this.BreakpointView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@ -104,19 +130,11 @@
this.columnHeader3.Text = "Name";
this.columnHeader3.Width = 80;
//
// BreakpointStatsLabel
//
this.BreakpointStatsLabel.AutoSize = true;
this.BreakpointStatsLabel.Location = new System.Drawing.Point(3, 3);
this.BreakpointStatsLabel.Name = "BreakpointStatsLabel";
this.BreakpointStatsLabel.Size = new System.Drawing.Size(35, 13);
this.BreakpointStatsLabel.TabIndex = 8;
this.BreakpointStatsLabel.Text = "label1";
//
// BreakpointControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.ToggleButton);
this.Controls.Add(this.BreakpointStatsLabel);
this.Controls.Add(this.RemoveBreakpointButton);
this.Controls.Add(this.AddBreakpointButton);
@ -138,5 +156,7 @@
private System.Windows.Forms.Button RemoveBreakpointButton;
private System.Windows.Forms.ColumnHeader columnHeader3;
private System.Windows.Forms.Label BreakpointStatsLabel;
private System.Windows.Forms.ToolTip toolTip1;
private System.Windows.Forms.Button ToggleButton;
}
}

View File

@ -151,7 +151,9 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
private void UpdateBreakpointRemoveButton()
{
RemoveBreakpointButton.Enabled = EditableItems.Any();
ToggleButton.Enabled =
RemoveBreakpointButton.Enabled =
EditableItems.Any();
}
private void BreakpointView_SelectedIndexChanged(object sender, EventArgs e)
@ -190,5 +192,16 @@ namespace BizHawk.Client.EmuHawk.tools.Debugger
{
BreakpointStatsLabel.Text = string.Format("{0} Total / {1} Active", Breakpoints.Count(), Breakpoints.Count(x => x.Active));
}
private void ToggleButton_Click(object sender, EventArgs e)
{
foreach (var item in SelectedItems)
{
item.Active ^= true;
}
BreakpointView.ItemCount = Breakpoints.Count;
UpdateStatsLabel();
}
}
}

View File

@ -117,4 +117,7 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="toolTip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>