diff --git a/src/BizHawk.Client.Common/config/Config.cs b/src/BizHawk.Client.Common/config/Config.cs index 02bba334f5..9007e667c8 100644 --- a/src/BizHawk.Client.Common/config/Config.cs +++ b/src/BizHawk.Client.Common/config/Config.cs @@ -313,5 +313,7 @@ namespace BizHawk.Client.Common public string LastWrittenFromDetailed { get; set; } = VersionInfo.GetEmuVersion(); public EHostInputMethod HostInputMethod { get; set; } = OSTailoredCode.IsUnixHost ? EHostInputMethod.OpenTK : EHostInputMethod.DirectInput; + + public bool UseStaticWindowTitles { get; set; } } } \ No newline at end of file diff --git a/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs b/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs index a6af8bb896..aa253dec94 100644 --- a/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.Designer.cs @@ -132,7 +132,6 @@ this.MainMenuStrip = this.menuStrip1; this.Name = "CoreFeatureAnalysis"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Core Features"; this.tabControl1.ResumeLayout(false); this.tabPage1.ResumeLayout(false); this.tabPage2.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs b/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs index 635d55f27a..98d4f86b70 100644 --- a/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs +++ b/src/BizHawk.Client.EmuHawk/CoreFeatureAnalysis.cs @@ -108,6 +108,8 @@ namespace BizHawk.Client.EmuHawk [RequiredService] IEmulator Emulator { get; set; } + protected override string WindowTitleStatic => "Core Features"; + public CoreFeatureAnalysis() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/FormBase.cs b/src/BizHawk.Client.EmuHawk/FormBase.cs new file mode 100644 index 0000000000..cd9fda3d14 --- /dev/null +++ b/src/BizHawk.Client.EmuHawk/FormBase.cs @@ -0,0 +1,40 @@ +#nullable enable + +using System; +using System.ComponentModel; +using System.Windows.Forms; + +using BizHawk.Client.Common; + +namespace BizHawk.Client.EmuHawk +{ + public class FormBase : Form + { + private string? _windowTitleStatic; + + public Config? Config { get; protected set; } + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public override string Text + { + get => base.Text; + set => throw new InvalidOperationException("window title can only be changed by calling " + nameof(UpdateWindowTitle) + " (which calls " + nameof(WindowTitle) + " getter)"); + } + + protected virtual string WindowTitle => WindowTitleStatic; + + /// To enforce the "static title" semantics for implementations, this getter will be called once and cached. + protected virtual string WindowTitleStatic => throw new NotImplementedException("you have to implement this; the Designer prevents this from being an abstract method"); + + protected override void OnLoad(EventArgs e) + { + base.OnLoad(e); + UpdateWindowTitle(); + } + + public void UpdateWindowTitle() + => base.Text = Config?.UseStaticWindowTitles == true + ? (_windowTitleStatic ??= WindowTitleStatic) + : WindowTitle; + } +} diff --git a/src/BizHawk.Client.EmuHawk/LogWindow.Designer.cs b/src/BizHawk.Client.EmuHawk/LogWindow.Designer.cs index 2e26086757..6e94be44a5 100644 --- a/src/BizHawk.Client.EmuHawk/LogWindow.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/LogWindow.Designer.cs @@ -155,7 +155,6 @@ namespace BizHawk.Client.EmuHawk this.Name = "LogWindow"; this.ShowIcon = true; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Log Window"; this.Load += new System.EventHandler(this.LogWindow_Load); this.tableLayoutPanel1.ResumeLayout(false); this.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/LogWindow.cs b/src/BizHawk.Client.EmuHawk/LogWindow.cs index 434ec7c69d..446409f020 100644 --- a/src/BizHawk.Client.EmuHawk/LogWindow.cs +++ b/src/BizHawk.Client.EmuHawk/LogWindow.cs @@ -23,6 +23,12 @@ namespace BizHawk.Client.EmuHawk [RequiredService] private IEmulator Emulator { get; set; } + private string _windowTitle = "Log Window"; + + protected override string WindowTitle => _windowTitle; + + protected override string WindowTitleStatic => "Log Window"; + public LogWindow() { InitializeComponent(); @@ -66,7 +72,8 @@ namespace BizHawk.Client.EmuHawk } virtualListView1.VirtualListSize = ss.Length; - Text = title; + _windowTitle = title; + UpdateWindowTitle(); btnClear.Visible = false; } diff --git a/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs b/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs index ec6fa9a236..e1234621fd 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.Designer.cs @@ -2404,7 +2404,6 @@ namespace BizHawk.Client.EmuHawk this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.MainMenuStrip = this.MainformMenu; this.Name = "MainForm"; - this.Text = "BizHawk"; this.Activated += new System.EventHandler(this.MainForm_Activated); this.Deactivate += new System.EventHandler(this.MainForm_Deactivate); this.Load += new System.EventHandler(this.MainForm_Load); diff --git a/src/BizHawk.Client.EmuHawk/MainForm.cs b/src/BizHawk.Client.EmuHawk/MainForm.cs index 4466588cca..0bbc27e7d5 100644 --- a/src/BizHawk.Client.EmuHawk/MainForm.cs +++ b/src/BizHawk.Client.EmuHawk/MainForm.cs @@ -6,6 +6,7 @@ using System.Drawing.Imaging; using System.IO; using System.Linq; using System.Reflection; +using System.Text; using System.Threading; using System.Windows.Forms; @@ -38,7 +39,7 @@ using BizHawk.Emulation.Cores.Consoles.Nintendo.Faust; namespace BizHawk.Client.EmuHawk { - public partial class MainForm : Form, IMainFormForApi, IMainFormForConfig, IMainFormForTools + public partial class MainForm : FormBase, IMainFormForApi, IMainFormForConfig, IMainFormForTools { /// AppliesTo[0] is used as the group label, and Config.PreferredCores[AppliesTo[0]] determines the currently selected option private static readonly IReadOnlyCollection<(string[] AppliesTo, string[] CoreNames)> CoreData = new List<(string[], string[])> { @@ -302,6 +303,8 @@ namespace BizHawk.Client.EmuHawk Database.InitializeDatabase(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb", "gamedb.txt")); BootGodDb.Initialize(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb")); + base.Config = Config; + InputManager.ControllerInputCoalescer = new ControllerInputCoalescer(); GlobalWin.FirmwareManager = new FirmwareManager(); MovieSession = new MovieSession( @@ -874,10 +877,10 @@ namespace BizHawk.Client.EmuHawk private ISoundProvider _currentSoundProvider = new NullSound(44100 / 60); // Reasonable default until we have a core instance - private Config Config + private new Config Config { get => GlobalWin.Config; - set => GlobalWin.Config = value; + set => GlobalWin.Config = base.Config = value; } private ToolManager Tools => GlobalWin.Tools; @@ -1578,53 +1581,65 @@ namespace BizHawk.Client.EmuHawk } } - public void SetWindowText() + protected override string WindowTitle { - string str = ""; - - if (_inResizeLoop) + get { - var size = PresentationPanel.NativeSize; - float ar = (float)size.Width / size.Height; - str += $"({size.Width}x{size.Height})={ar} - "; - } + if (!Config.DispChromeCaptionWindowed || _argParser._chromeless) return string.Empty; //TODO why would you want this? was this a previous attempt at static window titles? - // we need to display FPS somewhere, in this case - if (Config.DispSpeedupFeatures == 0) - { - str += $"({_lastFps:0} fps) - "; - } + var sb = new StringBuilder(); - if (!string.IsNullOrEmpty(VersionInfo.CustomBuildString)) - { - str += $"{VersionInfo.CustomBuildString} "; - } - - str += Emulator.IsNull() ? "BizHawk" : Emulator.System().DisplayName; - - if (VersionInfo.DeveloperBuild) - { - str += " (interim)"; - } - - if (!Emulator.IsNull()) - { - str += $" - {Game.Name}"; - - if (MovieSession.Movie.IsActive()) + if (_inResizeLoop) { - str += $" - {Path.GetFileName(MovieSession.Movie.Filename)}"; + var size = PresentationPanel.NativeSize; + sb.Append($"({size.Width}x{size.Height})={(float) size.Width / size.Height} - "); } - } - if (!Config.DispChromeCaptionWindowed || _argParser._chromeless) - { - str = ""; - } + if (Config.DispSpeedupFeatures == 0) + { + // we need to display FPS somewhere, in this case + sb.Append($"({_lastFps:0} fps) - "); + } - Text = str; + if (!string.IsNullOrEmpty(VersionInfo.CustomBuildString)) + { + sb.Append($"{VersionInfo.CustomBuildString} "); + } + + sb.Append(Emulator.IsNull() ? "BizHawk" : Emulator.System().DisplayName); + + if (VersionInfo.DeveloperBuild) + { + sb.Append(" (interim)"); + } + + if (!Emulator.IsNull()) + { + sb.Append($" - {Game.Name}"); + if (MovieSession.Movie.IsActive()) + { + sb.Append($" - {Path.GetFileName(MovieSession.Movie.Filename)}"); + } + } + + return sb.ToString(); + } } + protected override string WindowTitleStatic + { + get + { + var sb = new StringBuilder(); + if (!string.IsNullOrEmpty(VersionInfo.CustomBuildString)) sb.Append($"{VersionInfo.CustomBuildString} "); + sb.Append("BizHawk"); + if (VersionInfo.DeveloperBuild) sb.Append(" (interim)"); + return sb.ToString(); + } + } + + public void SetWindowText() => UpdateWindowTitle(); + private void ClearAutohold() { ClearHolds(); diff --git a/src/BizHawk.Client.EmuHawk/Program.cs b/src/BizHawk.Client.EmuHawk/Program.cs index 73fca1921d..a536a3425b 100644 --- a/src/BizHawk.Client.EmuHawk/Program.cs +++ b/src/BizHawk.Client.EmuHawk/Program.cs @@ -222,9 +222,9 @@ namespace BizHawk.Client.EmuHawk else { var mf = new MainForm(args); - var title = mf.Text; +// var title = mf.Text; mf.Show(); - mf.Text = title; +// mf.Text = title; try { GlobalWin.ExitCode = mf.ProgramRunLoop(); diff --git a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.Designer.cs b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.Designer.cs index c073e811f1..07e5e8d92d 100644 --- a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.Designer.cs @@ -87,6 +87,9 @@ this.label7 = new BizHawk.WinForms.Controls.LocLabelEx(); this.rbGDIPlus = new System.Windows.Forms.RadioButton(); this.tpMisc = new System.Windows.Forms.TabPage(); + this.flpStaticWindowTitles = new BizHawk.WinForms.Controls.LocSzSingleColumnFLP(); + this.cbStaticWindowTitles = new BizHawk.WinForms.Controls.CheckBoxEx(); + this.lblStaticWindowTitles = new BizHawk.WinForms.Controls.LocLabelEx(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.rbDisplayAbsoluteZero = new System.Windows.Forms.RadioButton(); this.rbDisplayMinimal = new System.Windows.Forms.RadioButton(); @@ -119,6 +122,7 @@ this.tpDispMethod.SuspendLayout(); this.groupBox3.SuspendLayout(); this.tpMisc.SuspendLayout(); + this.flpStaticWindowTitles.SuspendLayout(); this.groupBox5.SuspendLayout(); this.tabPage1.SuspendLayout(); this.groupBox4.SuspendLayout(); @@ -696,6 +700,7 @@ // // tpMisc // + this.tpMisc.Controls.Add(this.flpStaticWindowTitles); this.tpMisc.Controls.Add(this.groupBox5); this.tpMisc.Location = new System.Drawing.Point(4, 22); this.tpMisc.Name = "tpMisc"; @@ -703,6 +708,27 @@ this.tpMisc.TabIndex = 3; this.tpMisc.Text = "Misc"; this.tpMisc.UseVisualStyleBackColor = true; + // + // flpStaticWindowTitles + // + this.flpStaticWindowTitles.Controls.Add(this.cbStaticWindowTitles); + this.flpStaticWindowTitles.Controls.Add(this.lblStaticWindowTitles); + this.flpStaticWindowTitles.Location = new System.Drawing.Point(6, 109); + this.flpStaticWindowTitles.Name = "flpStaticWindowTitles"; + this.flpStaticWindowTitles.Size = new System.Drawing.Size(490, 52); + // + // cbStaticWindowTitles + // + this.cbStaticWindowTitles.Name = "cbStaticWindowTitles"; + this.cbStaticWindowTitles.Text = "Keep window titles static"; + // + // lblStaticWindowTitles + // + this.lblStaticWindowTitles.Location = new System.Drawing.Point(19, 23); + this.lblStaticWindowTitles.Margin = new System.Windows.Forms.Padding(19, 0, 3, 0); + this.lblStaticWindowTitles.Name = "lblStaticWindowTitles"; + this.lblStaticWindowTitles.Text = "Some tools put filenames, status, etc. in their window titles.\nChecking this disa" + + "bles those features, but may fix problems with window capture (i.e. in OBS)."; // // groupBox5 // @@ -946,6 +972,8 @@ this.groupBox3.PerformLayout(); this.tpMisc.ResumeLayout(false); this.tpMisc.PerformLayout(); + this.flpStaticWindowTitles.ResumeLayout(false); + this.flpStaticWindowTitles.PerformLayout(); this.groupBox5.ResumeLayout(false); this.groupBox5.PerformLayout(); this.tabPage1.ResumeLayout(false); @@ -1040,5 +1068,8 @@ private System.Windows.Forms.TextBox txtCropTop; private BizHawk.WinForms.Controls.LocLabelEx label14; private System.Windows.Forms.TextBox txtCropLeft; + private WinForms.Controls.LocSzSingleColumnFLP flpStaticWindowTitles; + private WinForms.Controls.CheckBoxEx cbStaticWindowTitles; + private WinForms.Controls.LocLabelEx lblStaticWindowTitles; } } \ No newline at end of file diff --git a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs index f855b52894..db092d6dc3 100644 --- a/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/DisplayConfig.cs @@ -44,6 +44,8 @@ namespace BizHawk.Client.EmuHawk if (_config.DispSpeedupFeatures == 1) rbDisplayMinimal.Checked = true; if (_config.DispSpeedupFeatures == 0) rbDisplayAbsoluteZero.Checked = true; + cbStaticWindowTitles.Checked = _config.UseStaticWindowTitles; + rbOpenGL.Checked = _config.DispMethod == EDispMethod.OpenGL; rbGDIPlus.Checked = _config.DispMethod == EDispMethod.GdiPlus; rbD3D9.Checked = _config.DispMethod == EDispMethod.SlimDX9; @@ -138,6 +140,8 @@ namespace BizHawk.Client.EmuHawk if (rbDisplayMinimal.Checked) _config.DispSpeedupFeatures = 1; if (rbDisplayAbsoluteZero.Checked) _config.DispSpeedupFeatures = 0; + _config.UseStaticWindowTitles = cbStaticWindowTitles.Checked; + if (rbUseRaw.Checked) _config.DispManagerAR = EDispManagerAR.None; else if (rbUseSystem.Checked) diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.Designer.cs b/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.Designer.cs index b45606db35..d8944f2474 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.Designer.cs @@ -98,7 +98,6 @@ this.Name = "NESSoundConfig"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "NES Sound Channels"; this.Load += new System.EventHandler(this.NESSoundConfig_Load); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); this.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs b/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs index 586d66f268..0f536ee873 100644 --- a/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs +++ b/src/BizHawk.Client.EmuHawk/config/NES/NESSoundConfig.cs @@ -18,6 +18,8 @@ namespace BizHawk.Client.EmuHawk NESSoundConfig_Load(null, null); } + protected override string WindowTitleStatic => "NES Sound Channels"; + public NESSoundConfig() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.Designer.cs index 2a660c0393..eb16391acc 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.Designer.cs @@ -1031,7 +1031,6 @@ namespace BizHawk.Client.EmuHawk this.MainMenuStrip = this.BotMenu; this.Name = "BasicBot"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Basic Bot"; this.Load += new System.EventHandler(this.BasicBot_Load); this.BotMenu.ResumeLayout(false); this.BotMenu.PerformLayout(); diff --git a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs index d1c9bafa1c..e2f879a2fa 100644 --- a/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs +++ b/src/BizHawk.Client.EmuHawk/tools/BasicBot/BasicBot.cs @@ -16,8 +16,6 @@ namespace BizHawk.Client.EmuHawk { public partial class BasicBot : ToolFormBase, IToolFormAutoConfig { - private const string DialogTitle = "Basic Bot"; - private string _currentFileName = ""; private string CurrentFileName @@ -27,9 +25,10 @@ namespace BizHawk.Client.EmuHawk { _currentFileName = value; - Text = !string.IsNullOrWhiteSpace(_currentFileName) - ? $"{DialogTitle} - {Path.GetFileNameWithoutExtension(_currentFileName)}" - : DialogTitle; + _windowTitle = !string.IsNullOrWhiteSpace(_currentFileName) + ? $"{WindowTitleStatic} - {Path.GetFileNameWithoutExtension(_currentFileName)}" + : WindowTitleStatic; + UpdateWindowTitle(); } } @@ -79,6 +78,12 @@ namespace BizHawk.Client.EmuHawk public bool InvisibleEmulation { get; set; } } + private string _windowTitle = "Basic Bot"; + + protected override string WindowTitle => _windowTitle; + + protected override string WindowTitleStatic => "Basic Bot"; + public BasicBot() { InitializeComponent(); @@ -93,7 +98,6 @@ namespace BizHawk.Client.EmuHawk PlayBestButton.Image = Resources.Play; ClearBestButton.Image = Resources.Close; StopBtn.Image = Resources.Stop; - Text = DialogTitle; Settings = new BasicBotSettings(); _comparisonBotAttempt = new BotAttempt(); diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.cs index 09dd28d2f0..855c1d2f4f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.cs @@ -40,9 +40,10 @@ namespace BizHawk.Client.EmuHawk private void SetCurrentFilename(string fname) { _currentFilename = fname; - Text = _currentFilename == null - ? "Code Data Logger" - : $"Code Data Logger - {fname}"; + _windowTitle = _currentFilename == null + ? WindowTitleStatic + : $"{WindowTitleStatic} - {fname}"; + UpdateWindowTitle(); } [RequiredService] @@ -67,6 +68,12 @@ namespace BizHawk.Client.EmuHawk private string _currentFilename; private CodeDataLog _cdl; + private string _windowTitle = "Code Data Logger"; + + protected override string WindowTitle => _windowTitle; + + protected override string WindowTitleStatic => "Code Data Logger"; + public CDL() { SetStyle(ControlStyles.AllPaintingInWmPaint, true); diff --git a/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs b/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs index 6a029c8ea7..b74fbebc82 100644 --- a/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/CDL.designer.cs @@ -228,7 +228,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(150, 130); this.Name = "CDL"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Code Data Logger"; this.Load += new System.EventHandler(this.CDL_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.CDL_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.CDL_DragEnter); diff --git a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs index 52248c7ae6..a3d533e3a1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.Designer.cs @@ -428,7 +428,6 @@ namespace BizHawk.Client.EmuHawk this.Controls.Add(this.CheatListView); this.MinimumSize = new System.Drawing.Size(285, 384); this.Name = "Cheats"; - this.Text = "Cheats"; this.Load += new System.EventHandler(this.Cheats_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewCheatForm_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewCheatForm_DragEnter); diff --git a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs index 68acb63a96..0723b3eb5c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs @@ -29,6 +29,8 @@ namespace BizHawk.Client.EmuHawk private string _sortedColumn; private bool _sortReverse; + protected override string WindowTitleStatic => "Cheats"; + public Cheats() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs index 4ef65012af..efc3a0f3fa 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.Designer.cs @@ -329,7 +329,6 @@ namespace BizHawk.Client.EmuHawk this.MainMenuStrip = this.menuStrip1; this.Name = "GenericDebugger"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Debugger"; this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.GenericDebugger_MouseMove); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs index 17322c5c84..102c2d04bd 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Debugger/GenericDebugger.cs @@ -13,6 +13,8 @@ namespace BizHawk.Client.EmuHawk private const string AddressColumnName = "Address"; private const string InstructionColumnName = "Instruction"; + protected override string WindowTitleStatic => "Debugger"; + public GenericDebugger() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.Designer.cs index dbbda7c18b..10d5fd8f63 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.Designer.cs @@ -471,7 +471,6 @@ this.MainMenuStrip = this.menuStrip1; this.Name = "GbGpuView"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "GPU Viewer"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GbGpuView_FormClosed); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GbGpuView_KeyDown); this.groupBox1.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs index a721ebbe3e..f933dfe3ac 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GB/GBGPUView.cs @@ -54,6 +54,8 @@ namespace BizHawk.Client.EmuHawk } } + protected override string WindowTitleStatic => "GPU Viewer"; + public GbGpuView() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.Designer.cs index b2a5aa15fa..07f8894d1e 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.Designer.cs @@ -115,7 +115,6 @@ this.MaximizeBox = false; this.Name = "GBPrinterView"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Printer Viewer"; this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); this.FormClosed += GBPrinterView_FormClosed; diff --git a/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs b/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs index ba5cd98cd9..a15505eedd 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GB/GBPrinterView.cs @@ -27,6 +27,8 @@ namespace BizHawk.Client.EmuHawk // the entire bitmap private Bitmap _printerHistory; + protected override string WindowTitleStatic => "Printer Viewer"; + public GBPrinterView() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.Designer.cs index da50a16177..fbcfefc5bc 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.Designer.cs @@ -173,7 +173,6 @@ this.Name = "GbaGpuView"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "GBA GPU Viewer"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GbaGpuView_FormClosed); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GbaGpuView_KeyDown); this.groupBox1.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs index 11e9abb147..9f9aa82d0b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GBA/GBAGPUView.cs @@ -30,6 +30,8 @@ namespace BizHawk.Client.EmuHawk // MobileDetailView memory; + protected override string WindowTitleStatic => "GBA GPU Viewer"; + public GbaGpuView() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/GameShark.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/GameShark.Designer.cs index 712c6ba9d2..bc34f207bb 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GameShark.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GameShark.Designer.cs @@ -116,7 +116,6 @@ this.MinimumSize = new System.Drawing.Size(230, 155); this.Name = "GameShark"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Cheat Code Converter"; this.ResumeLayout(false); this.PerformLayout(); } diff --git a/src/BizHawk.Client.EmuHawk/tools/GameShark.cs b/src/BizHawk.Client.EmuHawk/tools/GameShark.cs index fb44b584f2..a259a2533a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/GameShark.cs +++ b/src/BizHawk.Client.EmuHawk/tools/GameShark.cs @@ -22,6 +22,8 @@ namespace BizHawk.Client.EmuHawk // ReSharper disable once UnusedAutoPropertyAccessor.Local private IEmulator Emulator { get; set; } + protected override string WindowTitleStatic => "Cheat Code Converter"; + public GameShark() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.Designer.cs index 3e576402b8..9edf54c396 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.Designer.cs @@ -211,7 +211,6 @@ namespace BizHawk.Client.EmuHawk this.MainMenuStrip = this.menuStrip1; this.Name = "GenVdpViewer"; this.ShowIcon = false; - this.Text = "VDP Viewer"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.VDPViewer_KeyDown); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.cs b/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.cs index 2efe3b99f7..cb0862f09b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Genesis/VDPViewer.cs @@ -26,6 +26,8 @@ namespace BizHawk.Client.EmuHawk return DisplayRectangle.Location; } + protected override string WindowTitleStatic => "VDP Viewer"; + public GenVdpViewer() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs index 8a373f1fe9..cad33f5aa9 100644 --- a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.Designer.cs @@ -473,7 +473,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(360, 180); this.Name = "HexEditor"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Hex Editor"; this.Load += new System.EventHandler(this.HexEditor_Load); this.ResizeEnd += new System.EventHandler(this.HexEditor_ResizeEnd); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HexEditor_KeyDown); diff --git a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs index b466f61368..45fb50e092 100644 --- a/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs +++ b/src/BizHawk.Client.EmuHawk/tools/HexEditor/HexEditor.cs @@ -106,6 +106,12 @@ namespace BizHawk.Client.EmuHawk private SolidBrush _highlightBrush; private SolidBrush _secondaryHighlightBrush; + private string _windowTitle = "Hex Editor"; + + protected override string WindowTitle => _windowTitle; + + protected override string WindowTitleStatic => "Hex Editor"; + public HexEditor() { _hexFind = new HexFind(this); @@ -729,15 +735,21 @@ namespace BizHawk.Client.EmuHawk private void UpdateFormText() { - Text = "Hex Editor"; - if (_highlightedAddress.HasValue) + if (!_highlightedAddress.HasValue) { - Text += " - Editing Address 0x" + string.Format(_numDigitsStr, _highlightedAddress); + _windowTitle = WindowTitleStatic; + } + else + { + var newTitle = "Hex Editor"; + newTitle += " - Editing Address 0x" + string.Format(_numDigitsStr, _highlightedAddress); if (_secondaryHighlightedAddresses.Any()) { - Text += $" (Selected 0x{_secondaryHighlightedAddresses.Count + (_secondaryHighlightedAddresses.Contains(_highlightedAddress.Value) ? 0 : 1):X})"; + newTitle += $" (Selected 0x{_secondaryHighlightedAddresses.Count + (_secondaryHighlightedAddresses.Contains(_highlightedAddress.Value) ? 0 : 1):X})"; } + _windowTitle = newTitle; } + UpdateWindowTitle(); } private bool IsVisible(long address) => ((long) HexScrollBar.Value).RangeToExclusive(HexScrollBar.Value + _rowsVisible).Contains(address >> 4); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs index e5cdd3c621..5fa21cbff6 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.Designer.cs @@ -678,7 +678,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(400, 180); this.Name = "LuaConsole"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Lua Console"; this.Load += new System.EventHandler(this.LuaConsole_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LuaConsole_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper); diff --git a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs index d7031e51cc..25ad24478f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Lua/LuaConsole.cs @@ -67,6 +67,8 @@ namespace BizHawk.Client.EmuHawk [ConfigPersist] public LuaConsoleSettings Settings { get; set; } + protected override string WindowTitleStatic => "Lua Console"; + public LuaConsole() { Settings = new LuaConsoleSettings(); diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs index c3b0ad7610..bf15fa1678 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.Designer.cs @@ -245,7 +245,6 @@ this.MainMenuStrip = this.MacroMenu; this.Name = "MacroInputTool"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Macro Input"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MacroInputTool_FormClosing); this.Load += new System.EventHandler(this.MacroInputTool_Load); this.Resize += new System.EventHandler(this.MacroInputTool_Resize); diff --git a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs index d4448077f5..a6938f649f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Macros/MacroInput.cs @@ -27,6 +27,9 @@ namespace BizHawk.Client.EmuHawk // have options only available for TasMovie private bool _initializing; + + protected override string WindowTitleStatic => "Macro Input"; + public MacroInputTool() { _initializing = true; diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs index de0d05d70b..42df1aac6a 100644 --- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.Designer.cs @@ -190,7 +190,6 @@ this.MainMenuStrip = this.MultiDiskMenuStrip; this.Name = "MultiDiskBundler"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Multi-disk Bundler"; this.Load += new System.EventHandler(this.MultiGameCreator_Load); this.grpName.ResumeLayout(false); this.grpName.PerformLayout(); diff --git a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs index 44fb1208c1..fa9c0517e3 100644 --- a/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs +++ b/src/BizHawk.Client.EmuHawk/tools/MultiDiskBundler/MultiDiskBundler.cs @@ -22,6 +22,8 @@ namespace BizHawk.Client.EmuHawk [RequiredService] public IEmulator Emulator { get; set; } + protected override string WindowTitleStatic => "Multi-disk Bundler"; + public MultiDiskBundler() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.Designer.cs index 134392b1e5..12074110cf 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.Designer.cs @@ -85,7 +85,6 @@ this.Controls.Add(this.label1); this.Controls.Add(this.textBox1); this.Name = "BarcodeEntry"; - this.Text = "Barcode Entry"; this.ResumeLayout(false); this.PerformLayout(); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.cs b/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.cs index dee06df74c..9b8a881ddc 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/BarcodeEntry.cs @@ -10,6 +10,8 @@ namespace BizHawk.Client.EmuHawk [RequiredService] private DatachBarcode Reader { get; set; } + protected override string WindowTitleStatic => "Barcode Entry"; + public BarcodeEntry() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.Designer.cs index 5928b0b745..9cc0c607f4 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.Designer.cs @@ -159,7 +159,6 @@ namespace BizHawk.Client.EmuHawk this.Controls.Add(this.menuStrip1); this.Name = "NESMusicRipper"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Music Ripper"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESMusicRipper_FormClosed); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs index 7cdc6f80b3..f86babd9df 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs @@ -20,6 +20,8 @@ namespace BizHawk.Client.EmuHawk [RequiredService] private NES Nes { get; set; } + protected override string WindowTitleStatic => "Music Ripper"; + public NESMusicRipper() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.Designer.cs index 1c266efcbd..46baf66bd2 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.Designer.cs @@ -366,7 +366,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(687, 588); this.Name = "NESNameTableViewer"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Nametable Viewer"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESNameTableViewer_FormClosed); this.Load += new System.EventHandler(this.NESNameTableViewer_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NesNameTableViewer_KeyDown); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs index 2981e715d0..31ca9c4abf 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs @@ -27,6 +27,8 @@ namespace BizHawk.Client.EmuHawk private int _scanline; + protected override string WindowTitleStatic => "Nametable Viewer"; + public NESNameTableViewer() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs index 62cff9dabb..c9637ad06c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.Designer.cs @@ -705,7 +705,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(767, 445); this.Name = "NesPPU"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "PPU Viewer"; this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NesPPU_FormClosed); this.Load += new System.EventHandler(this.NesPPU_Load); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NesPPU_KeyDown); diff --git a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs index 568f4ebc50..30b1b13536 100644 --- a/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs +++ b/src/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs @@ -44,6 +44,8 @@ namespace BizHawk.Client.EmuHawk set { _chrRomView = value; CalculateFormSize(); } } + protected override string WindowTitleStatic => "PPU Viewer"; + public NesPPU() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.Designer.cs index 29a6001530..c75ca578e5 100644 --- a/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.Designer.cs @@ -214,7 +214,6 @@ namespace BizHawk.Client.EmuHawk this.MainMenuStrip = this.PceBgViewerMenu; this.Name = "PceBgViewer"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Background Viewer"; this.PceBgViewerMenu.ResumeLayout(false); this.PceBgViewerMenu.PerformLayout(); this.groupBox1.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs b/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs index af0acbda30..b76dd940a1 100644 --- a/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs @@ -27,6 +27,8 @@ namespace BizHawk.Client.EmuHawk private int _vdcType; + protected override string WindowTitleStatic => "Background Viewer"; + public PceBgViewer() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.Designer.cs index 911f368c54..e2a8c9afe2 100644 --- a/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.Designer.cs @@ -261,7 +261,6 @@ namespace BizHawk.Client.EmuHawk this.MainMenuStrip = this.SoundMenuStrip; this.Name = "PCESoundDebugger"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Sound Debugger"; this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox3.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs b/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs index 72539d0d82..2b6d8f7aaa 100644 --- a/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs +++ b/src/BizHawk.Client.EmuHawk/tools/PCE/PCESoundDebugger.cs @@ -18,6 +18,8 @@ namespace BizHawk.Client.EmuHawk [RequiredService] private PCEngine PCE { get; set; } + protected override string WindowTitleStatic => "Sound Debugger"; + public PCESoundDebugger() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs index a2998950eb..9996d80f1b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.Designer.cs @@ -156,7 +156,6 @@ namespace BizHawk.Client.EmuHawk this.KeyPreview = true; this.MainMenuStrip = this.menuStrip1; this.Name = "PceTileViewer"; - this.Text = "Tile Viewer"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PceTileViewer_KeyDown); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs b/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs index 5cb8ef6210..66b8a2b72f 100644 --- a/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs @@ -19,6 +19,8 @@ namespace BizHawk.Client.EmuHawk private int _bgPalNum; private int _spPalNum; + protected override string WindowTitleStatic => "Tile Viewer"; + public PceTileViewer() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.Designer.cs index a96b941959..60b1f44dc4 100644 --- a/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.Designer.cs @@ -152,7 +152,6 @@ namespace BizHawk.Client.EmuHawk this.KeyPreview = true; this.MainMenuStrip = this.menuStrip1; this.Name = "SmsVdpViewer"; - this.Text = "VDP Viewer"; this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.VDPViewer_KeyDown); this.groupBox1.ResumeLayout(false); this.groupBox2.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.cs b/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.cs index 4f4ad96f9a..6087827674 100644 --- a/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/SMS/VDPViewer.cs @@ -17,6 +17,8 @@ namespace BizHawk.Client.EmuHawk private int _palIndex; + protected override string WindowTitleStatic => "VDP Viewer"; + public SmsVdpViewer() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.Designer.cs index 3ddf9b297d..c84645474e 100644 --- a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.Designer.cs @@ -2457,7 +2457,6 @@ namespace BizHawk.Client.EmuHawk this.Name = "SNESGraphicsDebugger"; this.ShowIcon = false; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Graphics Debugger"; this.Load += new System.EventHandler(this.SNESGraphicsDebugger_Load); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); diff --git a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs index e42112ade9..7c1c9a6437 100644 --- a/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs +++ b/src/BizHawk.Client.EmuHawk/tools/SNES/SNESGraphicsDebugger.cs @@ -57,6 +57,8 @@ namespace BizHawk.Client.EmuHawk { } + protected override string WindowTitleStatic => "Graphics Debugger"; + public SNESGraphicsDebugger() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs index 352fdcf692..6c36df6f4c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.Designer.cs @@ -1190,7 +1190,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(200, 148); this.Name = "TAStudio"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "TAStudio"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Tastudio_Closing); this.Load += new System.EventHandler(this.Tastudio_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.TAStudio_DragDrop); diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs index 1c0bef119b..8685e8ef66 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.MenuItems.cs @@ -130,7 +130,7 @@ namespace BizHawk.Client.EmuHawk _engaged = true; WantsToControlReboot = true; SetUpColumns(); - SetTextProperty(); + UpdateWindowTitle(); } } else diff --git a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs index 26073e0551..d8f6bcfde6 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TAStudio/TAStudio.cs @@ -264,7 +264,7 @@ namespace BizHawk.Client.EmuHawk MainForm.AddOnScreenMessage("TAStudio engaged"); SetTasMovieCallbacks(CurrentTasMovie); - SetTextProperty(); + UpdateWindowTitle(); MainForm.RelinquishControl(this); _originalEndAction = Config.Movies.MovieEndAction; MainForm.DisableRewind(); @@ -652,7 +652,7 @@ namespace BizHawk.Client.EmuHawk CurrentTasMovie.ChangeLog.Clear(); CurrentTasMovie.ClearChanges(); - SetTextProperty(); + UpdateWindowTitle(); MessageStatusLabel.Text = $"{Path.GetFileName(CurrentTasMovie.Filename)} loaded."; return true; @@ -811,7 +811,7 @@ namespace BizHawk.Client.EmuHawk Update(); CurrentTasMovie.Save(); Settings.RecentTas.Add(CurrentTasMovie.Filename); - SetTextProperty(); + UpdateWindowTitle(); MessageStatusLabel.Text = "File saved."; Cursor = Cursors.Default; } @@ -826,23 +826,14 @@ namespace BizHawk.Client.EmuHawk GlobalWin.Sound.StartSound(); } - private void SetTextProperty() - { - var text = "TAStudio"; - if (CurrentTasMovie != null) - { - text += $" - {CurrentTasMovie.Name}{(CurrentTasMovie.Changes ? "*" : "")}"; - } + protected override string WindowTitle + => CurrentTasMovie == null + ? "TAStudio" + : CurrentTasMovie.Changes + ? $"TAStudio - {CurrentTasMovie.Name}*" + : $"TAStudio - {CurrentTasMovie.Name}"; - if (InvokeRequired) - { - this.Invoke(() => Text = text); - } - else - { - Text = text; - } - } + protected override string WindowTitleStatic => "TAStudio"; public IEnumerable GetSelection() => TasView.SelectedRows; @@ -1133,7 +1124,7 @@ namespace BizHawk.Client.EmuHawk /// private void TasMovie_OnPropertyChanged(object sender, PropertyChangedEventArgs e) { - SetTextProperty(); + UpdateWindowTitle(); } private void TAStudio_DragDrop(object sender, DragEventArgs e) diff --git a/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.Designer.cs index 606e445bcd..9f34ea17d5 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.Designer.cs @@ -1638,7 +1638,6 @@ namespace BizHawk.Client.EmuHawk this.Name = "TI83KeyPad"; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "TI-83 Virtual KeyPad"; this.Load += new System.EventHandler(this.TI83KeyPad_Load); this.menuStrip1.ResumeLayout(false); this.menuStrip1.PerformLayout(); diff --git a/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs b/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs index 26845e4c66..6b5cd27f02 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs @@ -12,6 +12,8 @@ namespace BizHawk.Client.EmuHawk // ReSharper disable once UnusedAutoPropertyAccessor.Local public TI83 Emu { get; private set; } + protected override string WindowTitleStatic => "TI-83 Virtual KeyPad"; + public TI83KeyPad() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs b/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs index 065411fb66..e66578ff0e 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ToolBox.cs @@ -16,6 +16,8 @@ namespace BizHawk.Client.EmuHawk [RequiredService] private IEmulator Emulator { get; set; } + protected override string WindowTitleStatic => string.Empty; + public ToolBox() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/ToolFormBase.cs b/src/BizHawk.Client.EmuHawk/tools/ToolFormBase.cs index bdcab0c0b6..9d00d8265b 100644 --- a/src/BizHawk.Client.EmuHawk/tools/ToolFormBase.cs +++ b/src/BizHawk.Client.EmuHawk/tools/ToolFormBase.cs @@ -9,10 +9,16 @@ using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { - public class ToolFormBase : Form + public abstract class ToolFormBase : FormBase { public ToolManager Tools { get; set; } - public Config Config { get; set; } + + public new Config Config + { + get => base.Config; + set => base.Config = value; //TODO used once in ToolManager (for init) and twice in dumb ways + } + public InputManager InputManager { get; set; } public IMainFormForTools MainForm { get; set; } diff --git a/src/BizHawk.Client.EmuHawk/tools/TraceLogger.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/TraceLogger.Designer.cs index 1e760380ed..d38cba1a8c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TraceLogger.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TraceLogger.Designer.cs @@ -280,7 +280,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(400, 230); this.Name = "TraceLogger"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Trace Logger"; this.Load += new System.EventHandler(this.TraceLogger_Load); this.TracerBox.ResumeLayout(false); this.TraceContextMenu.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs b/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs index 58cbcbb977..b905b1b3ec 100644 --- a/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs +++ b/src/BizHawk.Client.EmuHawk/tools/TraceLogger.cs @@ -59,6 +59,9 @@ namespace BizHawk.Client.EmuHawk private const string DisasmColumnName = "Disasm"; private const string RegistersColumnName = "Registers"; + + protected override string WindowTitleStatic => "Trace Logger"; + public TraceLogger() { InitializeComponent(); diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.Designer.cs index 5a80e21a75..b9ea16944e 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.Designer.cs @@ -146,7 +146,6 @@ namespace BizHawk.Client.EmuHawk this.Controls.Add(this.ControllerBox); this.Controls.Add(this.PadMenu); this.Name = "VirtualpadTool"; - this.Text = "Virtual Pads"; this.Load += new System.EventHandler(this.VirtualpadTool_Load); this.ControllerBox.ResumeLayout(false); this.PadBoxContextMenu.ResumeLayout(false); diff --git a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs index f28d90d2f6..becb2fb77e 100644 --- a/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs +++ b/src/BizHawk.Client.EmuHawk/tools/VirtualPads/VirtualpadsTool.cs @@ -38,6 +38,8 @@ namespace BizHawk.Client.EmuHawk } } + protected override string WindowTitleStatic => "Virtual Pads"; + public VirtualpadTool() { StickyPads = true; diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs index 67c71ba33a..51a980410d 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.Designer.cs @@ -1041,7 +1041,6 @@ namespace BizHawk.Client.EmuHawk this.MinimumSize = new System.Drawing.Size(290, 399); this.Name = "RamSearch"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "RAM Search"; this.Activated += new System.EventHandler(this.NewRamSearch_Activated); this.Load += new System.EventHandler(this.RamSearch_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamSearch_DragDrop); diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs index cf4cb2a4ba..06bb248ec0 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs @@ -39,6 +39,8 @@ namespace BizHawk.Client.EmuHawk private bool _dropdownDontfire; // Used as a hack to get around lame .net dropdowns, there's no way to set their index without firing the SelectedIndexChanged event! + protected override string WindowTitleStatic => "RAM Search"; + public RamSearch() { SetStyle(ControlStyles.AllPaintingInWmPaint, true); diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs index 869d1aabc7..4fc696ae1c 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.Designer.cs @@ -643,7 +643,6 @@ namespace BizHawk.Client.EmuHawk this.Controls.Add(this.WatchListView); this.Name = "RamWatch"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = " RAM Watch"; this.Load += new System.EventHandler(this.RamWatch_Load); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.RamWatch_DragDrop); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper); diff --git a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index fe59bee9d4..d141ecc094 100644 --- a/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/src/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -31,6 +31,8 @@ namespace BizHawk.Client.EmuHawk [OptionalService] private IDebuggable Debuggable { get; set; } + protected override string WindowTitleStatic => "RAM Watch"; + public RamWatch() { InitializeComponent();