Rethink GroupBoxEx.Tracker access to allow Designer deserialisation

This commit is contained in:
YoshiRulz 2020-04-10 09:48:05 +10:00
parent 46c58c2172
commit 5c56d9580c
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
6 changed files with 34 additions and 44 deletions

View File

@ -39,12 +39,12 @@
this.lblUserPrescale = new BizHawk.WinForms.Controls.LabelEx();
this.nudUserPrescale = new BizHawk.WinForms.Controls.SzNUDEx();
this.lblUserPrescaleUnits = new BizHawk.WinForms.Controls.LabelEx();
this.grpFilter = new BizHawk.WinForms.Controls.SzGroupBoxEx(out var trackerGrpFilter);
this.grpFilter = new BizHawk.WinForms.Controls.SzGroupBoxEx();
this.tlpGrpFilter = new System.Windows.Forms.TableLayoutPanel();
this.rbFilterNone = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpFilter);
this.rbFilterUser = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpFilter);
this.rbFilterHq2x = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpFilter);
this.rbFilterScanline = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpFilter);
this.rbFilterNone = new BizHawk.WinForms.Controls.RadioButtonEx(grpFilter.Tracker);
this.rbFilterUser = new BizHawk.WinForms.Controls.RadioButtonEx(grpFilter.Tracker);
this.rbFilterHq2x = new BizHawk.WinForms.Controls.RadioButtonEx(grpFilter.Tracker);
this.rbFilterScanline = new BizHawk.WinForms.Controls.RadioButtonEx(grpFilter.Tracker);
this.flpFilterUser = new BizHawk.WinForms.Controls.SingleColumnFLP();
this.btnFilterUser = new BizHawk.WinForms.Controls.SzButtonEx();
this.lblFilterUser = new BizHawk.WinForms.Controls.LabelEx();
@ -52,24 +52,24 @@
this.lblFilterScanlineAlpha = new BizHawk.WinForms.Controls.LabelEx();
this.tbFilterScanlineAlpha = new BizHawk.Client.EmuHawk.TransparentTrackBar();
this.cbAutoPrescale = new BizHawk.WinForms.Controls.CheckBoxEx();
this.grpFinalFilter = new BizHawk.WinForms.Controls.SzGroupBoxEx(out var trackerGrpFinalFilter);
this.grpFinalFilter = new BizHawk.WinForms.Controls.SzGroupBoxEx();
this.flpGrpFinalFilter = new BizHawk.WinForms.Controls.LocSingleColumnFLP();
this.rbFinalFilterNone = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpFinalFilter);
this.rbFinalFilterBilinear = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpFinalFilter);
this.rbFinalFilterBicubic = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpFinalFilter);
this.rbFinalFilterNone = new BizHawk.WinForms.Controls.RadioButtonEx(grpFinalFilter.Tracker);
this.rbFinalFilterBilinear = new BizHawk.WinForms.Controls.RadioButtonEx(grpFinalFilter.Tracker);
this.rbFinalFilterBicubic = new BizHawk.WinForms.Controls.RadioButtonEx(grpFinalFilter.Tracker);
this.cbLetterbox = new BizHawk.WinForms.Controls.CheckBoxEx();
this.grpAspectRatio = new BizHawk.WinForms.Controls.SzGroupBoxEx(out var trackerGrpAspectRatio);
this.grpAspectRatio = new BizHawk.WinForms.Controls.SzGroupBoxEx();
this.flpGrpAspectRatio = new BizHawk.WinForms.Controls.LocSingleColumnFLP();
this.rbARSquare = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpAspectRatio);
this.rbARSquare = new BizHawk.WinForms.Controls.RadioButtonEx(grpAspectRatio.Tracker);
this.lblAspectRatioNonSquare = new BizHawk.WinForms.Controls.LabelEx();
this.rbARBySystem = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpAspectRatio);
this.rbARBySystem = new BizHawk.WinForms.Controls.RadioButtonEx(grpAspectRatio.Tracker);
this.flpCustomSize = new BizHawk.WinForms.Controls.SingleRowFLP();
this.rbARCustomSize = new BizHawk.WinForms.Controls.SzRadioButtonEx(trackerGrpAspectRatio);
this.rbARCustomSize = new BizHawk.WinForms.Controls.SzRadioButtonEx(grpAspectRatio.Tracker);
this.txtARCustomWidth = new BizHawk.WinForms.Controls.SzTextBoxEx();
this.lblARCustomSizeSeparator = new BizHawk.WinForms.Controls.SzLabelEx();
this.txtARCustomHeight = new BizHawk.WinForms.Controls.SzTextBoxEx();
this.flpCustomAR = new BizHawk.WinForms.Controls.SingleRowFLP();
this.rbARCustomRatio = new BizHawk.WinForms.Controls.SzRadioButtonEx(trackerGrpAspectRatio);
this.rbARCustomRatio = new BizHawk.WinForms.Controls.SzRadioButtonEx(grpAspectRatio.Tracker);
this.txtARCustomRatioH = new BizHawk.WinForms.Controls.SzTextBoxEx();
this.lblARCustomRatioSeparator = new BizHawk.WinForms.Controls.SzLabelEx();
this.txtARCustomRatioV = new BizHawk.WinForms.Controls.SzTextBoxEx();
@ -87,25 +87,25 @@
this.btnDefaults = new BizHawk.WinForms.Controls.LocSzButtonEx();
this.tpDispMethod = new BizHawk.WinForms.Controls.TabPageEx();
this.flpTpDispMethod = new BizHawk.WinForms.Controls.SingleColumnFLP();
this.grpDispMethod = new BizHawk.WinForms.Controls.SzGroupBoxEx(out var trackerGrpDispMethod);
this.grpDispMethod = new BizHawk.WinForms.Controls.SzGroupBoxEx();
this.flpGrpDispMethod = new BizHawk.WinForms.Controls.LocSingleColumnFLP();
this.flpD3DSection = new BizHawk.WinForms.Controls.SingleColumnFLP();
this.rbDispMethodD3D = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpDispMethod);
this.rbDispMethodD3D = new BizHawk.WinForms.Controls.RadioButtonEx(grpDispMethod.Tracker);
this.lblDispMethodD3D = new BizHawk.WinForms.Controls.LocLabelEx();
this.flpD3DAltVSync = new BizHawk.WinForms.Controls.SingleRowFLP();
this.cbD3DAltVSync = new BizHawk.WinForms.Controls.CheckBoxEx();
this.lblD3DAltVSync = new BizHawk.WinForms.Controls.SzLabelEx();
this.rbDispMethodOpenGL = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpDispMethod);
this.rbDispMethodOpenGL = new BizHawk.WinForms.Controls.RadioButtonEx(grpDispMethod.Tracker);
this.lblDispMethodOpenGL = new BizHawk.WinForms.Controls.LocLabelEx();
this.rbDispMethodGDIPlus = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpDispMethod);
this.rbDispMethodGDIPlus = new BizHawk.WinForms.Controls.RadioButtonEx(grpDispMethod.Tracker);
this.lblDispMethodGDIPlus = new BizHawk.WinForms.Controls.LocLabelEx();
this.lblDispMethodRestartWarning = new BizHawk.WinForms.Controls.LocLabelEx();
this.tpMisc = new BizHawk.WinForms.Controls.TabPageEx();
this.grpDispFeatures = new BizHawk.WinForms.Controls.LocSzGroupBoxEx(out var trackerGrpDispFeatures);
this.grpDispFeatures = new BizHawk.WinForms.Controls.LocSzGroupBoxEx();
this.flpGrpDispFeatures = new BizHawk.WinForms.Controls.LocSingleColumnFLP();
this.rbDispFeaturesFull = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpDispFeatures);
this.rbDispFeaturesMinimal = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpDispFeatures);
this.rbDispFeaturesNothing = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpDispFeatures);
this.rbDispFeaturesFull = new BizHawk.WinForms.Controls.RadioButtonEx(grpDispFeatures.Tracker);
this.rbDispFeaturesMinimal = new BizHawk.WinForms.Controls.RadioButtonEx(grpDispFeatures.Tracker);
this.rbDispFeaturesNothing = new BizHawk.WinForms.Controls.RadioButtonEx(grpDispFeatures.Tracker);
this.tpWindow = new BizHawk.WinForms.Controls.TabPageEx();
this.flpTpWindow = new BizHawk.WinForms.Controls.SingleColumnFLP();
this.flpWindowFSGroups = new BizHawk.WinForms.Controls.SingleRowFLP();

View File

@ -60,15 +60,15 @@
this.cbBackupSaveRAM = new BizHawk.WinForms.Controls.CheckBoxEx();
this.flpAutoSaveRAM = new BizHawk.WinForms.Controls.SingleRowFLP();
this.cbAutoSaveRAM = new BizHawk.WinForms.Controls.CheckBoxEx();
this.grpAutoSaveRAM = new BizHawk.WinForms.Controls.SzGroupBoxEx(out var trackerGrpAutoSaveRAM);
this.grpAutoSaveRAM = new BizHawk.WinForms.Controls.SzGroupBoxEx();
this.flpGrpAutoSaveRAM = new BizHawk.WinForms.Controls.LocSingleColumnFLP();
this.lblAutoSaveRAM = new BizHawk.WinForms.Controls.LabelEx();
this.flpAutoSaveRAMFreq = new BizHawk.WinForms.Controls.SingleRowFLP();
this.lblAutoSaveRAMFreqDesc = new BizHawk.WinForms.Controls.LabelEx();
this.cbAutoSaveRAMFreq5s = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpAutoSaveRAM);
this.AutoSaveRAMFreq5min = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpAutoSaveRAM);
this.cbAutoSaveRAMFreq5s = new BizHawk.WinForms.Controls.RadioButtonEx(grpAutoSaveRAM.Tracker);
this.AutoSaveRAMFreq5min = new BizHawk.WinForms.Controls.RadioButtonEx(grpAutoSaveRAM.Tracker);
this.flpAutoSaveRAMFreqCustom = new BizHawk.WinForms.Controls.SingleRowFLP();
this.rbAutoSaveRAMFreqCustom = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpAutoSaveRAM);
this.rbAutoSaveRAMFreqCustom = new BizHawk.WinForms.Controls.RadioButtonEx(grpAutoSaveRAM.Tracker);
this.nudAutoSaveRAMFreqCustom = new BizHawk.WinForms.Controls.SzNUDEx();
this.lblAutoSaveRAMFreqCustomUnits = new BizHawk.WinForms.Controls.LabelEx();
this.flpFrameAdvPastLag = new BizHawk.WinForms.Controls.SingleColumnFLP();
@ -82,10 +82,10 @@
this.flpMoviesInAWE = new BizHawk.WinForms.Controls.SingleColumnFLP();
this.cbMoviesInAWE = new BizHawk.WinForms.Controls.CheckBoxEx();
this.lblMoviesInAWE = new BizHawk.WinForms.Controls.LocLabelEx();
this.grpLuaEngine = new BizHawk.WinForms.Controls.SzGroupBoxEx(out var trackerGrpLuaEngine);
this.grpLuaEngine = new BizHawk.WinForms.Controls.SzGroupBoxEx();
this.flpGrpLuaEngine = new BizHawk.WinForms.Controls.LocSingleColumnFLP();
this.rbKopiLua = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpLuaEngine);
this.rbLuaInterface = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpLuaEngine);
this.rbKopiLua = new BizHawk.WinForms.Controls.RadioButtonEx(grpLuaEngine.Tracker);
this.rbLuaInterface = new BizHawk.WinForms.Controls.RadioButtonEx(grpLuaEngine.Tracker);
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.flpDialogButtons = new BizHawk.WinForms.Controls.LocSzSingleRowFLP();
this.tcDialog.SuspendLayout();

View File

@ -36,11 +36,11 @@
this.cbMasterEnable = new BizHawk.WinForms.Controls.CheckBoxEx();
this.lblMasterEnable = new BizHawk.WinForms.Controls.LocSzLabelEx();
this.cbMuteFrameAdvance = new BizHawk.WinForms.Controls.CheckBoxEx();
this.grpSoundMethod = new BizHawk.WinForms.Controls.SzGroupBoxEx(out var trackerGrpSoundMethod);
this.grpSoundMethod = new BizHawk.WinForms.Controls.SzGroupBoxEx();
this.flpGrpSoundMethod = new BizHawk.WinForms.Controls.LocSingleColumnFLP();
this.rbSoundMethodDirectSound = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpSoundMethod);
this.rbSoundMethodXAudio2 = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpSoundMethod);
this.rbSoundMethodOpenAL = new BizHawk.WinForms.Controls.RadioButtonEx(trackerGrpSoundMethod);
this.rbSoundMethodDirectSound = new BizHawk.WinForms.Controls.RadioButtonEx(grpSoundMethod.Tracker);
this.rbSoundMethodXAudio2 = new BizHawk.WinForms.Controls.RadioButtonEx(grpSoundMethod.Tracker);
this.rbSoundMethodOpenAL = new BizHawk.WinForms.Controls.RadioButtonEx(grpSoundMethod.Tracker);
this.grpVolume.SuspendLayout();
this.flpGrpVolume.SuspendLayout();
this.flpFullSpeed.SuspendLayout();

View File

@ -5,7 +5,7 @@ namespace BizHawk.WinForms.Controls
{
public abstract class GroupBoxExBase : GroupBox
{
public readonly RadioButtonGroupTracker Tracker;
public readonly RadioButtonGroupTracker Tracker = new RadioButtonGroupTracker();
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
@ -14,7 +14,5 @@ namespace BizHawk.WinForms.Controls
[Browsable(false)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new bool TabStop => base.TabStop;
protected GroupBoxExBase(out IRadioButtonReadOnlyTracker tracker) => tracker = Tracker = new RadioButtonGroupTracker();
}
}

View File

@ -7,9 +7,5 @@ namespace BizHawk.WinForms.Controls
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new bool AutoSize => base.AutoSize;
public LocSzGroupBoxEx() : base(out _) {}
public LocSzGroupBoxEx(out IRadioButtonReadOnlyTracker tracker) : base(out tracker) {}
}
}

View File

@ -11,9 +11,5 @@ namespace BizHawk.WinForms.Controls
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Point Location => base.Location;
public SzGroupBoxEx() : base(out _) {}
public SzGroupBoxEx(out IRadioButtonReadOnlyTracker tracker) : base(out tracker) {}
}
}