From edc31793cf5fb39fd5ffb0929734b6b840d9d506 Mon Sep 17 00:00:00 2001 From: adelikat Date: Wed, 1 Jul 2020 13:13:24 -0500 Subject: [PATCH] StatusStripEx, ToolStripEx - lock down size and text properties --- src/BizHawk.Client.EmuHawk/MainForm.Designer.cs | 2 -- .../config/FirmwaresConfig.Designer.cs | 2 -- src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs | 2 -- .../tools/Cheats/Cheats.Designer.cs | 2 -- .../tools/Lua/LuaConsole.Designer.cs | 2 -- src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs | 2 -- .../tools/TAStudio/TAStudio.Designer.cs | 2 -- src/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs | 1 - .../tools/Watch/RamSearch.Designer.cs | 2 -- .../tools/Watch/RamWatch.Designer.cs | 4 ---- src/BizHawk.WinForms.Controls/MenuEx/StatusStripEx.cs | 8 ++++++++ src/BizHawk.WinForms.Controls/MenuEx/ToolStripEx.cs | 8 ++++++++ 12 files changed, 16 insertions(+), 21 deletions(-) diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs index d24fec9b8e..503c06b914 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -2669,10 +2669,8 @@ namespace BizHawk.Client.EmuHawk this.MainStatusBar.Location = new System.Drawing.Point(0, 386); this.MainStatusBar.Name = "MainStatusBar"; this.MainStatusBar.ShowItemToolTips = true; - this.MainStatusBar.Size = new System.Drawing.Size(470, 22); this.MainStatusBar.SizingGrip = false; this.MainStatusBar.TabIndex = 1; - this.MainStatusBar.Text = "0"; // // DumpStatusButton // diff --git a/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.Designer.cs b/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.Designer.cs index 85548ce6ac..d916ba0ded 100644 --- a/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/config/FirmwaresConfig.Designer.cs @@ -206,9 +206,7 @@ namespace BizHawk.Client.EmuHawk this.tbbOpenFolder}); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(824, 25); this.toolStrip1.TabIndex = 23; - this.toolStrip1.Text = "toolStrip1"; // // tbbGroup // diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs index efdcff7289..012dca6ee0 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs @@ -201,9 +201,7 @@ namespace BizHawk.Client.EmuHawk this.tsbExportText}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(992, 25); this.toolStrip1.TabIndex = 8; - this.toolStrip1.Text = "toolStrip1"; // // tsbLoggingActive // diff --git a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs index 8fec594e90..5e4b51eff1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs @@ -450,9 +450,7 @@ namespace BizHawk.Client.EmuHawk this.LoadGameGenieToolbarItem}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(646, 25); this.toolStrip1.TabIndex = 3; - this.toolStrip1.Text = "toolStrip1"; // // NewToolBarItem // diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs index 60f0d12b86..37326e350b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs @@ -655,9 +655,7 @@ namespace BizHawk.Client.EmuHawk this.EraseToolbarItem}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(584, 25); this.toolStrip1.TabIndex = 5; - this.toolStrip1.Text = "toolStrip1"; // // NewScriptToolbarItem // diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs index 4cfbab07b7..709d60da59 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs @@ -727,10 +727,8 @@ namespace BizHawk.Client.EmuHawk this.NesPPUStatusBar.Location = new System.Drawing.Point(0, 432); this.NesPPUStatusBar.Name = "NesPPUStatusBar"; this.NesPPUStatusBar.Padding = new System.Windows.Forms.Padding(1, 0, 19, 0); - this.NesPPUStatusBar.Size = new System.Drawing.Size(1139, 25); this.NesPPUStatusBar.SizingGrip = false; this.NesPPUStatusBar.TabIndex = 11; - this.NesPPUStatusBar.Text = "statusStrip1"; // // toolStripStatusLabel1 // diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 21feea079a..ca01ae2528 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -1243,9 +1243,7 @@ namespace BizHawk.Client.EmuHawk this.SplicerStatusLabel}); this.TasStatusStrip.Location = new System.Drawing.Point(0, 554); this.TasStatusStrip.Name = "TasStatusStrip"; - this.TasStatusStrip.Size = new System.Drawing.Size(509, 22); this.TasStatusStrip.TabIndex = 4; - this.TasStatusStrip.Text = "statusStrip1"; // // MessageStatusLabel // diff --git a/src/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs index 36151de0e0..1f6c2f6062 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ToolBox.Designer.cs @@ -46,7 +46,6 @@ namespace BizHawk.Client.EmuHawk this.ToolBoxStrip.Location = new System.Drawing.Point(2, 2); this.ToolBoxStrip.Name = "ToolBoxStrip"; this.ToolBoxStrip.Padding = new System.Windows.Forms.Padding(0); - this.ToolBoxStrip.Size = new System.Drawing.Size(137, 179); this.ToolBoxStrip.Stretch = true; this.ToolBoxStrip.TabIndex = 0; this.ToolBoxStrip.TabStop = true; diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs index 02b6bdb426..ce4d833805 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs @@ -967,9 +967,7 @@ namespace BizHawk.Client.EmuHawk this.ErrorIconButton}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(445, 25); this.toolStrip1.TabIndex = 11; - this.toolStrip1.Text = "toolStrip1"; // // DoSearchToolButton // diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs index 7462f8df64..d8d94acf6a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs @@ -281,9 +281,7 @@ namespace BizHawk.Client.EmuHawk this.MessageLabel}); this.statusStrip1.Location = new System.Drawing.Point(0, 356); this.statusStrip1.Name = "statusStrip1"; - this.statusStrip1.Size = new System.Drawing.Size(364, 22); this.statusStrip1.TabIndex = 8; - this.statusStrip1.Text = "statusStrip1"; // // ErrorIconButton // @@ -322,10 +320,8 @@ namespace BizHawk.Client.EmuHawk this.toolStripSeparator5}); this.toolStrip1.Location = new System.Drawing.Point(0, 24); this.toolStrip1.Name = "toolStrip1"; - this.toolStrip1.Size = new System.Drawing.Size(364, 25); this.toolStrip1.TabIndex = 4; this.toolStrip1.TabStop = true; - this.toolStrip1.Text = "toolStrip1"; // // newToolStripButton // diff --git a/src/BizHawk.WinForms.Controls/MenuEx/StatusStripEx.cs b/src/BizHawk.WinForms.Controls/MenuEx/StatusStripEx.cs index c017f684fe..e921c7827e 100644 --- a/src/BizHawk.WinForms.Controls/MenuEx/StatusStripEx.cs +++ b/src/BizHawk.WinForms.Controls/MenuEx/StatusStripEx.cs @@ -1,4 +1,6 @@ using System; +using System.ComponentModel; +using System.Drawing; using System.Windows.Forms; namespace BizHawk.WinForms.Controls @@ -8,6 +10,12 @@ namespace BizHawk.WinForms.Controls /// public class StatusStripEx : StatusStrip { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new string Text => ""; + protected override void WndProc(ref Message m) { base.WndProc(ref m); diff --git a/src/BizHawk.WinForms.Controls/MenuEx/ToolStripEx.cs b/src/BizHawk.WinForms.Controls/MenuEx/ToolStripEx.cs index de9b99cbbc..f49419bf6c 100644 --- a/src/BizHawk.WinForms.Controls/MenuEx/ToolStripEx.cs +++ b/src/BizHawk.WinForms.Controls/MenuEx/ToolStripEx.cs @@ -1,4 +1,6 @@ using System; +using System.ComponentModel; +using System.Drawing; using System.Windows.Forms; //credit: http://blogs.msdn.com/b/rickbrew/archive/2006/01/09/511003.aspx @@ -9,6 +11,12 @@ namespace BizHawk.WinForms.Controls /// public class ToolStripEx : ToolStrip { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new string Text => ""; + protected override void WndProc(ref Message m) { base.WndProc(ref m);