Unify setting of window titles, add static title option (fixes #1996)

The only forms that did anything special with their window title were Basic Bot,
CDL, Hex Editor, Log Window, MainForm, and TAStudio. That behaviour is in
WindowTitle, while the rest use WindowTitleStatic.
The implementations of WindowTitleStatic in those six forms are new. There's a
checkbox in `Config` > `Display...` > `Misc` to disable their special behaviour
and use the new static titles.
The Text property is hidden from Designer de/serialisation as well.
This commit is contained in:
YoshiRulz 2020-09-06 21:40:31 +10:00 committed by adelikat
parent 2c77f76a67
commit aa1de1c9d2
72 changed files with 254 additions and 111 deletions

View File

@ -313,5 +313,7 @@ namespace BizHawk.Client.Common
public string LastWrittenFromDetailed { get; set; } = VersionInfo.GetEmuVersion(); public string LastWrittenFromDetailed { get; set; } = VersionInfo.GetEmuVersion();
public EHostInputMethod HostInputMethod { get; set; } = OSTailoredCode.IsUnixHost ? EHostInputMethod.OpenTK : EHostInputMethod.DirectInput; public EHostInputMethod HostInputMethod { get; set; } = OSTailoredCode.IsUnixHost ? EHostInputMethod.OpenTK : EHostInputMethod.DirectInput;
public bool UseStaticWindowTitles { get; set; }
} }
} }

View File

@ -132,7 +132,6 @@
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "CoreFeatureAnalysis"; this.Name = "CoreFeatureAnalysis";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Core Features";
this.tabControl1.ResumeLayout(false); this.tabControl1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false); this.tabPage2.ResumeLayout(false);

View File

@ -108,6 +108,8 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
IEmulator Emulator { get; set; } IEmulator Emulator { get; set; }
protected override string WindowTitleStatic => "Core Features";
public CoreFeatureAnalysis() public CoreFeatureAnalysis()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -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;
/// <remarks>To enforce the "static title" semantics for implementations, this getter will be called once and cached.</remarks>
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;
}
}

View File

@ -155,7 +155,6 @@ namespace BizHawk.Client.EmuHawk
this.Name = "LogWindow"; this.Name = "LogWindow";
this.ShowIcon = true; this.ShowIcon = true;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Log Window";
this.Load += new System.EventHandler(this.LogWindow_Load); this.Load += new System.EventHandler(this.LogWindow_Load);
this.tableLayoutPanel1.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);

View File

@ -23,6 +23,12 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
private IEmulator Emulator { get; set; } private IEmulator Emulator { get; set; }
private string _windowTitle = "Log Window";
protected override string WindowTitle => _windowTitle;
protected override string WindowTitleStatic => "Log Window";
public LogWindow() public LogWindow()
{ {
InitializeComponent(); InitializeComponent();
@ -66,7 +72,8 @@ namespace BizHawk.Client.EmuHawk
} }
virtualListView1.VirtualListSize = ss.Length; virtualListView1.VirtualListSize = ss.Length;
Text = title; _windowTitle = title;
UpdateWindowTitle();
btnClear.Visible = false; btnClear.Visible = false;
} }

View File

@ -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.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.MainMenuStrip = this.MainformMenu; this.MainMenuStrip = this.MainformMenu;
this.Name = "MainForm"; this.Name = "MainForm";
this.Text = "BizHawk";
this.Activated += new System.EventHandler(this.MainForm_Activated); this.Activated += new System.EventHandler(this.MainForm_Activated);
this.Deactivate += new System.EventHandler(this.MainForm_Deactivate); this.Deactivate += new System.EventHandler(this.MainForm_Deactivate);
this.Load += new System.EventHandler(this.MainForm_Load); this.Load += new System.EventHandler(this.MainForm_Load);

View File

@ -6,6 +6,7 @@ using System.Drawing.Imaging;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Reflection; using System.Reflection;
using System.Text;
using System.Threading; using System.Threading;
using System.Windows.Forms; using System.Windows.Forms;
@ -38,7 +39,7 @@ using BizHawk.Emulation.Cores.Consoles.Nintendo.Faust;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
public partial class MainForm : Form, IMainFormForApi, IMainFormForConfig, IMainFormForTools public partial class MainForm : FormBase, IMainFormForApi, IMainFormForConfig, IMainFormForTools
{ {
/// <remarks><c>AppliesTo[0]</c> is used as the group label, and <c>Config.PreferredCores[AppliesTo[0]]</c> determines the currently selected option</remarks> /// <remarks><c>AppliesTo[0]</c> is used as the group label, and <c>Config.PreferredCores[AppliesTo[0]]</c> determines the currently selected option</remarks>
private static readonly IReadOnlyCollection<(string[] AppliesTo, string[] CoreNames)> CoreData = new List<(string[], string[])> { 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")); Database.InitializeDatabase(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb", "gamedb.txt"));
BootGodDb.Initialize(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb")); BootGodDb.Initialize(Path.Combine(PathUtils.ExeDirectoryPath, "gamedb"));
base.Config = Config;
InputManager.ControllerInputCoalescer = new ControllerInputCoalescer(); InputManager.ControllerInputCoalescer = new ControllerInputCoalescer();
GlobalWin.FirmwareManager = new FirmwareManager(); GlobalWin.FirmwareManager = new FirmwareManager();
MovieSession = new MovieSession( 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 ISoundProvider _currentSoundProvider = new NullSound(44100 / 60); // Reasonable default until we have a core instance
private Config Config private new Config Config
{ {
get => GlobalWin.Config; get => GlobalWin.Config;
set => GlobalWin.Config = value; set => GlobalWin.Config = base.Config = value;
} }
private ToolManager Tools => GlobalWin.Tools; private ToolManager Tools => GlobalWin.Tools;
@ -1578,52 +1581,64 @@ namespace BizHawk.Client.EmuHawk
} }
} }
public void SetWindowText() protected override string WindowTitle
{ {
string str = ""; get
{
if (!Config.DispChromeCaptionWindowed || _argParser._chromeless) return string.Empty; //TODO why would you want this? was this a previous attempt at static window titles?
var sb = new StringBuilder();
if (_inResizeLoop) if (_inResizeLoop)
{ {
var size = PresentationPanel.NativeSize; var size = PresentationPanel.NativeSize;
float ar = (float)size.Width / size.Height; sb.Append($"({size.Width}x{size.Height})={(float) size.Width / size.Height} - ");
str += $"({size.Width}x{size.Height})={ar} - ";
} }
// we need to display FPS somewhere, in this case
if (Config.DispSpeedupFeatures == 0) if (Config.DispSpeedupFeatures == 0)
{ {
str += $"({_lastFps:0} fps) - "; // we need to display FPS somewhere, in this case
sb.Append($"({_lastFps:0} fps) - ");
} }
if (!string.IsNullOrEmpty(VersionInfo.CustomBuildString)) if (!string.IsNullOrEmpty(VersionInfo.CustomBuildString))
{ {
str += $"{VersionInfo.CustomBuildString} "; sb.Append($"{VersionInfo.CustomBuildString} ");
} }
str += Emulator.IsNull() ? "BizHawk" : Emulator.System().DisplayName; sb.Append(Emulator.IsNull() ? "BizHawk" : Emulator.System().DisplayName);
if (VersionInfo.DeveloperBuild) if (VersionInfo.DeveloperBuild)
{ {
str += " (interim)"; sb.Append(" (interim)");
} }
if (!Emulator.IsNull()) if (!Emulator.IsNull())
{ {
str += $" - {Game.Name}"; sb.Append($" - {Game.Name}");
if (MovieSession.Movie.IsActive()) if (MovieSession.Movie.IsActive())
{ {
str += $" - {Path.GetFileName(MovieSession.Movie.Filename)}"; sb.Append($" - {Path.GetFileName(MovieSession.Movie.Filename)}");
} }
} }
if (!Config.DispChromeCaptionWindowed || _argParser._chromeless) return sb.ToString();
}
}
protected override string WindowTitleStatic
{ {
str = ""; 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();
}
} }
Text = str; public void SetWindowText() => UpdateWindowTitle();
}
private void ClearAutohold() private void ClearAutohold()
{ {

View File

@ -222,9 +222,9 @@ namespace BizHawk.Client.EmuHawk
else else
{ {
var mf = new MainForm(args); var mf = new MainForm(args);
var title = mf.Text; // var title = mf.Text;
mf.Show(); mf.Show();
mf.Text = title; // mf.Text = title;
try try
{ {
GlobalWin.ExitCode = mf.ProgramRunLoop(); GlobalWin.ExitCode = mf.ProgramRunLoop();

View File

@ -87,6 +87,9 @@
this.label7 = new BizHawk.WinForms.Controls.LocLabelEx(); this.label7 = new BizHawk.WinForms.Controls.LocLabelEx();
this.rbGDIPlus = new System.Windows.Forms.RadioButton(); this.rbGDIPlus = new System.Windows.Forms.RadioButton();
this.tpMisc = new System.Windows.Forms.TabPage(); 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.groupBox5 = new System.Windows.Forms.GroupBox();
this.rbDisplayAbsoluteZero = new System.Windows.Forms.RadioButton(); this.rbDisplayAbsoluteZero = new System.Windows.Forms.RadioButton();
this.rbDisplayMinimal = new System.Windows.Forms.RadioButton(); this.rbDisplayMinimal = new System.Windows.Forms.RadioButton();
@ -119,6 +122,7 @@
this.tpDispMethod.SuspendLayout(); this.tpDispMethod.SuspendLayout();
this.groupBox3.SuspendLayout(); this.groupBox3.SuspendLayout();
this.tpMisc.SuspendLayout(); this.tpMisc.SuspendLayout();
this.flpStaticWindowTitles.SuspendLayout();
this.groupBox5.SuspendLayout(); this.groupBox5.SuspendLayout();
this.tabPage1.SuspendLayout(); this.tabPage1.SuspendLayout();
this.groupBox4.SuspendLayout(); this.groupBox4.SuspendLayout();
@ -696,6 +700,7 @@
// //
// tpMisc // tpMisc
// //
this.tpMisc.Controls.Add(this.flpStaticWindowTitles);
this.tpMisc.Controls.Add(this.groupBox5); this.tpMisc.Controls.Add(this.groupBox5);
this.tpMisc.Location = new System.Drawing.Point(4, 22); this.tpMisc.Location = new System.Drawing.Point(4, 22);
this.tpMisc.Name = "tpMisc"; this.tpMisc.Name = "tpMisc";
@ -703,6 +708,27 @@
this.tpMisc.TabIndex = 3; this.tpMisc.TabIndex = 3;
this.tpMisc.Text = "Misc"; this.tpMisc.Text = "Misc";
this.tpMisc.UseVisualStyleBackColor = true; 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 // groupBox5
// //
@ -946,6 +972,8 @@
this.groupBox3.PerformLayout(); this.groupBox3.PerformLayout();
this.tpMisc.ResumeLayout(false); this.tpMisc.ResumeLayout(false);
this.tpMisc.PerformLayout(); this.tpMisc.PerformLayout();
this.flpStaticWindowTitles.ResumeLayout(false);
this.flpStaticWindowTitles.PerformLayout();
this.groupBox5.ResumeLayout(false); this.groupBox5.ResumeLayout(false);
this.groupBox5.PerformLayout(); this.groupBox5.PerformLayout();
this.tabPage1.ResumeLayout(false); this.tabPage1.ResumeLayout(false);
@ -1040,5 +1068,8 @@
private System.Windows.Forms.TextBox txtCropTop; private System.Windows.Forms.TextBox txtCropTop;
private BizHawk.WinForms.Controls.LocLabelEx label14; private BizHawk.WinForms.Controls.LocLabelEx label14;
private System.Windows.Forms.TextBox txtCropLeft; private System.Windows.Forms.TextBox txtCropLeft;
private WinForms.Controls.LocSzSingleColumnFLP flpStaticWindowTitles;
private WinForms.Controls.CheckBoxEx cbStaticWindowTitles;
private WinForms.Controls.LocLabelEx lblStaticWindowTitles;
} }
} }

View File

@ -44,6 +44,8 @@ namespace BizHawk.Client.EmuHawk
if (_config.DispSpeedupFeatures == 1) rbDisplayMinimal.Checked = true; if (_config.DispSpeedupFeatures == 1) rbDisplayMinimal.Checked = true;
if (_config.DispSpeedupFeatures == 0) rbDisplayAbsoluteZero.Checked = true; if (_config.DispSpeedupFeatures == 0) rbDisplayAbsoluteZero.Checked = true;
cbStaticWindowTitles.Checked = _config.UseStaticWindowTitles;
rbOpenGL.Checked = _config.DispMethod == EDispMethod.OpenGL; rbOpenGL.Checked = _config.DispMethod == EDispMethod.OpenGL;
rbGDIPlus.Checked = _config.DispMethod == EDispMethod.GdiPlus; rbGDIPlus.Checked = _config.DispMethod == EDispMethod.GdiPlus;
rbD3D9.Checked = _config.DispMethod == EDispMethod.SlimDX9; rbD3D9.Checked = _config.DispMethod == EDispMethod.SlimDX9;
@ -138,6 +140,8 @@ namespace BizHawk.Client.EmuHawk
if (rbDisplayMinimal.Checked) _config.DispSpeedupFeatures = 1; if (rbDisplayMinimal.Checked) _config.DispSpeedupFeatures = 1;
if (rbDisplayAbsoluteZero.Checked) _config.DispSpeedupFeatures = 0; if (rbDisplayAbsoluteZero.Checked) _config.DispSpeedupFeatures = 0;
_config.UseStaticWindowTitles = cbStaticWindowTitles.Checked;
if (rbUseRaw.Checked) if (rbUseRaw.Checked)
_config.DispManagerAR = EDispManagerAR.None; _config.DispManagerAR = EDispManagerAR.None;
else if (rbUseSystem.Checked) else if (rbUseSystem.Checked)

View File

@ -98,7 +98,6 @@
this.Name = "NESSoundConfig"; this.Name = "NESSoundConfig";
this.ShowIcon = false; this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "NES Sound Channels";
this.Load += new System.EventHandler(this.NESSoundConfig_Load); this.Load += new System.EventHandler(this.NESSoundConfig_Load);
((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit();
this.ResumeLayout(false); this.ResumeLayout(false);

View File

@ -18,6 +18,8 @@ namespace BizHawk.Client.EmuHawk
NESSoundConfig_Load(null, null); NESSoundConfig_Load(null, null);
} }
protected override string WindowTitleStatic => "NES Sound Channels";
public NESSoundConfig() public NESSoundConfig()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -1031,7 +1031,6 @@ namespace BizHawk.Client.EmuHawk
this.MainMenuStrip = this.BotMenu; this.MainMenuStrip = this.BotMenu;
this.Name = "BasicBot"; this.Name = "BasicBot";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Basic Bot";
this.Load += new System.EventHandler(this.BasicBot_Load); this.Load += new System.EventHandler(this.BasicBot_Load);
this.BotMenu.ResumeLayout(false); this.BotMenu.ResumeLayout(false);
this.BotMenu.PerformLayout(); this.BotMenu.PerformLayout();

View File

@ -16,8 +16,6 @@ namespace BizHawk.Client.EmuHawk
{ {
public partial class BasicBot : ToolFormBase, IToolFormAutoConfig public partial class BasicBot : ToolFormBase, IToolFormAutoConfig
{ {
private const string DialogTitle = "Basic Bot";
private string _currentFileName = ""; private string _currentFileName = "";
private string CurrentFileName private string CurrentFileName
@ -27,9 +25,10 @@ namespace BizHawk.Client.EmuHawk
{ {
_currentFileName = value; _currentFileName = value;
Text = !string.IsNullOrWhiteSpace(_currentFileName) _windowTitle = !string.IsNullOrWhiteSpace(_currentFileName)
? $"{DialogTitle} - {Path.GetFileNameWithoutExtension(_currentFileName)}" ? $"{WindowTitleStatic} - {Path.GetFileNameWithoutExtension(_currentFileName)}"
: DialogTitle; : WindowTitleStatic;
UpdateWindowTitle();
} }
} }
@ -79,6 +78,12 @@ namespace BizHawk.Client.EmuHawk
public bool InvisibleEmulation { get; set; } public bool InvisibleEmulation { get; set; }
} }
private string _windowTitle = "Basic Bot";
protected override string WindowTitle => _windowTitle;
protected override string WindowTitleStatic => "Basic Bot";
public BasicBot() public BasicBot()
{ {
InitializeComponent(); InitializeComponent();
@ -93,7 +98,6 @@ namespace BizHawk.Client.EmuHawk
PlayBestButton.Image = Resources.Play; PlayBestButton.Image = Resources.Play;
ClearBestButton.Image = Resources.Close; ClearBestButton.Image = Resources.Close;
StopBtn.Image = Resources.Stop; StopBtn.Image = Resources.Stop;
Text = DialogTitle;
Settings = new BasicBotSettings(); Settings = new BasicBotSettings();
_comparisonBotAttempt = new BotAttempt(); _comparisonBotAttempt = new BotAttempt();

View File

@ -40,9 +40,10 @@ namespace BizHawk.Client.EmuHawk
private void SetCurrentFilename(string fname) private void SetCurrentFilename(string fname)
{ {
_currentFilename = fname; _currentFilename = fname;
Text = _currentFilename == null _windowTitle = _currentFilename == null
? "Code Data Logger" ? WindowTitleStatic
: $"Code Data Logger - {fname}"; : $"{WindowTitleStatic} - {fname}";
UpdateWindowTitle();
} }
[RequiredService] [RequiredService]
@ -67,6 +68,12 @@ namespace BizHawk.Client.EmuHawk
private string _currentFilename; private string _currentFilename;
private CodeDataLog _cdl; private CodeDataLog _cdl;
private string _windowTitle = "Code Data Logger";
protected override string WindowTitle => _windowTitle;
protected override string WindowTitleStatic => "Code Data Logger";
public CDL() public CDL()
{ {
SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true);

View File

@ -228,7 +228,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(150, 130); this.MinimumSize = new System.Drawing.Size(150, 130);
this.Name = "CDL"; this.Name = "CDL";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Code Data Logger";
this.Load += new System.EventHandler(this.CDL_Load); this.Load += new System.EventHandler(this.CDL_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.CDL_DragDrop); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.CDL_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.CDL_DragEnter); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.CDL_DragEnter);

View File

@ -428,7 +428,6 @@ namespace BizHawk.Client.EmuHawk
this.Controls.Add(this.CheatListView); this.Controls.Add(this.CheatListView);
this.MinimumSize = new System.Drawing.Size(285, 384); this.MinimumSize = new System.Drawing.Size(285, 384);
this.Name = "Cheats"; this.Name = "Cheats";
this.Text = "Cheats";
this.Load += new System.EventHandler(this.Cheats_Load); this.Load += new System.EventHandler(this.Cheats_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewCheatForm_DragDrop); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewCheatForm_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewCheatForm_DragEnter); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.NewCheatForm_DragEnter);

View File

@ -29,6 +29,8 @@ namespace BizHawk.Client.EmuHawk
private string _sortedColumn; private string _sortedColumn;
private bool _sortReverse; private bool _sortReverse;
protected override string WindowTitleStatic => "Cheats";
public Cheats() public Cheats()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -329,7 +329,6 @@ namespace BizHawk.Client.EmuHawk
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "GenericDebugger"; this.Name = "GenericDebugger";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Debugger";
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.GenericDebugger_MouseMove); this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.GenericDebugger_MouseMove);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();

View File

@ -13,6 +13,8 @@ namespace BizHawk.Client.EmuHawk
private const string AddressColumnName = "Address"; private const string AddressColumnName = "Address";
private const string InstructionColumnName = "Instruction"; private const string InstructionColumnName = "Instruction";
protected override string WindowTitleStatic => "Debugger";
public GenericDebugger() public GenericDebugger()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -471,7 +471,6 @@
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "GbGpuView"; this.Name = "GbGpuView";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "GPU Viewer";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GbGpuView_FormClosed); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GbGpuView_FormClosed);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GbGpuView_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GbGpuView_KeyDown);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);

View File

@ -54,6 +54,8 @@ namespace BizHawk.Client.EmuHawk
} }
} }
protected override string WindowTitleStatic => "GPU Viewer";
public GbGpuView() public GbGpuView()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -115,7 +115,6 @@
this.MaximizeBox = false; this.MaximizeBox = false;
this.Name = "GBPrinterView"; this.Name = "GBPrinterView";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Printer Viewer";
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();
this.FormClosed += GBPrinterView_FormClosed; this.FormClosed += GBPrinterView_FormClosed;

View File

@ -27,6 +27,8 @@ namespace BizHawk.Client.EmuHawk
// the entire bitmap // the entire bitmap
private Bitmap _printerHistory; private Bitmap _printerHistory;
protected override string WindowTitleStatic => "Printer Viewer";
public GBPrinterView() public GBPrinterView()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -173,7 +173,6 @@
this.Name = "GbaGpuView"; this.Name = "GbaGpuView";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Show;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "GBA GPU Viewer";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GbaGpuView_FormClosed); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.GbaGpuView_FormClosed);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GbaGpuView_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.GbaGpuView_KeyDown);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);

View File

@ -30,6 +30,8 @@ namespace BizHawk.Client.EmuHawk
// MobileDetailView memory; // MobileDetailView memory;
protected override string WindowTitleStatic => "GBA GPU Viewer";
public GbaGpuView() public GbaGpuView()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -116,7 +116,6 @@
this.MinimumSize = new System.Drawing.Size(230, 155); this.MinimumSize = new System.Drawing.Size(230, 155);
this.Name = "GameShark"; this.Name = "GameShark";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Cheat Code Converter";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
} }

View File

@ -22,6 +22,8 @@ namespace BizHawk.Client.EmuHawk
// ReSharper disable once UnusedAutoPropertyAccessor.Local // ReSharper disable once UnusedAutoPropertyAccessor.Local
private IEmulator Emulator { get; set; } private IEmulator Emulator { get; set; }
protected override string WindowTitleStatic => "Cheat Code Converter";
public GameShark() public GameShark()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -211,7 +211,6 @@ namespace BizHawk.Client.EmuHawk
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "GenVdpViewer"; this.Name = "GenVdpViewer";
this.ShowIcon = false; this.ShowIcon = false;
this.Text = "VDP Viewer";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.VDPViewer_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.VDPViewer_KeyDown);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);

View File

@ -26,6 +26,8 @@ namespace BizHawk.Client.EmuHawk
return DisplayRectangle.Location; return DisplayRectangle.Location;
} }
protected override string WindowTitleStatic => "VDP Viewer";
public GenVdpViewer() public GenVdpViewer()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -473,7 +473,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(360, 180); this.MinimumSize = new System.Drawing.Size(360, 180);
this.Name = "HexEditor"; this.Name = "HexEditor";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Hex Editor";
this.Load += new System.EventHandler(this.HexEditor_Load); this.Load += new System.EventHandler(this.HexEditor_Load);
this.ResizeEnd += new System.EventHandler(this.HexEditor_ResizeEnd); this.ResizeEnd += new System.EventHandler(this.HexEditor_ResizeEnd);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HexEditor_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.HexEditor_KeyDown);

View File

@ -106,6 +106,12 @@ namespace BizHawk.Client.EmuHawk
private SolidBrush _highlightBrush; private SolidBrush _highlightBrush;
private SolidBrush _secondaryHighlightBrush; private SolidBrush _secondaryHighlightBrush;
private string _windowTitle = "Hex Editor";
protected override string WindowTitle => _windowTitle;
protected override string WindowTitleStatic => "Hex Editor";
public HexEditor() public HexEditor()
{ {
_hexFind = new HexFind(this); _hexFind = new HexFind(this);
@ -729,15 +735,21 @@ namespace BizHawk.Client.EmuHawk
private void UpdateFormText() 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()) 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); private bool IsVisible(long address) => ((long) HexScrollBar.Value).RangeToExclusive(HexScrollBar.Value + _rowsVisible).Contains(address >> 4);

View File

@ -678,7 +678,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(400, 180); this.MinimumSize = new System.Drawing.Size(400, 180);
this.Name = "LuaConsole"; this.Name = "LuaConsole";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Lua Console";
this.Load += new System.EventHandler(this.LuaConsole_Load); this.Load += new System.EventHandler(this.LuaConsole_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LuaConsole_DragDrop); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.LuaConsole_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);

View File

@ -67,6 +67,8 @@ namespace BizHawk.Client.EmuHawk
[ConfigPersist] [ConfigPersist]
public LuaConsoleSettings Settings { get; set; } public LuaConsoleSettings Settings { get; set; }
protected override string WindowTitleStatic => "Lua Console";
public LuaConsole() public LuaConsole()
{ {
Settings = new LuaConsoleSettings(); Settings = new LuaConsoleSettings();

View File

@ -245,7 +245,6 @@
this.MainMenuStrip = this.MacroMenu; this.MainMenuStrip = this.MacroMenu;
this.Name = "MacroInputTool"; this.Name = "MacroInputTool";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Macro Input";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MacroInputTool_FormClosing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MacroInputTool_FormClosing);
this.Load += new System.EventHandler(this.MacroInputTool_Load); this.Load += new System.EventHandler(this.MacroInputTool_Load);
this.Resize += new System.EventHandler(this.MacroInputTool_Resize); this.Resize += new System.EventHandler(this.MacroInputTool_Resize);

View File

@ -27,6 +27,9 @@ namespace BizHawk.Client.EmuHawk
// have options only available for TasMovie // have options only available for TasMovie
private bool _initializing; private bool _initializing;
protected override string WindowTitleStatic => "Macro Input";
public MacroInputTool() public MacroInputTool()
{ {
_initializing = true; _initializing = true;

View File

@ -190,7 +190,6 @@
this.MainMenuStrip = this.MultiDiskMenuStrip; this.MainMenuStrip = this.MultiDiskMenuStrip;
this.Name = "MultiDiskBundler"; this.Name = "MultiDiskBundler";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Multi-disk Bundler";
this.Load += new System.EventHandler(this.MultiGameCreator_Load); this.Load += new System.EventHandler(this.MultiGameCreator_Load);
this.grpName.ResumeLayout(false); this.grpName.ResumeLayout(false);
this.grpName.PerformLayout(); this.grpName.PerformLayout();

View File

@ -22,6 +22,8 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
public IEmulator Emulator { get; set; } public IEmulator Emulator { get; set; }
protected override string WindowTitleStatic => "Multi-disk Bundler";
public MultiDiskBundler() public MultiDiskBundler()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -85,7 +85,6 @@
this.Controls.Add(this.label1); this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1); this.Controls.Add(this.textBox1);
this.Name = "BarcodeEntry"; this.Name = "BarcodeEntry";
this.Text = "Barcode Entry";
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();

View File

@ -10,6 +10,8 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
private DatachBarcode Reader { get; set; } private DatachBarcode Reader { get; set; }
protected override string WindowTitleStatic => "Barcode Entry";
public BarcodeEntry() public BarcodeEntry()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -159,7 +159,6 @@ namespace BizHawk.Client.EmuHawk
this.Controls.Add(this.menuStrip1); this.Controls.Add(this.menuStrip1);
this.Name = "NESMusicRipper"; this.Name = "NESMusicRipper";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Music Ripper";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESMusicRipper_FormClosed); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESMusicRipper_FormClosed);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();

View File

@ -20,6 +20,8 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
private NES Nes { get; set; } private NES Nes { get; set; }
protected override string WindowTitleStatic => "Music Ripper";
public NESMusicRipper() public NESMusicRipper()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -366,7 +366,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(687, 588); this.MinimumSize = new System.Drawing.Size(687, 588);
this.Name = "NESNameTableViewer"; this.Name = "NESNameTableViewer";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Nametable Viewer";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESNameTableViewer_FormClosed); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NESNameTableViewer_FormClosed);
this.Load += new System.EventHandler(this.NESNameTableViewer_Load); this.Load += new System.EventHandler(this.NESNameTableViewer_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NesNameTableViewer_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NesNameTableViewer_KeyDown);

View File

@ -27,6 +27,8 @@ namespace BizHawk.Client.EmuHawk
private int _scanline; private int _scanline;
protected override string WindowTitleStatic => "Nametable Viewer";
public NESNameTableViewer() public NESNameTableViewer()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -705,7 +705,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(767, 445); this.MinimumSize = new System.Drawing.Size(767, 445);
this.Name = "NesPPU"; this.Name = "NesPPU";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "PPU Viewer";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NesPPU_FormClosed); this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.NesPPU_FormClosed);
this.Load += new System.EventHandler(this.NesPPU_Load); this.Load += new System.EventHandler(this.NesPPU_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NesPPU_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.NesPPU_KeyDown);

View File

@ -44,6 +44,8 @@ namespace BizHawk.Client.EmuHawk
set { _chrRomView = value; CalculateFormSize(); } set { _chrRomView = value; CalculateFormSize(); }
} }
protected override string WindowTitleStatic => "PPU Viewer";
public NesPPU() public NesPPU()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -214,7 +214,6 @@ namespace BizHawk.Client.EmuHawk
this.MainMenuStrip = this.PceBgViewerMenu; this.MainMenuStrip = this.PceBgViewerMenu;
this.Name = "PceBgViewer"; this.Name = "PceBgViewer";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Background Viewer";
this.PceBgViewerMenu.ResumeLayout(false); this.PceBgViewerMenu.ResumeLayout(false);
this.PceBgViewerMenu.PerformLayout(); this.PceBgViewerMenu.PerformLayout();
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);

View File

@ -27,6 +27,8 @@ namespace BizHawk.Client.EmuHawk
private int _vdcType; private int _vdcType;
protected override string WindowTitleStatic => "Background Viewer";
public PceBgViewer() public PceBgViewer()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -261,7 +261,6 @@ namespace BizHawk.Client.EmuHawk
this.MainMenuStrip = this.SoundMenuStrip; this.MainMenuStrip = this.SoundMenuStrip;
this.Name = "PCESoundDebugger"; this.Name = "PCESoundDebugger";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Sound Debugger";
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);
this.groupBox3.ResumeLayout(false); this.groupBox3.ResumeLayout(false);

View File

@ -18,6 +18,8 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
private PCEngine PCE { get; set; } private PCEngine PCE { get; set; }
protected override string WindowTitleStatic => "Sound Debugger";
public PCESoundDebugger() public PCESoundDebugger()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -156,7 +156,6 @@ namespace BizHawk.Client.EmuHawk
this.KeyPreview = true; this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "PceTileViewer"; this.Name = "PceTileViewer";
this.Text = "Tile Viewer";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PceTileViewer_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.PceTileViewer_KeyDown);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);

View File

@ -19,6 +19,8 @@ namespace BizHawk.Client.EmuHawk
private int _bgPalNum; private int _bgPalNum;
private int _spPalNum; private int _spPalNum;
protected override string WindowTitleStatic => "Tile Viewer";
public PceTileViewer() public PceTileViewer()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -152,7 +152,6 @@ namespace BizHawk.Client.EmuHawk
this.KeyPreview = true; this.KeyPreview = true;
this.MainMenuStrip = this.menuStrip1; this.MainMenuStrip = this.menuStrip1;
this.Name = "SmsVdpViewer"; this.Name = "SmsVdpViewer";
this.Text = "VDP Viewer";
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.VDPViewer_KeyDown); this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.VDPViewer_KeyDown);
this.groupBox1.ResumeLayout(false); this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false); this.groupBox2.ResumeLayout(false);

View File

@ -17,6 +17,8 @@ namespace BizHawk.Client.EmuHawk
private int _palIndex; private int _palIndex;
protected override string WindowTitleStatic => "VDP Viewer";
public SmsVdpViewer() public SmsVdpViewer()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -2457,7 +2457,6 @@ namespace BizHawk.Client.EmuHawk
this.Name = "SNESGraphicsDebugger"; this.Name = "SNESGraphicsDebugger";
this.ShowIcon = false; this.ShowIcon = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Graphics Debugger";
this.Load += new System.EventHandler(this.SNESGraphicsDebugger_Load); this.Load += new System.EventHandler(this.SNESGraphicsDebugger_Load);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();

View File

@ -57,6 +57,8 @@ namespace BizHawk.Client.EmuHawk
{ {
} }
protected override string WindowTitleStatic => "Graphics Debugger";
public SNESGraphicsDebugger() public SNESGraphicsDebugger()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -1190,7 +1190,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(200, 148); this.MinimumSize = new System.Drawing.Size(200, 148);
this.Name = "TAStudio"; this.Name = "TAStudio";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "TAStudio";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Tastudio_Closing); this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Tastudio_Closing);
this.Load += new System.EventHandler(this.Tastudio_Load); this.Load += new System.EventHandler(this.Tastudio_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.TAStudio_DragDrop); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.TAStudio_DragDrop);

View File

@ -130,7 +130,7 @@ namespace BizHawk.Client.EmuHawk
_engaged = true; _engaged = true;
WantsToControlReboot = true; WantsToControlReboot = true;
SetUpColumns(); SetUpColumns();
SetTextProperty(); UpdateWindowTitle();
} }
} }
else else

View File

@ -264,7 +264,7 @@ namespace BizHawk.Client.EmuHawk
MainForm.AddOnScreenMessage("TAStudio engaged"); MainForm.AddOnScreenMessage("TAStudio engaged");
SetTasMovieCallbacks(CurrentTasMovie); SetTasMovieCallbacks(CurrentTasMovie);
SetTextProperty(); UpdateWindowTitle();
MainForm.RelinquishControl(this); MainForm.RelinquishControl(this);
_originalEndAction = Config.Movies.MovieEndAction; _originalEndAction = Config.Movies.MovieEndAction;
MainForm.DisableRewind(); MainForm.DisableRewind();
@ -652,7 +652,7 @@ namespace BizHawk.Client.EmuHawk
CurrentTasMovie.ChangeLog.Clear(); CurrentTasMovie.ChangeLog.Clear();
CurrentTasMovie.ClearChanges(); CurrentTasMovie.ClearChanges();
SetTextProperty(); UpdateWindowTitle();
MessageStatusLabel.Text = $"{Path.GetFileName(CurrentTasMovie.Filename)} loaded."; MessageStatusLabel.Text = $"{Path.GetFileName(CurrentTasMovie.Filename)} loaded.";
return true; return true;
@ -811,7 +811,7 @@ namespace BizHawk.Client.EmuHawk
Update(); Update();
CurrentTasMovie.Save(); CurrentTasMovie.Save();
Settings.RecentTas.Add(CurrentTasMovie.Filename); Settings.RecentTas.Add(CurrentTasMovie.Filename);
SetTextProperty(); UpdateWindowTitle();
MessageStatusLabel.Text = "File saved."; MessageStatusLabel.Text = "File saved.";
Cursor = Cursors.Default; Cursor = Cursors.Default;
} }
@ -826,23 +826,14 @@ namespace BizHawk.Client.EmuHawk
GlobalWin.Sound.StartSound(); GlobalWin.Sound.StartSound();
} }
private void SetTextProperty() protected override string WindowTitle
{ => CurrentTasMovie == null
var text = "TAStudio"; ? "TAStudio"
if (CurrentTasMovie != null) : CurrentTasMovie.Changes
{ ? $"TAStudio - {CurrentTasMovie.Name}*"
text += $" - {CurrentTasMovie.Name}{(CurrentTasMovie.Changes ? "*" : "")}"; : $"TAStudio - {CurrentTasMovie.Name}";
}
if (InvokeRequired) protected override string WindowTitleStatic => "TAStudio";
{
this.Invoke(() => Text = text);
}
else
{
Text = text;
}
}
public IEnumerable<int> GetSelection() => TasView.SelectedRows; public IEnumerable<int> GetSelection() => TasView.SelectedRows;
@ -1133,7 +1124,7 @@ namespace BizHawk.Client.EmuHawk
/// </summary> /// </summary>
private void TasMovie_OnPropertyChanged(object sender, PropertyChangedEventArgs e) private void TasMovie_OnPropertyChanged(object sender, PropertyChangedEventArgs e)
{ {
SetTextProperty(); UpdateWindowTitle();
} }
private void TAStudio_DragDrop(object sender, DragEventArgs e) private void TAStudio_DragDrop(object sender, DragEventArgs e)

View File

@ -1638,7 +1638,6 @@ namespace BizHawk.Client.EmuHawk
this.Name = "TI83KeyPad"; this.Name = "TI83KeyPad";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide; this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "TI-83 Virtual KeyPad";
this.Load += new System.EventHandler(this.TI83KeyPad_Load); this.Load += new System.EventHandler(this.TI83KeyPad_Load);
this.menuStrip1.ResumeLayout(false); this.menuStrip1.ResumeLayout(false);
this.menuStrip1.PerformLayout(); this.menuStrip1.PerformLayout();

View File

@ -12,6 +12,8 @@ namespace BizHawk.Client.EmuHawk
// ReSharper disable once UnusedAutoPropertyAccessor.Local // ReSharper disable once UnusedAutoPropertyAccessor.Local
public TI83 Emu { get; private set; } public TI83 Emu { get; private set; }
protected override string WindowTitleStatic => "TI-83 Virtual KeyPad";
public TI83KeyPad() public TI83KeyPad()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -16,6 +16,8 @@ namespace BizHawk.Client.EmuHawk
[RequiredService] [RequiredService]
private IEmulator Emulator { get; set; } private IEmulator Emulator { get; set; }
protected override string WindowTitleStatic => string.Empty;
public ToolBox() public ToolBox()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -9,10 +9,16 @@ using BizHawk.Emulation.Common;
namespace BizHawk.Client.EmuHawk namespace BizHawk.Client.EmuHawk
{ {
public class ToolFormBase : Form public abstract class ToolFormBase : FormBase
{ {
public ToolManager Tools { get; set; } 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 InputManager InputManager { get; set; }
public IMainFormForTools MainForm { get; set; } public IMainFormForTools MainForm { get; set; }

View File

@ -280,7 +280,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(400, 230); this.MinimumSize = new System.Drawing.Size(400, 230);
this.Name = "TraceLogger"; this.Name = "TraceLogger";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Trace Logger";
this.Load += new System.EventHandler(this.TraceLogger_Load); this.Load += new System.EventHandler(this.TraceLogger_Load);
this.TracerBox.ResumeLayout(false); this.TracerBox.ResumeLayout(false);
this.TraceContextMenu.ResumeLayout(false); this.TraceContextMenu.ResumeLayout(false);

View File

@ -59,6 +59,9 @@ namespace BizHawk.Client.EmuHawk
private const string DisasmColumnName = "Disasm"; private const string DisasmColumnName = "Disasm";
private const string RegistersColumnName = "Registers"; private const string RegistersColumnName = "Registers";
protected override string WindowTitleStatic => "Trace Logger";
public TraceLogger() public TraceLogger()
{ {
InitializeComponent(); InitializeComponent();

View File

@ -146,7 +146,6 @@ namespace BizHawk.Client.EmuHawk
this.Controls.Add(this.ControllerBox); this.Controls.Add(this.ControllerBox);
this.Controls.Add(this.PadMenu); this.Controls.Add(this.PadMenu);
this.Name = "VirtualpadTool"; this.Name = "VirtualpadTool";
this.Text = "Virtual Pads";
this.Load += new System.EventHandler(this.VirtualpadTool_Load); this.Load += new System.EventHandler(this.VirtualpadTool_Load);
this.ControllerBox.ResumeLayout(false); this.ControllerBox.ResumeLayout(false);
this.PadBoxContextMenu.ResumeLayout(false); this.PadBoxContextMenu.ResumeLayout(false);

View File

@ -38,6 +38,8 @@ namespace BizHawk.Client.EmuHawk
} }
} }
protected override string WindowTitleStatic => "Virtual Pads";
public VirtualpadTool() public VirtualpadTool()
{ {
StickyPads = true; StickyPads = true;

View File

@ -1041,7 +1041,6 @@ namespace BizHawk.Client.EmuHawk
this.MinimumSize = new System.Drawing.Size(290, 399); this.MinimumSize = new System.Drawing.Size(290, 399);
this.Name = "RamSearch"; this.Name = "RamSearch";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "RAM Search";
this.Activated += new System.EventHandler(this.NewRamSearch_Activated); this.Activated += new System.EventHandler(this.NewRamSearch_Activated);
this.Load += new System.EventHandler(this.RamSearch_Load); this.Load += new System.EventHandler(this.RamSearch_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamSearch_DragDrop); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.NewRamSearch_DragDrop);

View File

@ -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! 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() public RamSearch()
{ {
SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true);

View File

@ -643,7 +643,6 @@ namespace BizHawk.Client.EmuHawk
this.Controls.Add(this.WatchListView); this.Controls.Add(this.WatchListView);
this.Name = "RamWatch"; this.Name = "RamWatch";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = " RAM Watch";
this.Load += new System.EventHandler(this.RamWatch_Load); this.Load += new System.EventHandler(this.RamWatch_Load);
this.DragDrop += new System.Windows.Forms.DragEventHandler(this.RamWatch_DragDrop); this.DragDrop += new System.Windows.Forms.DragEventHandler(this.RamWatch_DragDrop);
this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper); this.DragEnter += new System.Windows.Forms.DragEventHandler(this.DragEnterWrapper);

View File

@ -31,6 +31,8 @@ namespace BizHawk.Client.EmuHawk
[OptionalService] [OptionalService]
private IDebuggable Debuggable { get; set; } private IDebuggable Debuggable { get; set; }
protected override string WindowTitleStatic => "RAM Watch";
public RamWatch() public RamWatch()
{ {
InitializeComponent(); InitializeComponent();