diff --git a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj index df3e24affc..9bf5098ca9 100644 --- a/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj +++ b/BizHawk.Client.EmuHawk/BizHawk.Client.EmuHawk.csproj @@ -162,6 +162,9 @@ + @@ -418,11 +421,9 @@ - - @@ -434,9 +435,6 @@ - - - diff --git a/BizHawk.Client.EmuHawk/CustomControls/AutosizedLabel.cs b/BizHawk.Client.EmuHawk/CustomControls/AutosizedLabel.cs deleted file mode 100644 index d889a35095..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/AutosizedLabel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.ComponentModel; -using System.Windows.Forms; - -namespace BizHawk.Client.EmuHawk.CustomControls -{ - public class AutosizedLabel : Label - { - - [Browsable(false)] - [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] - public override bool AutoSize => true; - - public AutosizedLabel() : base() { - Anchor = AnchorStyles.None; - } - - public AutosizedLabel(string labelText) : this() - { - Text = labelText; - } - } -} diff --git a/BizHawk.Client.EmuHawk/CustomControls/FLPInGroupBox.cs b/BizHawk.Client.EmuHawk/CustomControls/FLPInGroupBox.cs deleted file mode 100644 index 47939fe5a7..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/FLPInGroupBox.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.Windows.Forms; - -namespace BizHawk.Client.EmuHawk.CustomControls -{ - /// - public class FLPInGroupBox : GroupBox - { - public new ControlCollection Controls => InnerFLP.Controls; - - public FlowLayoutPanel InnerFLP { get; } = new FlowLayoutPanel - { - Dock = DockStyle.Fill, - FlowDirection = FlowDirection.TopDown, - WrapContents = false - }; - - public FLPInGroupBox() : base() => base.Controls.Add(InnerFLP); - } -} diff --git a/BizHawk.Client.EmuHawk/CustomControls/SingleColumnFLP.cs b/BizHawk.Client.EmuHawk/CustomControls/SingleColumnFLP.cs deleted file mode 100644 index a921d04604..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/SingleColumnFLP.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.Windows.Forms; - -namespace BizHawk.Client.EmuHawk.CustomControls -{ - /// - public class SingleColumnFLP : FlowLayoutPanel - { - public SingleColumnFLP() : base() - { - AutoSize = true; - FlowDirection = FlowDirection.TopDown; - WrapContents = false; - } - } -} diff --git a/BizHawk.Client.EmuHawk/CustomControls/SingleRowFLP.cs b/BizHawk.Client.EmuHawk/CustomControls/SingleRowFLP.cs deleted file mode 100644 index ba74c0dffc..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/SingleRowFLP.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Windows.Forms; - -namespace BizHawk.Client.EmuHawk.CustomControls -{ - /// - public class SingleRowFLP : FlowLayoutPanel - { - public SingleRowFLP() : base() - { - AutoSize = true; - WrapContents = false; - } - } -} diff --git a/BizHawk.Client.EmuHawk/CustomControls/TLPInGroupBox.cs b/BizHawk.Client.EmuHawk/CustomControls/TLPInGroupBox.cs deleted file mode 100644 index d24f91ea61..0000000000 --- a/BizHawk.Client.EmuHawk/CustomControls/TLPInGroupBox.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System.Windows.Forms; - -namespace BizHawk.Client.EmuHawk.CustomControls -{ - /// - public class TLPInGroupBox : GroupBox - { - public new TableLayoutControlCollection Controls => InnerTLP.Controls; - - public TableLayoutPanel InnerTLP { get; } = new TableLayoutPanel { - AutoSize = true, - Dock = DockStyle.Fill - }; - - public TLPInGroupBox() : base() => base.Controls.Add(InnerTLP); - - public TLPInGroupBox(int columns, int rows) : this() - { - InnerTLP.ColumnCount = columns; - for (var i = columns; i != 0; i--) InnerTLP.ColumnStyles.Add(new ColumnStyle()); - InnerTLP.RowCount = rows; - for (var i = rows; i != 0; i--) InnerTLP.RowStyles.Add(new RowStyle()); - } - } -} diff --git a/BizHawk.Client.EmuHawk/config/AutofireConfig.Designer.cs b/BizHawk.Client.EmuHawk/config/AutofireConfig.Designer.cs index e8dbb28015..58922e3123 100644 --- a/BizHawk.Client.EmuHawk/config/AutofireConfig.Designer.cs +++ b/BizHawk.Client.EmuHawk/config/AutofireConfig.Designer.cs @@ -14,12 +14,12 @@ this.Cancel = new System.Windows.Forms.Button(); this.OnNumeric = new System.Windows.Forms.NumericUpDown(); this.OffNumeric = new System.Windows.Forms.NumericUpDown(); - this.label1 = new BizHawk.Client.EmuHawk.CustomControls.AutosizedLabel(); - this.label2 = new BizHawk.Client.EmuHawk.CustomControls.AutosizedLabel(); - this.flpButtons = new BizHawk.Client.EmuHawk.CustomControls.SingleRowFLP(); - this.flpMain = new BizHawk.Client.EmuHawk.CustomControls.SingleColumnFLP(); - this.flpPattern = new BizHawk.Client.EmuHawk.CustomControls.SingleRowFLP(); - this.lblPattern = new BizHawk.Client.EmuHawk.CustomControls.AutosizedLabel(); + this.label1 = new BizHawk.WinForms.Controls.LabelEx(); + this.label2 = new BizHawk.WinForms.Controls.LabelEx(); + this.flpButtons = new BizHawk.WinForms.Controls.LocSzSingleRowFLP(); + this.flpMain = new BizHawk.WinForms.Controls.LocSzSingleColumnFLP(); + this.flpPattern = new BizHawk.WinForms.Controls.SingleRowFLP(); + this.lblPattern = new BizHawk.WinForms.Controls.LabelEx(); this.LagFrameCheck = new System.Windows.Forms.CheckBox(); ((System.ComponentModel.ISupportInitialize)(this.OnNumeric)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.OffNumeric)).BeginInit(); @@ -102,16 +102,15 @@ this.flpButtons.Controls.Add(this.Cancel); this.flpButtons.Location = new System.Drawing.Point(161, 61); this.flpButtons.Name = "flpButtons"; + this.flpButtons.Size = new System.Drawing.Size(162, 29); // // flpMain // this.flpMain.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.flpMain.AutoSize = false; this.flpMain.Controls.Add(this.flpPattern); this.flpMain.Controls.Add(this.LagFrameCheck); - this.flpMain.FlowDirection = System.Windows.Forms.FlowDirection.TopDown; this.flpMain.Location = new System.Drawing.Point(0, 0); this.flpMain.Name = "flpMain"; this.flpMain.Size = new System.Drawing.Size(323, 55); @@ -171,12 +170,12 @@ private System.Windows.Forms.Button Ok; private System.Windows.Forms.Button Cancel; private System.Windows.Forms.NumericUpDown OffNumeric; - private CustomControls.AutosizedLabel label1; - private CustomControls.AutosizedLabel label2; - private CustomControls.SingleRowFLP flpPattern; - private CustomControls.SingleColumnFLP flpMain; - private CustomControls.SingleRowFLP flpButtons; - private CustomControls.AutosizedLabel lblPattern; + private BizHawk.WinForms.Controls.LabelEx label1; + private BizHawk.WinForms.Controls.LabelEx label2; + private BizHawk.WinForms.Controls.SingleRowFLP flpPattern; + private BizHawk.WinForms.Controls.LocSzSingleColumnFLP flpMain; + private BizHawk.WinForms.Controls.LocSzSingleRowFLP flpButtons; + private BizHawk.WinForms.Controls.LabelEx lblPattern; public System.Windows.Forms.NumericUpDown OnNumeric; private System.Windows.Forms.CheckBox LagFrameCheck; } diff --git a/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj b/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj new file mode 100644 index 0000000000..799d1188b8 --- /dev/null +++ b/BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj @@ -0,0 +1,11 @@ + + + + + net48 + + + + + + diff --git a/BizHawk.WinForms.Controls/ButtonEx/ButtonExBase.cs b/BizHawk.WinForms.Controls/ButtonEx/ButtonExBase.cs new file mode 100644 index 0000000000..5941b2226c --- /dev/null +++ b/BizHawk.WinForms.Controls/ButtonEx/ButtonExBase.cs @@ -0,0 +1,16 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + public abstract class ButtonExBase : Button + { + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseVisualStyleBackColor => base.UseVisualStyleBackColor; + } +} diff --git a/BizHawk.WinForms.Controls/ButtonEx/LocSzButtonEx.cs b/BizHawk.WinForms.Controls/ButtonEx/LocSzButtonEx.cs new file mode 100644 index 0000000000..c7b4747f59 --- /dev/null +++ b/BizHawk.WinForms.Controls/ButtonEx/LocSzButtonEx.cs @@ -0,0 +1,11 @@ +using System.ComponentModel; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocSzButtonEx : ButtonExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + } +} diff --git a/BizHawk.WinForms.Controls/ButtonEx/SzButtonEx.cs b/BizHawk.WinForms.Controls/ButtonEx/SzButtonEx.cs new file mode 100644 index 0000000000..4af30a3261 --- /dev/null +++ b/BizHawk.WinForms.Controls/ButtonEx/SzButtonEx.cs @@ -0,0 +1,15 @@ +using System.ComponentModel; +using System.Drawing; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SzButtonEx : ButtonExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + } +} diff --git a/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxEx.cs b/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxEx.cs new file mode 100644 index 0000000000..bbed8cd080 --- /dev/null +++ b/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxEx.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using System.Drawing; + +namespace BizHawk.WinForms.Controls +{ + /// + public class CheckBoxEx : CheckBoxExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + public CheckBoxEx() => base.AutoSize = true; + } +} diff --git a/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs b/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs new file mode 100644 index 0000000000..6f76f94b8b --- /dev/null +++ b/BizHawk.WinForms.Controls/CheckBoxEx/CheckBoxExBase.cs @@ -0,0 +1,16 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + public abstract class CheckBoxExBase : CheckBox + { + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseVisualStyleBackColor => base.UseVisualStyleBackColor; + } +} diff --git a/BizHawk.WinForms.Controls/Docs.cs b/BizHawk.WinForms.Controls/Docs.cs new file mode 100644 index 0000000000..02cea60b8a --- /dev/null +++ b/BizHawk.WinForms.Controls/Docs.cs @@ -0,0 +1,86 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// Static members are dummies, referenced only in docs in order to centralise them. + internal static class Docs + { + /// Inherits . + /// Naming convention for control types + /// + /// + public const bool Button = true; + + /// Inherits /. + /// Naming convention for control types + /// + /// + public const bool CheckBoxOrRadioButton = true; + + /// Inherits . + /// Naming convention for control types + /// + /// + public const bool GroupBox = true; + + /// Inherits /. + /// Naming convention for control types + /// + /// + /// + /// + /// + public const bool LabelOrLinkLabel = true; + + /// Inherits . Only Sz* variants are available. + /// Naming convention for control types + /// + public const bool NUD = true; + + /// + /// Inherits . + /// is locked to and is locked to . + /// is locked to / for rows/columns, respectively. + /// + /// Naming convention for control types + /// + /// + public const bool RowsOrColsFLP = true; + + /// + /// Inherits . + /// is locked to and is locked to . + /// is locked to / for a single row/column, respectively. + /// + /// Naming convention for control types + /// + /// + /// + /// + /// + /// + public const bool SingleRowOrColFLP = true; + + /// Inherits . + /// Naming convention for control types + /// + public const bool TabPage = true; + + /// Inherits . Only Sz* variants are available. + /// Naming convention for control types + /// + public const bool TextBox = true; + + /// + /// This project has some naming conventions in regards to type names. + /// + /// Loc* are positionable; instances should set . The intention is for controls without Loc to be used in FLPs. + /// Sz* are resizable; instances should set . is always set for you, with or without this prefix. + /// These combine as expected. A type name without any prefix is the most restrictive, having many properties pre-set (which is a double-edged sword as they can't be changed). + /// + /// In addition, properties are hidden in the Designer (with ) when they are read-only and their value is clear from the type name. + /// + public const bool TypeNamePrefix = true; + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/MarginlessFLPBase.cs b/BizHawk.WinForms.Controls/FLPs/MarginlessFLPBase.cs new file mode 100644 index 0000000000..a7956b4df5 --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/MarginlessFLPBase.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + public abstract class MarginlessFLPBase : FlowLayoutPanel + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Padding Margin => base.Margin; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + protected MarginlessFLPBase() => base.Margin = Padding.Empty; + + protected static readonly Size TinySize = new Size(24, 24); + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/RowsOrColsFLP/SzColumnsToRightFLP.cs b/BizHawk.WinForms.Controls/FLPs/RowsOrColsFLP/SzColumnsToRightFLP.cs new file mode 100644 index 0000000000..66fdc8ebce --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/RowsOrColsFLP/SzColumnsToRightFLP.cs @@ -0,0 +1,26 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SzColumnsToRightFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + + public SzColumnsToRightFLP() => base.FlowDirection = FlowDirection.TopDown; + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/RowsOrColsFLP/SzRowsToBottomFLP.cs b/BizHawk.WinForms.Controls/FLPs/RowsOrColsFLP/SzRowsToBottomFLP.cs new file mode 100644 index 0000000000..b16fda7526 --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/RowsOrColsFLP/SzRowsToBottomFLP.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SzRowsToBottomFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSingleColumnFLP.cs b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSingleColumnFLP.cs new file mode 100644 index 0000000000..6b80e04302 --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSingleColumnFLP.cs @@ -0,0 +1,39 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocSingleColumnFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new AutoSizeMode AutoSizeMode => base.AutoSizeMode; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size MinimumSize => base.MinimumSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + + public LocSingleColumnFLP() + { + base.AutoSize = true; + base.AutoSizeMode = AutoSizeMode.GrowAndShrink; + base.FlowDirection = FlowDirection.TopDown; + base.MinimumSize = TinySize; + base.WrapContents = false; + } + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSingleRowFLP.cs b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSingleRowFLP.cs new file mode 100644 index 0000000000..96201e2c73 --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSingleRowFLP.cs @@ -0,0 +1,38 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocSingleRowFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new AutoSizeMode AutoSizeMode => base.AutoSizeMode; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size MinimumSize => base.MinimumSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + + public LocSingleRowFLP() + { + base.AutoSize = true; + base.AutoSizeMode = AutoSizeMode.GrowAndShrink; + base.MinimumSize = TinySize; + base.WrapContents = false; + } + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSzSingleColumnFLP.cs b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSzSingleColumnFLP.cs new file mode 100644 index 0000000000..ddb4aee296 --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSzSingleColumnFLP.cs @@ -0,0 +1,26 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocSzSingleColumnFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + + public LocSzSingleColumnFLP() + { + base.FlowDirection = FlowDirection.TopDown; + base.WrapContents = false; + } + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSzSingleRowFLP.cs b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSzSingleRowFLP.cs new file mode 100644 index 0000000000..5c6d8cec3c --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/LocSzSingleRowFLP.cs @@ -0,0 +1,22 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocSzSingleRowFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + + public LocSzSingleRowFLP() => base.WrapContents = false; + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/SingleColumnFLP.cs b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/SingleColumnFLP.cs new file mode 100644 index 0000000000..313c143184 --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/SingleColumnFLP.cs @@ -0,0 +1,42 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SingleColumnFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new AutoSizeMode AutoSizeMode => base.AutoSizeMode; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size MinimumSize => base.MinimumSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + + public SingleColumnFLP() + { + base.AutoSize = true; + base.AutoSizeMode = AutoSizeMode.GrowAndShrink; + base.FlowDirection = FlowDirection.TopDown; + base.MinimumSize = TinySize; + base.WrapContents = false; + } + } +} diff --git a/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/SingleRowFLP.cs b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/SingleRowFLP.cs new file mode 100644 index 0000000000..e4c163f904 --- /dev/null +++ b/BizHawk.WinForms.Controls/FLPs/SingleRowOrColFLP/SingleRowFLP.cs @@ -0,0 +1,41 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SingleRowFLP : MarginlessFLPBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new AutoSizeMode AutoSizeMode => base.AutoSizeMode; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new FlowDirection FlowDirection => base.FlowDirection; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size MinimumSize => base.MinimumSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool WrapContents => base.WrapContents; + + public SingleRowFLP() + { + base.AutoSize = true; + base.AutoSizeMode = AutoSizeMode.GrowAndShrink; + base.MinimumSize = TinySize; + base.WrapContents = false; + } + } +} diff --git a/BizHawk.WinForms.Controls/GroupBoxEx/LocSzGroupBoxEx.cs b/BizHawk.WinForms.Controls/GroupBoxEx/LocSzGroupBoxEx.cs new file mode 100644 index 0000000000..7faff32f68 --- /dev/null +++ b/BizHawk.WinForms.Controls/GroupBoxEx/LocSzGroupBoxEx.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocSzGroupBoxEx : GroupBox + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool TabStop => base.TabStop; + } +} diff --git a/BizHawk.WinForms.Controls/GroupBoxEx/SzGroupBoxEx.cs b/BizHawk.WinForms.Controls/GroupBoxEx/SzGroupBoxEx.cs new file mode 100644 index 0000000000..c7b3c06ae6 --- /dev/null +++ b/BizHawk.WinForms.Controls/GroupBoxEx/SzGroupBoxEx.cs @@ -0,0 +1,24 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SzGroupBoxEx : GroupBox + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool TabStop => base.TabStop; + } +} diff --git a/BizHawk.WinForms.Controls/LabelEx/LabelEx.cs b/BizHawk.WinForms.Controls/LabelEx/LabelEx.cs new file mode 100644 index 0000000000..ff1551ab66 --- /dev/null +++ b/BizHawk.WinForms.Controls/LabelEx/LabelEx.cs @@ -0,0 +1,28 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LabelEx : LabelExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new AnchorStyles Anchor => base.Anchor; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + public LabelEx() + { + base.Anchor = AnchorStyles.None; + base.AutoSize = true; + } + } +} diff --git a/BizHawk.WinForms.Controls/LabelEx/LabelExBase.cs b/BizHawk.WinForms.Controls/LabelEx/LabelExBase.cs new file mode 100644 index 0000000000..06ede6d069 --- /dev/null +++ b/BizHawk.WinForms.Controls/LabelEx/LabelExBase.cs @@ -0,0 +1,12 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + public abstract class LabelExBase : Label + { + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + } +} diff --git a/BizHawk.WinForms.Controls/LabelEx/LocLabelEx.cs b/BizHawk.WinForms.Controls/LabelEx/LocLabelEx.cs new file mode 100644 index 0000000000..f0ccd2a2db --- /dev/null +++ b/BizHawk.WinForms.Controls/LabelEx/LocLabelEx.cs @@ -0,0 +1,17 @@ +using System.ComponentModel; +using System.Drawing; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocLabelEx : LabelExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + public LocLabelEx() => base.AutoSize = true; + } +} diff --git a/BizHawk.WinForms.Controls/LabelEx/LocSzLabelEx.cs b/BizHawk.WinForms.Controls/LabelEx/LocSzLabelEx.cs new file mode 100644 index 0000000000..a197c537ed --- /dev/null +++ b/BizHawk.WinForms.Controls/LabelEx/LocSzLabelEx.cs @@ -0,0 +1,11 @@ +using System.ComponentModel; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocSzLabelEx : LabelExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + } +} diff --git a/BizHawk.WinForms.Controls/LabelEx/SzLabelEx.cs b/BizHawk.WinForms.Controls/LabelEx/SzLabelEx.cs new file mode 100644 index 0000000000..b847cc2e99 --- /dev/null +++ b/BizHawk.WinForms.Controls/LabelEx/SzLabelEx.cs @@ -0,0 +1,21 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SzLabelEx : LabelExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new AnchorStyles Anchor => base.Anchor; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + public SzLabelEx() => base.Anchor = AnchorStyles.None; + } +} diff --git a/BizHawk.WinForms.Controls/LinkLabelEx/LinkLabelExBase.cs b/BizHawk.WinForms.Controls/LinkLabelEx/LinkLabelExBase.cs new file mode 100644 index 0000000000..c4fdfd38bf --- /dev/null +++ b/BizHawk.WinForms.Controls/LinkLabelEx/LinkLabelExBase.cs @@ -0,0 +1,16 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + public abstract class LinkLabelExBase : LinkLabel + { + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool TabStop => base.TabStop; + } +} diff --git a/BizHawk.WinForms.Controls/LinkLabelEx/LocLinkLabelEx.cs b/BizHawk.WinForms.Controls/LinkLabelEx/LocLinkLabelEx.cs new file mode 100644 index 0000000000..7913092914 --- /dev/null +++ b/BizHawk.WinForms.Controls/LinkLabelEx/LocLinkLabelEx.cs @@ -0,0 +1,17 @@ +using System.ComponentModel; +using System.Drawing; + +namespace BizHawk.WinForms.Controls +{ + /// + public class LocLinkLabelEx : LinkLabelExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + public LocLinkLabelEx() => base.AutoSize = true; + } +} diff --git a/BizHawk.WinForms.Controls/NUDEx/SzNUDEx.cs b/BizHawk.WinForms.Controls/NUDEx/SzNUDEx.cs new file mode 100644 index 0000000000..32d6b67211 --- /dev/null +++ b/BizHawk.WinForms.Controls/NUDEx/SzNUDEx.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SzNUDEx : NumericUpDown + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + } +} diff --git a/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonEx.cs b/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonEx.cs new file mode 100644 index 0000000000..7bd303bad6 --- /dev/null +++ b/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonEx.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using System.Drawing; + +namespace BizHawk.WinForms.Controls +{ + /// + public class RadioButtonEx : RadioButtonExBase + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + public RadioButtonEx() => base.AutoSize = true; + } +} diff --git a/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonExBase.cs b/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonExBase.cs new file mode 100644 index 0000000000..a5a9f8f43a --- /dev/null +++ b/BizHawk.WinForms.Controls/RadioButtonEx/RadioButtonExBase.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + public abstract class RadioButtonExBase : RadioButton + { + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool TabStop => base.TabStop; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseVisualStyleBackColor => base.UseVisualStyleBackColor; + } +} diff --git a/BizHawk.WinForms.Controls/TabPageEx.cs b/BizHawk.WinForms.Controls/TabPageEx.cs new file mode 100644 index 0000000000..a9350f1312 --- /dev/null +++ b/BizHawk.WinForms.Controls/TabPageEx.cs @@ -0,0 +1,33 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class TabPageEx : TabPage + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Size Size => base.Size; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool UseVisualStyleBackColor => base.UseVisualStyleBackColor; + + public TabPageEx() + { + //TODO AutoSize? + base.UseVisualStyleBackColor = true; + } + } +} diff --git a/BizHawk.WinForms.Controls/TextBoxEx/SzTextBoxEx.cs b/BizHawk.WinForms.Controls/TextBoxEx/SzTextBoxEx.cs new file mode 100644 index 0000000000..4c4227dc1e --- /dev/null +++ b/BizHawk.WinForms.Controls/TextBoxEx/SzTextBoxEx.cs @@ -0,0 +1,20 @@ +using System.ComponentModel; +using System.Drawing; +using System.Windows.Forms; + +namespace BizHawk.WinForms.Controls +{ + /// + public class SzTextBoxEx : TextBox + { + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new bool AutoSize => base.AutoSize; + + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new Point Location => base.Location; + + [Browsable(false)] + [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)] + public new int TabIndex => base.TabIndex; + } +} diff --git a/BizHawk.sln b/BizHawk.sln index d23b9d6f68..842de18870 100644 --- a/BizHawk.sln +++ b/BizHawk.sln @@ -51,6 +51,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BizHawk.Client.ApiHawk", "B EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.BizInvoke", "BizHawk.BizInvoke\BizHawk.BizInvoke.csproj", "{E5D76DC1-84A8-47AF-BE25-E76F06D2FBBC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BizHawk.WinForms.Controls", "BizHawk.WinForms.Controls\BizHawk.WinForms.Controls.csproj", "{B5A2214B-3CB0-48C4-8DB1-98B38D48AC4A}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -101,6 +103,10 @@ Global {E5D76DC1-84A8-47AF-BE25-E76F06D2FBBC}.Debug|Any CPU.Build.0 = Debug|Any CPU {E5D76DC1-84A8-47AF-BE25-E76F06D2FBBC}.Release|Any CPU.ActiveCfg = Release|Any CPU {E5D76DC1-84A8-47AF-BE25-E76F06D2FBBC}.Release|Any CPU.Build.0 = Release|Any CPU + {B5A2214B-3CB0-48C4-8DB1-98B38D48AC4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B5A2214B-3CB0-48C4-8DB1-98B38D48AC4A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B5A2214B-3CB0-48C4-8DB1-98B38D48AC4A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B5A2214B-3CB0-48C4-8DB1-98B38D48AC4A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE