tracelogger: copy ot clipboard

This commit is contained in:
goyuken 2012-11-28 18:59:56 +00:00
parent b7c66cf3c2
commit c95faaba72
2 changed files with 63 additions and 19 deletions

View File

@ -50,6 +50,8 @@
this.ToWindowRadio = new System.Windows.Forms.RadioButton(); this.ToWindowRadio = new System.Windows.Forms.RadioButton();
this.ClearButton = new System.Windows.Forms.Button(); this.ClearButton = new System.Windows.Forms.Button();
this.LoggingEnabled = new System.Windows.Forms.CheckBox(); this.LoggingEnabled = new System.Windows.Forms.CheckBox();
this.editToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.copyAllToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.TracerBox.SuspendLayout(); this.TracerBox.SuspendLayout();
this.menuStrip1.SuspendLayout(); this.menuStrip1.SuspendLayout();
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
@ -101,6 +103,7 @@
this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.menuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem1, this.toolStripMenuItem1,
this.fileToolStripMenuItem, this.fileToolStripMenuItem,
this.editToolStripMenuItem,
this.optionsToolStripMenuItem}); this.optionsToolStripMenuItem});
this.menuStrip1.Location = new System.Drawing.Point(0, 0); this.menuStrip1.Location = new System.Drawing.Point(0, 0);
this.menuStrip1.Name = "menuStrip1"; this.menuStrip1.Name = "menuStrip1";
@ -120,27 +123,27 @@
this.toolStripSeparator1, this.toolStripSeparator1,
this.exitToolStripMenuItem}); this.exitToolStripMenuItem});
this.fileToolStripMenuItem.Name = "fileToolStripMenuItem"; this.fileToolStripMenuItem.Name = "fileToolStripMenuItem";
this.fileToolStripMenuItem.Size = new System.Drawing.Size(37, 20); this.fileToolStripMenuItem.Size = new System.Drawing.Size(35, 20);
this.fileToolStripMenuItem.Text = "&File"; this.fileToolStripMenuItem.Text = "&File";
// //
// saveLogToolStripMenuItem // saveLogToolStripMenuItem
// //
this.saveLogToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.SaveAs; this.saveLogToolStripMenuItem.Image = global::BizHawk.MultiClient.Properties.Resources.SaveAs;
this.saveLogToolStripMenuItem.Name = "saveLogToolStripMenuItem"; this.saveLogToolStripMenuItem.Name = "saveLogToolStripMenuItem";
this.saveLogToolStripMenuItem.Size = new System.Drawing.Size(134, 22); this.saveLogToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.saveLogToolStripMenuItem.Text = "&Save Log"; this.saveLogToolStripMenuItem.Text = "&Save Log";
this.saveLogToolStripMenuItem.Click += new System.EventHandler(this.saveLogToolStripMenuItem_Click); this.saveLogToolStripMenuItem.Click += new System.EventHandler(this.saveLogToolStripMenuItem_Click);
// //
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
this.toolStripSeparator1.Size = new System.Drawing.Size(131, 6); this.toolStripSeparator1.Size = new System.Drawing.Size(149, 6);
// //
// exitToolStripMenuItem // exitToolStripMenuItem
// //
this.exitToolStripMenuItem.Name = "exitToolStripMenuItem"; this.exitToolStripMenuItem.Name = "exitToolStripMenuItem";
this.exitToolStripMenuItem.ShortcutKeyDisplayString = "Alt+F4"; this.exitToolStripMenuItem.ShortcutKeyDisplayString = "Alt+F4";
this.exitToolStripMenuItem.Size = new System.Drawing.Size(134, 22); this.exitToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.exitToolStripMenuItem.Text = "E&xit"; this.exitToolStripMenuItem.Text = "E&xit";
this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click); this.exitToolStripMenuItem.Click += new System.EventHandler(this.exitToolStripMenuItem_Click);
// //
@ -152,33 +155,33 @@
this.autoloadToolStripMenuItem, this.autoloadToolStripMenuItem,
this.saveWindowPositionToolStripMenuItem}); this.saveWindowPositionToolStripMenuItem});
this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem"; this.optionsToolStripMenuItem.Name = "optionsToolStripMenuItem";
this.optionsToolStripMenuItem.Size = new System.Drawing.Size(61, 20); this.optionsToolStripMenuItem.Size = new System.Drawing.Size(56, 20);
this.optionsToolStripMenuItem.Text = "&Options"; this.optionsToolStripMenuItem.Text = "&Options";
this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened); this.optionsToolStripMenuItem.DropDownOpened += new System.EventHandler(this.optionsToolStripMenuItem_DropDownOpened);
// //
// setMaxWindowLinesToolStripMenuItem // setMaxWindowLinesToolStripMenuItem
// //
this.setMaxWindowLinesToolStripMenuItem.Name = "setMaxWindowLinesToolStripMenuItem"; this.setMaxWindowLinesToolStripMenuItem.Name = "setMaxWindowLinesToolStripMenuItem";
this.setMaxWindowLinesToolStripMenuItem.Size = new System.Drawing.Size(201, 22); this.setMaxWindowLinesToolStripMenuItem.Size = new System.Drawing.Size(193, 22);
this.setMaxWindowLinesToolStripMenuItem.Text = "&Set Max Window Lines..."; this.setMaxWindowLinesToolStripMenuItem.Text = "&Set Max Window Lines...";
this.setMaxWindowLinesToolStripMenuItem.Click += new System.EventHandler(this.setMaxWindowLinesToolStripMenuItem_Click); this.setMaxWindowLinesToolStripMenuItem.Click += new System.EventHandler(this.setMaxWindowLinesToolStripMenuItem_Click);
// //
// toolStripSeparator2 // toolStripSeparator2
// //
this.toolStripSeparator2.Name = "toolStripSeparator2"; this.toolStripSeparator2.Name = "toolStripSeparator2";
this.toolStripSeparator2.Size = new System.Drawing.Size(198, 6); this.toolStripSeparator2.Size = new System.Drawing.Size(190, 6);
// //
// autoloadToolStripMenuItem // autoloadToolStripMenuItem
// //
this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem"; this.autoloadToolStripMenuItem.Name = "autoloadToolStripMenuItem";
this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(201, 22); this.autoloadToolStripMenuItem.Size = new System.Drawing.Size(193, 22);
this.autoloadToolStripMenuItem.Text = "&Autoload"; this.autoloadToolStripMenuItem.Text = "&Autoload";
this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click); this.autoloadToolStripMenuItem.Click += new System.EventHandler(this.autoloadToolStripMenuItem_Click);
// //
// saveWindowPositionToolStripMenuItem // saveWindowPositionToolStripMenuItem
// //
this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem"; this.saveWindowPositionToolStripMenuItem.Name = "saveWindowPositionToolStripMenuItem";
this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(201, 22); this.saveWindowPositionToolStripMenuItem.Size = new System.Drawing.Size(193, 22);
this.saveWindowPositionToolStripMenuItem.Text = "&Save Window Position"; this.saveWindowPositionToolStripMenuItem.Text = "&Save Window Position";
this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click); this.saveWindowPositionToolStripMenuItem.Click += new System.EventHandler(this.saveWindowPositionToolStripMenuItem_Click);
// //
@ -269,6 +272,22 @@
this.LoggingEnabled.UseVisualStyleBackColor = true; this.LoggingEnabled.UseVisualStyleBackColor = true;
this.LoggingEnabled.CheckedChanged += new System.EventHandler(this.LoggingEnabled_CheckedChanged); this.LoggingEnabled.CheckedChanged += new System.EventHandler(this.LoggingEnabled_CheckedChanged);
// //
// editToolStripMenuItem
//
this.editToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.copyAllToolStripMenuItem});
this.editToolStripMenuItem.Name = "editToolStripMenuItem";
this.editToolStripMenuItem.Size = new System.Drawing.Size(37, 20);
this.editToolStripMenuItem.Text = "Edit";
//
// copyAllToolStripMenuItem
//
this.copyAllToolStripMenuItem.Name = "copyAllToolStripMenuItem";
this.copyAllToolStripMenuItem.ShortcutKeyDisplayString = "Ctrl+C";
this.copyAllToolStripMenuItem.Size = new System.Drawing.Size(152, 22);
this.copyAllToolStripMenuItem.Text = "Copy All";
this.copyAllToolStripMenuItem.Click += new System.EventHandler(this.copyAllToolStripMenuItem_Click);
//
// TraceLogger // TraceLogger
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -278,11 +297,13 @@
this.Controls.Add(this.TracerBox); this.Controls.Add(this.TracerBox);
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.MinimumSize = new System.Drawing.Size(400, 230); this.MinimumSize = new System.Drawing.Size(400, 230);
this.Name = "TraceLogger"; this.Name = "TraceLogger";
this.Text = "TraceLogger"; this.Text = "TraceLogger";
this.Load += new System.EventHandler(this.TraceLogger_Load); this.Load += new System.EventHandler(this.TraceLogger_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.TraceLogger_KeyDown);
this.TracerBox.ResumeLayout(false); this.TracerBox.ResumeLayout(false);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
@ -316,5 +337,7 @@
private System.Windows.Forms.RadioButton ToWindowRadio; private System.Windows.Forms.RadioButton ToWindowRadio;
private System.Windows.Forms.TextBox FileBox; private System.Windows.Forms.TextBox FileBox;
private System.Windows.Forms.Button BrowseBox; private System.Windows.Forms.Button BrowseBox;
private System.Windows.Forms.ToolStripMenuItem editToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem copyAllToolStripMenuItem;
} }
} }

View File

@ -363,5 +363,26 @@ namespace BizHawk.MultiClient
} }
} }
} }
void CopyAllToClipboard()
{
StringBuilder sb = new StringBuilder();
foreach (string s in Instructions)
sb.AppendLine(s);
string ss = sb.ToString();
if (!string.IsNullOrEmpty(ss))
Clipboard.SetText(sb.ToString(), TextDataFormat.Text);
}
private void TraceLogger_KeyDown(object sender, KeyEventArgs e)
{
if (ModifierKeys.HasFlag(Keys.Control) && e.KeyCode == Keys.C)
CopyAllToClipboard();
}
private void copyAllToolStripMenuItem_Click(object sender, EventArgs e)
{
CopyAllToClipboard();
}
} }
} }