diff --git a/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs b/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs index db13cdff4e..464abb28c3 100644 --- a/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs +++ b/BizHawk.Client.EmuHawk/tools/Cheats/Cheats.cs @@ -334,11 +334,6 @@ namespace BizHawk.Client.EmuHawk } } - private void RefreshFloatingWindowControl() - { - Owner = Settings.FloatingWindow ? null : GlobalWin.MainForm; - } - #region Events #region File @@ -572,7 +567,7 @@ namespace BizHawk.Client.EmuHawk private void FloatingWindowMenuItem_Click(object sender, EventArgs e) { Settings.FloatingWindow ^= true; - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); } private void RestoreDefaultsMenuItem_Click(object sender, EventArgs e) @@ -592,7 +587,7 @@ namespace BizHawk.Client.EmuHawk Global.Config.LoadCheatFileByGame = true; Global.Config.CheatsAutoSaveOnClose = true; - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); LoadColumnInfo(CheatListView, Settings.Columns); } @@ -686,7 +681,7 @@ namespace BizHawk.Client.EmuHawk protected override void OnShown(EventArgs e) { - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); base.OnShown(e); } diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs b/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs index 3d173c1ebd..d3bbd8e0dd 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESMusicRipper.cs @@ -42,18 +42,8 @@ namespace BizHawk.Client.EmuHawk // Do nothing } - private void RefreshFloatingWindowControl() - { - } - bool IsRunning; - protected override void OnShown(EventArgs e) - { - RefreshFloatingWindowControl(); - base.OnShown(e); - } - //http://www.phy.mtu.edu/~suits/notefreqs.html //begins at C0. ends at B8 static readonly float[] freqtbl = new[] {0, diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs b/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs index 083eb8c799..7e2ca61859 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESNameTableViewer.cs @@ -191,10 +191,6 @@ namespace BizHawk.Client.EmuHawk NameTableView.Refresh(); } - private void RefreshFloatingWindowControl() - { - } - #region Events #region Menu and Context Menu @@ -238,12 +234,6 @@ namespace BizHawk.Client.EmuHawk } } - protected override void OnShown(EventArgs e) - { - RefreshFloatingWindowControl(); - base.OnShown(e); - } - private void NESNameTableViewer_FormClosed(object sender, FormClosedEventArgs e) { if (_ppu != null) diff --git a/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs b/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs index 22412f45f6..af29c61754 100644 --- a/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs +++ b/BizHawk.Client.EmuHawk/tools/NES/NESPPU.cs @@ -322,10 +322,6 @@ namespace BizHawk.Client.EmuHawk } } - private void RefreshFloatingWindowControl() - { - } - #region Events #region Menu and Context Menu @@ -549,12 +545,6 @@ namespace BizHawk.Client.EmuHawk toolStripStatusLabel1.Text = "Use CTRL+C to copy the pane under the mouse to the clipboard."; } - protected override void OnShown(EventArgs e) - { - RefreshFloatingWindowControl(); - base.OnShown(e); - } - private void PaletteView_MouseClick(object sender, MouseEventArgs e) { HandleDefaultImage(); diff --git a/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs b/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs index e7c6be087d..61d6fde6bf 100644 --- a/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/PCE/PCEBGViewer.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Drawing; using System.Drawing.Imaging; using System.Windows.Forms; -using BizHawk.Client.Common; using BizHawk.Emulation.Cores.PCEngine; using BizHawk.Emulation.Common; @@ -39,10 +38,6 @@ namespace BizHawk.Client.EmuHawk { } - private void RefreshFloatingWindowControl() - { - } - #region Public API public bool AskSaveChanges() { return true; } @@ -140,8 +135,6 @@ namespace BizHawk.Client.EmuHawk #endregion - #region Dialog and Controls - private void Canvas_MouseMove(object sender, MouseEventArgs e) { var vdc = _vdcType == 0 ? _pce.VDC1 : _pce.VDC2; @@ -154,14 +147,6 @@ namespace BizHawk.Client.EmuHawk PaletteLabel.Text = paletteNo.ToString(); } - protected override void OnShown(EventArgs e) - { - RefreshFloatingWindowControl(); - base.OnShown(e); - } - - #endregion - #endregion } } diff --git a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs index 50751b1a46..b2946fbefc 100644 --- a/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs +++ b/BizHawk.Client.EmuHawk/tools/PCE/PCETileViewer.cs @@ -1,13 +1,9 @@ using System; using System.Collections.Generic; -using System.ComponentModel; -using System.Data; using System.Drawing; using System.Linq; -using System.Text; using System.Windows.Forms; -using BizHawk.Client.Common; using BizHawk.Emulation.Cores.PCEngine; using System.Drawing.Imaging; using BizHawk.Emulation.Common; @@ -237,15 +233,5 @@ namespace BizHawk.Client.EmuHawk { vce = emu.VCE; } - - private void RefreshFloatingWindowControl() - { - } - - protected override void OnShown(EventArgs e) - { - RefreshFloatingWindowControl(); - base.OnShown(e); - } } } diff --git a/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs b/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs index 7b6062edb0..a75d6e68b8 100644 --- a/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs +++ b/BizHawk.Client.EmuHawk/tools/TI83/TI83KeyPad.cs @@ -7,7 +7,7 @@ using BizHawk.Emulation.Common; namespace BizHawk.Client.EmuHawk { - public partial class TI83KeyPad : Form, IToolForm + public partial class TI83KeyPad : ToolFormBase, IToolForm { [RequiredService] public TI83 Emu { get; private set; } @@ -119,11 +119,6 @@ namespace BizHawk.Client.EmuHawk KeyPadToolTips.RemoveAll(); } - private void RefreshFloatingWindowControl() - { - Owner = Global.Config.TI83KeypadSettings.FloatingWindow ? null : GlobalWin.MainForm; - } - #region Events #region Menu @@ -169,7 +164,7 @@ namespace BizHawk.Client.EmuHawk private void FloatingWindowMenuItem_Click(object sender, EventArgs e) { Global.Config.TI83KeypadSettings.FloatingWindow ^= true; - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Global.Config.TI83KeypadSettings.FloatingWindow); } #endregion @@ -428,7 +423,7 @@ namespace BizHawk.Client.EmuHawk protected override void OnShown(EventArgs e) { - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Global.Config.TI83KeypadSettings.FloatingWindow); base.OnShown(e); } diff --git a/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs b/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs index c6506def92..c382329865 100644 --- a/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs +++ b/BizHawk.Client.EmuHawk/tools/ToolHelpers.cs @@ -126,5 +126,10 @@ namespace BizHawk.Client.EmuHawk columns[column.Name].Width = column.Width; } } + + protected void RefreshFloatingWindowControl(bool floatingWindow) + { + Owner = floatingWindow ? null : GlobalWin.MainForm; + } } } diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs index 05aeb60546..bcd02a34d2 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamSearch.cs @@ -419,11 +419,6 @@ namespace BizHawk.Client.EmuHawk #region Private - private void RefreshFloatingWindowControl() - { - Owner = Settings.FloatingWindow ? null : GlobalWin.MainForm; - } - private void ToggleSearchDependentToolBarItems() { DoSearchToolButton.Enabled = @@ -1384,7 +1379,7 @@ namespace BizHawk.Client.EmuHawk private void FloatingWindowMenuItem_Click(object sender, EventArgs e) { Settings.FloatingWindow ^= true; - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); } private void RestoreDefaultsMenuItem_Click(object sender, EventArgs e) @@ -1412,7 +1407,7 @@ namespace BizHawk.Client.EmuHawk SetToFastMode(); } - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); LoadColumnInfo(WatchListView, Settings.Columns); } @@ -1793,7 +1788,7 @@ namespace BizHawk.Client.EmuHawk protected override void OnShown(EventArgs e) { - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); base.OnShown(e); } diff --git a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs index 2662f9519c..72f2e734ec 100644 --- a/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs +++ b/BizHawk.Client.EmuHawk/tools/Watch/RamWatch.cs @@ -950,7 +950,7 @@ namespace BizHawk.Client.EmuHawk private void FloatingWindowMenuItem_Click(object sender, EventArgs e) { Settings.FloatingWindow ^= true; - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); } private void RestoreDefaultsMenuItem_Click(object sender, EventArgs e) @@ -968,7 +968,7 @@ namespace BizHawk.Client.EmuHawk Global.Config.DisplayRamWatch = false; - RefreshFloatingWindowControl(); + RefreshFloatingWindowControl(Settings.FloatingWindow); LoadColumnInfo(WatchListView, Settings.Columns); } @@ -1159,12 +1159,6 @@ namespace BizHawk.Client.EmuHawk OrderColumn(e.Column); } - protected override void OnShown(EventArgs e) - { - RefreshFloatingWindowControl(); - base.OnShown(e); - } - private void ErrorIconButton_Click(object sender, EventArgs e) { var items = _watches