Create a new project for custom controls and add some more

This commit is contained in:
YoshiRulz 2020-03-02 16:39:37 +10:00 committed by James Groom
parent bbb28525f1
commit 10818ba069
38 changed files with 754 additions and 114 deletions

View File

@ -162,6 +162,9 @@
<ProjectReference Include="$(SolutionDir)BizHawk.Emulation.Cores/BizHawk.Emulation.Cores.csproj"
Name="BizHawk.Emulation.Cores"
Project="{197D4314-8A9F-49BA-977D-54ACEFAEB6BA}" />
<ProjectReference Include="$(SolutionDir)BizHawk.WinForms.Controls/BizHawk.WinForms.Controls.csproj"
Name="BizHawk.WinForms.Controls"
Project="{B5A2214B-3CB0-48C4-8DB1-98B38D48AC4A}" />
<ProjectReference Include="$(SolutionDir)Bizware/BizHawk.Bizware.BizwareGL/BizHawk.Bizware.BizwareGL.csproj"
Name="BizHawk.Bizware.BizwareGL"
Project="{9F84A0B2-861E-4EF4-B89B-5E2A3F38A465}" />
@ -418,11 +421,9 @@
<Compile Update="CoreFeatureAnalysis.cs" SubType="Form" />
<Compile Update="CoreFeatureAnalysis.Designer.cs" DependentUpon="CoreFeatureAnalysis.cs" />
<EmbeddedResource Update="CoreFeatureAnalysis.resx" DependentUpon="CoreFeatureAnalysis.cs" />
<Compile Update="CustomControls/AutosizedLabel.cs" SubType="Component" />
<Compile Update="CustomControls/ExceptionBox.cs" SubType="Form" />
<Compile Update="CustomControls/ExceptionBox.designer.cs" DependentUpon="ExceptionBox.cs" />
<EmbeddedResource Update="CustomControls/ExceptionBox.resx" DependentUpon="ExceptionBox.cs" />
<Compile Update="CustomControls/FLPInGroupBox.cs" SubType="Component" />
<Compile Update="CustomControls/FolderBrowserDialogEx.cs" SubType="Component" />
<Compile Update="CustomControls/HexTextBox.cs" SubType="Component" />
<Compile Update="CustomControls/InputRoll/InputRoll.cs" SubType="Component" />
@ -434,9 +435,6 @@
<Compile Update="CustomControls/MsgBox.designer.cs" DependentUpon="MsgBox.cs" />
<EmbeddedResource Update="CustomControls/MsgBox.resx" DependentUpon="MsgBox.cs" />
<Compile Update="CustomControls/RepeatButton.cs" SubType="Component" />
<Compile Update="CustomControls/SingleColumnFLP.cs" SubType="Component" />
<Compile Update="CustomControls/SingleRowFLP.cs" SubType="Component" />
<Compile Update="CustomControls/TLPInGroupBox.cs" SubType="Component" />
<Compile Update="CustomControls/ToolStripEx.cs" SubType="Component" />
<Compile Update="CustomControls/TransparentTrackbar.cs" SubType="Component" />
<Compile Update="CustomControls/ViewportPanel.cs" SubType="Component" />

View File

@ -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;
}
}
}

View File

@ -1,19 +0,0 @@
using System.Windows.Forms;
namespace BizHawk.Client.EmuHawk.CustomControls
{
/// <seealso cref="TLPInGroupBox"/>
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);
}
}

View File

@ -1,15 +0,0 @@
using System.Windows.Forms;
namespace BizHawk.Client.EmuHawk.CustomControls
{
/// <seealso cref="SingleRowFLP"/>
public class SingleColumnFLP : FlowLayoutPanel
{
public SingleColumnFLP() : base()
{
AutoSize = true;
FlowDirection = FlowDirection.TopDown;
WrapContents = false;
}
}
}

View File

@ -1,14 +0,0 @@
using System.Windows.Forms;
namespace BizHawk.Client.EmuHawk.CustomControls
{
/// <seealso cref="SingleColumnFLP"/>
public class SingleRowFLP : FlowLayoutPanel
{
public SingleRowFLP() : base()
{
AutoSize = true;
WrapContents = false;
}
}
}

View File

@ -1,25 +0,0 @@
using System.Windows.Forms;
namespace BizHawk.Client.EmuHawk.CustomControls
{
/// <seealso cref="FLPInGroupBox"/>
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());
}
}
}

View File

@ -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;
}

View File

@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="$(SolutionDir)MainSlnCommon.props" />
<Import Project="$(SolutionDir)CommonNullable.props" />
<PropertyGroup>
<TargetFramework>net48</TargetFramework>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.0" PrivateAssets="All" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
</Project>

View File

@ -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;
}
}

View File

@ -0,0 +1,11 @@
using System.ComponentModel;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.Button"/>
public class LocSzButtonEx : ButtonExBase
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new bool AutoSize => base.AutoSize;
}
}

View File

@ -0,0 +1,15 @@
using System.ComponentModel;
using System.Drawing;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.Button"/>
public class SzButtonEx : ButtonExBase
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new bool AutoSize => base.AutoSize;
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new Point Location => base.Location;
}
}

View File

@ -0,0 +1,20 @@
using System.ComponentModel;
using System.Drawing;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.CheckBoxOrRadioButton"/>
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;
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,86 @@
using System.ComponentModel;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <summary>Static members are dummies, referenced only in docs in order to centralise them.</summary>
internal static class Docs
{
/// <summary>Inherits <see cref="System.Windows.Forms.Button"/>.</summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="LocSzButtonEx"/>
/// <seealso cref="SzButtonEx"/>
public const bool Button = true;
/// <summary>Inherits <see cref="CheckBox"/>/<see cref="RadioButton"/>.</summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="CheckBoxEx"/>
/// <seealso cref="RadioButtonEx"/>
public const bool CheckBoxOrRadioButton = true;
/// <summary>Inherits <see cref="System.Windows.Forms.GroupBox"/>.</summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="LocSzGroupBoxEx"/>
/// <seealso cref="SzGroupBoxEx"/>
public const bool GroupBox = true;
/// <summary>Inherits <see cref="Label"/>/<see cref="LinkLabel"/>.</summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="LabelEx"/>
/// <seealso cref="LocLabelEx"/>
/// <seealso cref="LocSzLabelEx"/>
/// <seealso cref="SzLabelEx"/>
/// <seealso cref="LocLinkLabelEx"/>
public const bool LabelOrLinkLabel = true;
/// <summary>Inherits <see cref="NumericUpDown"/>. Only <c>Sz*</c> variants are available.</summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="SzNUDEx"/>
public const bool NUD = true;
/// <summary>
/// Inherits <see cref="FlowLayoutPanel"/>.
/// <see cref="FlowLayoutPanel.WrapContents"/> is locked to <see langword="true"/> and <see cref="FlowLayoutPanel.Margin"/> is locked to <see cref="Padding.Empty"/>.
/// <see cref="FlowLayoutPanel.FlowDirection"/> is locked to <see cref="FlowDirection.LeftToRight"/>/<see cref="FlowDirection.TopDown"/> for rows/columns, respectively.
/// </summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="SzColumnsToRightFLP"/>
/// <seealso cref="SzRowsToBottomFLP"/>
public const bool RowsOrColsFLP = true;
/// <summary>
/// Inherits <see cref="FlowLayoutPanel"/>.
/// <see cref="FlowLayoutPanel.WrapContents"/> is locked to <see langword="false"/> and <see cref="FlowLayoutPanel.Margin"/> is locked to <see cref="Padding.Empty"/>.
/// <see cref="FlowLayoutPanel.FlowDirection"/> is locked to <see cref="FlowDirection.LeftToRight"/>/<see cref="FlowDirection.TopDown"/> for a single row/column, respectively.
/// </summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="SingleColumnFLP"/>
/// <seealso cref="LocSingleColumnFLP"/>
/// <seealso cref="LocSzSingleColumnFLP"/>
/// <seealso cref="SingleRowFLP"/>
/// <seealso cref="LocSingleRowFLP"/>
/// <seealso cref="LocSzSingleRowFLP"/>
public const bool SingleRowOrColFLP = true;
/// <summary>Inherits <see cref="System.Windows.Forms.TabPage"/>.</summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="TabPageEx"/>
public const bool TabPage = true;
/// <summary>Inherits <see cref="System.Windows.Forms.TextBox"/>. Only <c>Sz*</c> variants are available.</summary>
/// <seealso cref="TypeNamePrefix">Naming convention for control types</seealso>
/// <seealso cref="SzTextBoxEx"/>
public const bool TextBox = true;
/// <remarks>
/// This project has some naming conventions in regards to type names.
/// <list type="bullet">
/// <item><description><c>Loc*</c> are positionable; instances should set <see cref="Control.Location"/>. The intention is for controls without <c>Loc</c> to be used in <see cref="FlowLayoutPanel">FLPs</see>.</description></item>
/// <item><description><c>Sz*</c> are resizable; instances should set <see cref="Control.Size"/>. <see cref="Control.AutoSize"/> is always set for you, with or without this prefix.</description></item>
/// <item><description>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).</description></item>
/// </list>
/// In addition, properties are hidden in the Designer (with <see cref="BrowsableAttribute"/>) when they are read-only and their value is clear from the type name.
/// </remarks>
public const bool TypeNamePrefix = true;
}
}

View File

@ -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);
}
}

View File

@ -0,0 +1,26 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.RowsOrColsFLP"/>
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;
}
}

View File

@ -0,0 +1,24 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.RowsOrColsFLP"/>
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;
}
}

View File

@ -0,0 +1,39 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.SingleRowOrColFLP"/>
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;
}
}
}

View File

@ -0,0 +1,38 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.SingleRowOrColFLP"/>
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;
}
}
}

View File

@ -0,0 +1,26 @@
using System.ComponentModel;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.SingleRowOrColFLP"/>
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;
}
}
}

View File

@ -0,0 +1,22 @@
using System.ComponentModel;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.SingleRowOrColFLP"/>
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;
}
}

View File

@ -0,0 +1,42 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.SingleRowOrColFLP"/>
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;
}
}
}

View File

@ -0,0 +1,41 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.SingleRowOrColFLP"/>
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;
}
}
}

View File

@ -0,0 +1,20 @@
using System.ComponentModel;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.GroupBox"/>
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;
}
}

View File

@ -0,0 +1,24 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.GroupBox"/>
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;
}
}

View File

@ -0,0 +1,28 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.LabelOrLinkLabel"/>
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;
}
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,17 @@
using System.ComponentModel;
using System.Drawing;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.LabelOrLinkLabel"/>
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;
}
}

View File

@ -0,0 +1,11 @@
using System.ComponentModel;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.LabelOrLinkLabel"/>
public class LocSzLabelEx : LabelExBase
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public new bool AutoSize => base.AutoSize;
}
}

View File

@ -0,0 +1,21 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.LabelOrLinkLabel"/>
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;
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,17 @@
using System.ComponentModel;
using System.Drawing;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.LabelOrLinkLabel"/>
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;
}
}

View File

@ -0,0 +1,20 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.NUD"/>
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;
}
}

View File

@ -0,0 +1,20 @@
using System.ComponentModel;
using System.Drawing;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.CheckBoxOrRadioButton"/>
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;
}
}

View File

@ -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;
}
}

View File

@ -0,0 +1,33 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.TabPage"/>
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;
}
}
}

View File

@ -0,0 +1,20 @@
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
namespace BizHawk.WinForms.Controls
{
/// <inheritdoc cref="Docs.TextBox"/>
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;
}
}

View File

@ -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