Hex Editor - add a Close Table file menu item, enabled only when a table file has been loaded

This commit is contained in:
adelikat 2014-03-23 22:47:28 +00:00
parent b95a0b648c
commit 7541dba798
2 changed files with 22 additions and 5 deletions

View File

@ -40,6 +40,7 @@
this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator4 = new System.Windows.Forms.ToolStripSeparator();
this.LoadTableFileMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.LoadTableFileMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.RecentTablesSubMenu = new System.Windows.Forms.ToolStripMenuItem(); this.RecentTablesSubMenu = new System.Windows.Forms.ToolStripMenuItem();
this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.ExitMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.EditMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.EditMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -92,7 +93,7 @@
this.HexScrollBar = new System.Windows.Forms.VScrollBar(); this.HexScrollBar = new System.Windows.Forms.VScrollBar();
this.AddressesLabel = new System.Windows.Forms.Label(); this.AddressesLabel = new System.Windows.Forms.Label();
this.Header = new System.Windows.Forms.Label(); this.Header = new System.Windows.Forms.Label();
this.noneToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem(); this.CloseTableFileMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.HexMenuStrip.SuspendLayout(); this.HexMenuStrip.SuspendLayout();
this.ViewerContextMenuStrip.SuspendLayout(); this.ViewerContextMenuStrip.SuspendLayout();
this.MemoryViewerBox.SuspendLayout(); this.MemoryViewerBox.SuspendLayout();
@ -120,6 +121,7 @@
this.SaveAsTextMenuItem, this.SaveAsTextMenuItem,
this.toolStripSeparator4, this.toolStripSeparator4,
this.LoadTableFileMenuItem, this.LoadTableFileMenuItem,
this.CloseTableFileMenuItem,
this.RecentTablesSubMenu, this.RecentTablesSubMenu,
this.toolStripSeparator1, this.toolStripSeparator1,
this.ExitMenuItem}); this.ExitMenuItem});
@ -174,6 +176,12 @@
this.RecentTablesSubMenu.Text = "Recent"; this.RecentTablesSubMenu.Text = "Recent";
this.RecentTablesSubMenu.DropDownOpened += new System.EventHandler(this.RecentTablesSubMenu_DropDownOpened); this.RecentTablesSubMenu.DropDownOpened += new System.EventHandler(this.RecentTablesSubMenu_DropDownOpened);
// //
// noneToolStripMenuItem
//
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem";
this.noneToolStripMenuItem.Size = new System.Drawing.Size(103, 22);
this.noneToolStripMenuItem.Text = "None";
//
// toolStripSeparator1 // toolStripSeparator1
// //
this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Name = "toolStripSeparator1";
@ -624,11 +632,12 @@
this.Header.TabIndex = 2; this.Header.TabIndex = 2;
this.Header.Text = "label1"; this.Header.Text = "label1";
// //
// noneToolStripMenuItem // CloseTableFileMenuItem
// //
this.noneToolStripMenuItem.Name = "noneToolStripMenuItem"; this.CloseTableFileMenuItem.Name = "CloseTableFileMenuItem";
this.noneToolStripMenuItem.Size = new System.Drawing.Size(152, 22); this.CloseTableFileMenuItem.Size = new System.Drawing.Size(229, 22);
this.noneToolStripMenuItem.Text = "None"; this.CloseTableFileMenuItem.Text = "Close .tbl file";
this.CloseTableFileMenuItem.Click += new System.EventHandler(this.CloseTableFileMenuItem_Click);
// //
// HexEditor // HexEditor
// //
@ -723,5 +732,6 @@
private System.Windows.Forms.ToolStripMenuItem LoadTableFileMenuItem; private System.Windows.Forms.ToolStripMenuItem LoadTableFileMenuItem;
private System.Windows.Forms.ToolStripMenuItem RecentTablesSubMenu; private System.Windows.Forms.ToolStripMenuItem RecentTablesSubMenu;
private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem; private System.Windows.Forms.ToolStripMenuItem noneToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem CloseTableFileMenuItem;
} }
} }

View File

@ -1220,6 +1220,8 @@ namespace BizHawk.Client.EmuHawk
{ {
SaveAsBinaryMenuItem.Text = "Save as binary..."; SaveAsBinaryMenuItem.Text = "Save as binary...";
} }
CloseTableFileMenuItem.Enabled = _textTable.Any();
} }
private void SaveMenuItem_Click(object sender, EventArgs e) private void SaveMenuItem_Click(object sender, EventArgs e)
@ -1285,6 +1287,11 @@ namespace BizHawk.Client.EmuHawk
} }
} }
private void CloseTableFileMenuItem_Click(object sender, EventArgs e)
{
_textTable.Clear();
}
public void LoadFileFromRecent(string path) public void LoadFileFromRecent(string path)
{ {