Trace Logger - UI changes, fix clear button crash

This commit is contained in:
adelikat 2012-09-30 04:28:06 +00:00
parent 427864841d
commit 2d90368864
2 changed files with 42 additions and 12 deletions

View File

@ -43,6 +43,7 @@
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.ClearButton = new System.Windows.Forms.Button();
this.LoggingEnabled = new System.Windows.Forms.CheckBox();
this.CloseButton = new System.Windows.Forms.Button();
this.groupBox1.SuspendLayout();
this.menuStrip1.SuspendLayout();
this.groupBox2.SuspendLayout();
@ -56,7 +57,7 @@
this.groupBox1.Controls.Add(this.TraceView);
this.groupBox1.Location = new System.Drawing.Point(12, 27);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(337, 365);
this.groupBox1.Size = new System.Drawing.Size(620, 444);
this.groupBox1.TabIndex = 1;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Trace log";
@ -69,14 +70,15 @@
this.TraceView.CheckBoxes = true;
this.TraceView.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] {
this.Script});
this.TraceView.Font = new System.Drawing.Font("Courier New", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.TraceView.FullRowSelect = true;
this.TraceView.GridLines = true;
this.TraceView.HideSelection = false;
this.TraceView.ItemCount = 0;
this.TraceView.Location = new System.Drawing.Point(9, 19);
this.TraceView.Location = new System.Drawing.Point(8, 18);
this.TraceView.Name = "TraceView";
this.TraceView.selectedItem = -1;
this.TraceView.Size = new System.Drawing.Size(320, 340);
this.TraceView.Size = new System.Drawing.Size(603, 414);
this.TraceView.TabIndex = 4;
this.TraceView.UseCompatibleStateImageBehavior = false;
this.TraceView.View = System.Windows.Forms.View.Details;
@ -84,7 +86,7 @@
// Script
//
this.Script.Text = "Instructions";
this.Script.Width = 316;
this.Script.Width = 599;
//
// menuStrip1
//
@ -94,7 +96,7 @@
this.optionsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1";
this.menuStrip1.Size = new System.Drawing.Size(555, 24);
this.menuStrip1.Size = new System.Drawing.Size(644, 24);
this.menuStrip1.TabIndex = 2;
this.menuStrip1.Text = "menuStrip1";
//
@ -152,19 +154,19 @@
// groupBox2
//
this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Right)));
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox2.Controls.Add(this.ClearButton);
this.groupBox2.Controls.Add(this.LoggingEnabled);
this.groupBox2.Location = new System.Drawing.Point(356, 27);
this.groupBox2.Location = new System.Drawing.Point(12, 477);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(187, 365);
this.groupBox2.Size = new System.Drawing.Size(218, 50);
this.groupBox2.TabIndex = 3;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Control";
//
// ClearButton
//
this.ClearButton.Location = new System.Drawing.Point(15, 73);
this.ClearButton.Location = new System.Drawing.Point(121, 19);
this.ClearButton.Name = "ClearButton";
this.ClearButton.Size = new System.Drawing.Size(75, 23);
this.ClearButton.TabIndex = 1;
@ -176,7 +178,7 @@
//
this.LoggingEnabled.Appearance = System.Windows.Forms.Appearance.Button;
this.LoggingEnabled.AutoSize = true;
this.LoggingEnabled.Location = new System.Drawing.Point(15, 31);
this.LoggingEnabled.Location = new System.Drawing.Point(9, 19);
this.LoggingEnabled.Name = "LoggingEnabled";
this.LoggingEnabled.Size = new System.Drawing.Size(97, 23);
this.LoggingEnabled.TabIndex = 0;
@ -184,11 +186,25 @@
this.LoggingEnabled.UseVisualStyleBackColor = true;
this.LoggingEnabled.CheckedChanged += new System.EventHandler(this.LoggingEnabled_CheckedChanged);
//
// CloseButton
//
this.CloseButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.CloseButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.CloseButton.Location = new System.Drawing.Point(548, 496);
this.CloseButton.Name = "CloseButton";
this.CloseButton.Size = new System.Drawing.Size(75, 23);
this.CloseButton.TabIndex = 4;
this.CloseButton.Text = "&Close";
this.CloseButton.UseVisualStyleBackColor = true;
this.CloseButton.Click += new System.EventHandler(this.CloseButton_Click);
//
// TraceLogger
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(555, 404);
this.CancelButton = this.CloseButton;
this.ClientSize = new System.Drawing.Size(644, 539);
this.Controls.Add(this.CloseButton);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.menuStrip1);
@ -223,5 +239,6 @@
private System.Windows.Forms.ToolStripMenuItem autoloadToolStripMenuItem;
private VirtualListView TraceView;
public System.Windows.Forms.ColumnHeader Script;
private System.Windows.Forms.Button CloseButton;
}
}

View File

@ -35,9 +35,16 @@ namespace BizHawk.MultiClient
}
private void TraceView_QueryItemText(int index, int column, out string text)
{
if (index < Instructions.Count)
{
text = Instructions[index];
}
else
{
text = "";
}
}
private void TraceLogger_Load(object sender, EventArgs e)
{
@ -66,6 +73,7 @@ namespace BizHawk.MultiClient
private void ClearList()
{
Instructions.Clear();
TraceView.ItemCount = 0;
}
private void exitToolStripMenuItem_Click(object sender, EventArgs e)
@ -102,5 +110,10 @@ namespace BizHawk.MultiClient
{
autoloadToolStripMenuItem.Checked = Global.Config.TraceLoggerAutoLoad;
}
private void CloseButton_Click(object sender, EventArgs e)
{
Close();
}
}
}