Custom controls house cleaning - remove a bunch of unused controls, do some cleanups
This commit is contained in:
parent
0405eb7c73
commit
7936797a9d
|
@ -585,9 +585,6 @@
|
|||
<Compile Include="CustomControls\HexView.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\InputConfigBase.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\InputRoll\Cell.cs" />
|
||||
<Compile Include="CustomControls\InputRoll\ColumnType.cs" />
|
||||
<Compile Include="CustomControls\InputRoll\InputRoll.cs">
|
||||
|
@ -617,27 +614,12 @@
|
|||
<Compile Include="CustomControls\PrereqsAlert.Designer.cs">
|
||||
<DependentUpon>PrereqsAlert.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\QuickProgressPopup.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\QuickProgressPopup.Designer.cs">
|
||||
<DependentUpon>QuickProgressPopup.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\RepeatButton.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\TransparentTrackbar.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\ReadonlyCheckbox.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\SmartTextBoxControl.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\TextDebugView.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="CustomControls\ToolStripEx.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
|
@ -1506,18 +1488,12 @@
|
|||
<EmbeddedResource Include="CustomControls\ExceptionBox.resx">
|
||||
<DependentUpon>ExceptionBox.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="CustomControls\InputConfigBase.resx">
|
||||
<DependentUpon>InputConfigBase.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="CustomControls\MsgBox.resx">
|
||||
<DependentUpon>MsgBox.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="CustomControls\PrereqsAlert.resx">
|
||||
<DependentUpon>PrereqsAlert.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="CustomControls\QuickProgressPopup.resx">
|
||||
<DependentUpon>QuickProgressPopup.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="MainForm.resx">
|
||||
<DependentUpon>MainForm.cs</DependentUpon>
|
||||
<SubType>Designer</SubType>
|
||||
|
|
|
@ -1,10 +1,5 @@
|
|||
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;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
|
@ -79,12 +74,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
Rectangle rc = this.ClientRectangle;
|
||||
Rectangle rc = ClientRectangle;
|
||||
StringFormat fmt = new StringFormat(StringFormat.GenericTypographic);
|
||||
using (var br = new SolidBrush(this.ForeColor))
|
||||
{
|
||||
e.Graphics.DrawString(this.Text, this.Font, br, rc, fmt);
|
||||
}
|
||||
using var br = new SolidBrush(ForeColor);
|
||||
e.Graphics.DrawString(this.Text, this.Font, br, rc, fmt);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -12,21 +12,20 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
bool Nullable { get; }
|
||||
int? ToRawInt();
|
||||
void SetFromRawInt(int? rawint);
|
||||
void SetFromRawInt(int? rawInt);
|
||||
}
|
||||
|
||||
public class HexTextBox : TextBox, INumberBox
|
||||
{
|
||||
private string _addressFormatStr = "";
|
||||
private long? _maxSize;
|
||||
private bool _nullable = true;
|
||||
|
||||
public HexTextBox()
|
||||
{
|
||||
CharacterCasing = CharacterCasing.Upper;
|
||||
}
|
||||
|
||||
public bool Nullable { get { return _nullable; } set { _nullable = value; } }
|
||||
public bool Nullable { get; set; } = true;
|
||||
|
||||
public void SetHexProperties(long domainSize)
|
||||
{
|
||||
|
@ -38,10 +37,10 @@ namespace BizHawk.Client.EmuHawk
|
|||
MaxLength = _maxSize.Value.NumHexDigits();
|
||||
_addressFormatStr = $"{{0:X{MaxLength}}}";
|
||||
|
||||
//try to preserve the old value, as best we can
|
||||
// try to preserve the old value, as best we can
|
||||
if(!wasMaxSizeSet)
|
||||
ResetText();
|
||||
else if(_nullable)
|
||||
else if (Nullable)
|
||||
Text = "";
|
||||
else if (MaxLength != currMaxLength)
|
||||
{
|
||||
|
@ -65,7 +64,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public override void ResetText()
|
||||
{
|
||||
Text = _nullable ? "" : string.Format(_addressFormatStr, 0);
|
||||
Text = Nullable ? "" : string.Format(_addressFormatStr, 0);
|
||||
}
|
||||
|
||||
protected override void OnKeyPress(KeyPressEventArgs e)
|
||||
|
@ -179,14 +178,12 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public class UnsignedIntegerBox : TextBox, INumberBox
|
||||
{
|
||||
private bool _nullable = true;
|
||||
|
||||
public UnsignedIntegerBox()
|
||||
{
|
||||
CharacterCasing = CharacterCasing.Upper;
|
||||
}
|
||||
|
||||
public bool Nullable { get { return _nullable; } set { _nullable = value; } }
|
||||
public bool Nullable { get; set; } = true;
|
||||
|
||||
protected override void OnKeyPress(KeyPressEventArgs e)
|
||||
{
|
||||
|
@ -203,7 +200,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public override void ResetText()
|
||||
{
|
||||
Text = _nullable ? "" : "0";
|
||||
Text = Nullable ? "" : "0";
|
||||
}
|
||||
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public class InputConfigBase : Form
|
||||
{
|
||||
public void CheckDups()
|
||||
{
|
||||
Dictionary<string,bool> dups = new Dictionary<string,bool>();
|
||||
foreach (Control c in Controls)
|
||||
{
|
||||
SmartTextBoxControl stbc = c as SmartTextBoxControl;
|
||||
if (stbc == null) continue;
|
||||
if (dups.ContainsKey(stbc.Text))
|
||||
{
|
||||
MessageBox.Show("DUP!");
|
||||
return;
|
||||
}
|
||||
dups[stbc.Text] = true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Drawing;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
using System.ComponentModel;
|
||||
|
||||
|
@ -7,8 +6,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
{
|
||||
public class MenuButton : Button
|
||||
{
|
||||
public MenuButton() { }
|
||||
|
||||
[DefaultValue(null)]
|
||||
public ContextMenuStrip Menu { get; set; }
|
||||
|
||||
|
@ -30,7 +27,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
int arrowY = ClientRectangle.Height / 2 - 1;
|
||||
|
||||
Brush brush = Enabled ? SystemBrushes.ControlText : SystemBrushes.ButtonShadow;
|
||||
Point[] arrows = new Point[] { new Point(arrowX, arrowY), new Point(arrowX + 7, arrowY), new Point(arrowX + 3, arrowY + 4) };
|
||||
Point[] arrows = { new Point(arrowX, arrowY), new Point(arrowX + 7, arrowY), new Point(arrowX + 3, arrowY + 4) };
|
||||
pevent.Graphics.FillPolygon(brush, arrows);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,23 +18,23 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public class CustomCheckBox : CheckBox
|
||||
{
|
||||
Color _CheckBackColor = SystemColors.Control;
|
||||
Color _checkBackColor = SystemColors.Control;
|
||||
public Color CheckBackColor
|
||||
{
|
||||
get { return _CheckBackColor; }
|
||||
set { _CheckBackColor = value; Refresh(); }
|
||||
get => _checkBackColor;
|
||||
set { _checkBackColor = value; Refresh(); }
|
||||
}
|
||||
|
||||
bool? _ForceChecked;
|
||||
bool? _forceChecked;
|
||||
public bool? ForceChecked
|
||||
{
|
||||
get { return _ForceChecked; }
|
||||
set { _ForceChecked = value; Refresh(); }
|
||||
get => _forceChecked;
|
||||
set { _forceChecked = value; Refresh(); }
|
||||
}
|
||||
|
||||
protected override void OnPaint(PaintEventArgs pevent)
|
||||
{
|
||||
//draw text-label part of the control with something so that it isn't hallofmirrorsy
|
||||
// draw text-label part of the control with something so that it isn't hallofmirrorsy
|
||||
using(var brush = new SolidBrush(Parent.BackColor))
|
||||
pevent.Graphics.FillRectangle(brush, ClientRectangle);
|
||||
|
||||
|
@ -42,11 +42,11 @@ namespace BizHawk.Client.EmuHawk
|
|||
var glyphLoc = ClientRectangle;
|
||||
glyphLoc.Size = SystemInformation.MenuCheckSize;
|
||||
|
||||
//draw the selectedbackdrop color roughly where the glyph belongs
|
||||
using (var brush = new SolidBrush(_CheckBackColor))
|
||||
// draw the selectedbackdrop color roughly where the glyph belongs
|
||||
using (var brush = new SolidBrush(_checkBackColor))
|
||||
pevent.Graphics.FillRectangle(brush, glyphLoc);
|
||||
|
||||
//draw a checkbox menu glyph (we could do this more elegantly with DrawFrameControl)
|
||||
// draw a checkbox menu glyph (we could do this more elegantly with DrawFrameControl)
|
||||
bool c = CheckState == CheckState.Checked;
|
||||
if (ForceChecked.HasValue)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
ControlPaint.DrawMenuGlyph(pevent.Graphics, glyphLoc, MenuGlyph.Checkmark, Color.Black, Color.Transparent);
|
||||
}
|
||||
|
||||
//draw a border on top of it all
|
||||
// draw a border on top of it all
|
||||
ControlPaint.DrawBorder3D(pevent.Graphics, r, Border3DStyle.Sunken);
|
||||
|
||||
//stuff that didnt work
|
||||
|
|
|
@ -1,21 +1,17 @@
|
|||
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;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk.CustomControls
|
||||
{
|
||||
public partial class PrereqsAlert : Form
|
||||
{
|
||||
public PrereqsAlert(bool warn_only)
|
||||
public PrereqsAlert(bool warnOnly)
|
||||
{
|
||||
InitializeComponent();
|
||||
if (warn_only)
|
||||
if (warnOnly)
|
||||
{
|
||||
button1.Text = "Continue";
|
||||
}
|
||||
}
|
||||
|
||||
private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
||||
|
|
|
@ -1,77 +0,0 @@
|
|||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
partial class QuickProgressPopup
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.progressBar = new System.Windows.Forms.ProgressBar();
|
||||
this.lblProgress = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// progressBar
|
||||
//
|
||||
this.progressBar.Location = new System.Drawing.Point(12, 12);
|
||||
this.progressBar.Name = "progressBar";
|
||||
this.progressBar.Size = new System.Drawing.Size(194, 23);
|
||||
this.progressBar.TabIndex = 0;
|
||||
//
|
||||
// lblProgress
|
||||
//
|
||||
this.lblProgress.AutoSize = true;
|
||||
this.lblProgress.Location = new System.Drawing.Point(12, 41);
|
||||
this.lblProgress.Margin = new System.Windows.Forms.Padding(3);
|
||||
this.lblProgress.Name = "lblProgress";
|
||||
this.lblProgress.Size = new System.Drawing.Size(35, 13);
|
||||
this.lblProgress.TabIndex = 1;
|
||||
this.lblProgress.Text = "label1";
|
||||
//
|
||||
// QuickProgressPopup
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.AutoSize = true;
|
||||
this.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
|
||||
this.ClientSize = new System.Drawing.Size(229, 63);
|
||||
this.ControlBox = false;
|
||||
this.Controls.Add(this.lblProgress);
|
||||
this.Controls.Add(this.progressBar);
|
||||
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
|
||||
this.MaximizeBox = false;
|
||||
this.MinimizeBox = false;
|
||||
this.Name = "QuickProgressPopup";
|
||||
this.Text = "Please wait...";
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.ProgressBar progressBar;
|
||||
private System.Windows.Forms.Label lblProgress;
|
||||
}
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
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;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public partial class QuickProgressPopup : Form
|
||||
{
|
||||
public QuickProgressPopup()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,120 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
|
@ -1,13 +0,0 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public class ReadonlyCheckBox : CheckBox
|
||||
{
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,7 +1,4 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
|
@ -9,83 +6,77 @@ namespace BizHawk.Client.EmuHawk
|
|||
// http://www.codeproject.com/Articles/2130/NET-port-of-Joe-s-AutoRepeat-Button-class
|
||||
public class RepeatButton : Button
|
||||
{
|
||||
private Timer m_timer;
|
||||
private bool down = false;
|
||||
private bool once = false;
|
||||
private int m_initdelay = 1000;
|
||||
private int m_repdelay = 400;
|
||||
private readonly Timer _mTimer;
|
||||
private bool _down;
|
||||
private bool _once;
|
||||
private int _mInitDelay = 1000;
|
||||
private int _mRepeatDelay = 400;
|
||||
|
||||
public RepeatButton()
|
||||
{
|
||||
this.MouseUp +=
|
||||
new MouseEventHandler(RepeatButton_MouseUp);
|
||||
this.MouseDown +=
|
||||
new MouseEventHandler(RepeatButton_MouseDown);
|
||||
MouseUp += RepeatButton_MouseUp;
|
||||
MouseDown += RepeatButton_MouseDown;
|
||||
|
||||
m_timer = new Timer();
|
||||
m_timer.Tick += new EventHandler(timerproc);
|
||||
m_timer.Enabled = false;
|
||||
_mTimer = new Timer();
|
||||
_mTimer.Tick += TimerProcess;
|
||||
_mTimer.Enabled = false;
|
||||
}
|
||||
|
||||
private void timerproc(object o1, EventArgs e1)
|
||||
private void TimerProcess(object o1, EventArgs e1)
|
||||
{
|
||||
m_timer.Interval = m_repdelay;
|
||||
if (down)
|
||||
_mTimer.Interval = _mRepeatDelay;
|
||||
if (_down)
|
||||
{
|
||||
once = true;
|
||||
this.PerformClick();
|
||||
_once = true;
|
||||
PerformClick();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected override void OnClick(EventArgs e)
|
||||
{
|
||||
if (!once || down)
|
||||
if (!_once || _down)
|
||||
{
|
||||
base.OnClick(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void RepeatButton_MouseDown(object sender,
|
||||
System.Windows.Forms.MouseEventArgs e)
|
||||
private void RepeatButton_MouseDown(object sender, MouseEventArgs e)
|
||||
{
|
||||
m_timer.Interval = m_initdelay;
|
||||
m_timer.Enabled = true;
|
||||
down = true;
|
||||
_mTimer.Interval = _mInitDelay;
|
||||
_mTimer.Enabled = true;
|
||||
_down = true;
|
||||
}
|
||||
|
||||
private void RepeatButton_MouseUp(object sender,
|
||||
System.Windows.Forms.MouseEventArgs e)
|
||||
private void RepeatButton_MouseUp(object sender, MouseEventArgs e)
|
||||
{
|
||||
m_timer.Enabled = false;
|
||||
down = false;
|
||||
_mTimer.Enabled = false;
|
||||
_down = false;
|
||||
}
|
||||
|
||||
public int InitialDelay
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_initdelay;
|
||||
}
|
||||
get => _mInitDelay;
|
||||
set
|
||||
{
|
||||
m_initdelay = value;
|
||||
if (m_initdelay < 10)
|
||||
m_initdelay = 10;
|
||||
_mInitDelay = value;
|
||||
if (_mInitDelay < 10)
|
||||
{
|
||||
_mInitDelay = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int RepeatDelay
|
||||
{
|
||||
get
|
||||
{
|
||||
return m_repdelay;
|
||||
}
|
||||
get => _mRepeatDelay;
|
||||
set
|
||||
{
|
||||
m_repdelay = value;
|
||||
if (m_repdelay < 10)
|
||||
m_repdelay = 10;
|
||||
_mRepeatDelay = value;
|
||||
if (_mRepeatDelay < 10)
|
||||
{
|
||||
_mRepeatDelay = 10;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public class SmartTextBoxControl : TextBox
|
||||
{
|
||||
public SmartTextBoxControl()
|
||||
{
|
||||
ReadOnly = true;
|
||||
}
|
||||
protected override void OnKeyDown(KeyEventArgs e)
|
||||
{
|
||||
base.Text = e.KeyCode.ToString();
|
||||
OnTextChanged(new EventArgs());
|
||||
}
|
||||
|
||||
protected override void OnKeyPress(KeyPressEventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnKeyUp(KeyEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
public override string Text
|
||||
{
|
||||
get { return base.Text; }
|
||||
set { }
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,57 +0,0 @@
|
|||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
public class TextDebugView : Control
|
||||
{
|
||||
public TextDebugView()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.Opaque, true);
|
||||
SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
||||
}
|
||||
protected override void OnPaint(PaintEventArgs e)
|
||||
{
|
||||
base.OnPaint(e);
|
||||
e.Graphics.Clear(SystemColors.Control);
|
||||
using var font = new Font(new FontFamily("Courier New"), 8);
|
||||
e.Graphics.DrawString(Text, font, Brushes.Black,0,0);
|
||||
}
|
||||
|
||||
public override string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Text = value;
|
||||
Invalidate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public class TextDebugForm : Form
|
||||
{
|
||||
public TextDebugView view = new TextDebugView();
|
||||
public TextDebugForm()
|
||||
{
|
||||
view.Dock = DockStyle.Fill;
|
||||
Controls.Add(view);
|
||||
}
|
||||
|
||||
public override string Text
|
||||
{
|
||||
get
|
||||
{
|
||||
return view.Text;
|
||||
}
|
||||
set
|
||||
{
|
||||
view.Text = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,5 +1,4 @@
|
|||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace BizHawk.Client.EmuHawk
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@ using System;
|
|||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Drawing.Drawing2D;
|
||||
using System.Windows.Forms;
|
||||
|
||||
|
@ -130,15 +129,6 @@ namespace BizHawk.Client.EmuHawk
|
|||
ewh.Set();
|
||||
}
|
||||
|
||||
//Size logicalSize;
|
||||
////int pitch;
|
||||
//public void SetLogicalSize(int w, int h)
|
||||
//{
|
||||
// if (bmp != null) bmp.Dispose();
|
||||
// bmp = new Bitmap(w, h, PixelFormat.Format32bppArgb);
|
||||
// logicalSize = new Size(w, h);
|
||||
//}
|
||||
|
||||
/// <summary>
|
||||
/// Takes ownership of the provided bitmap and will use it for future painting
|
||||
/// </summary>
|
||||
|
@ -172,68 +162,5 @@ namespace BizHawk.Client.EmuHawk
|
|||
SignalPaint();
|
||||
base.OnPaint(e);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A dumb panel which functions as a placeholder for framebuffer painting
|
||||
/// </summary>
|
||||
public class ViewportPanel : Control
|
||||
{
|
||||
public ViewportPanel()
|
||||
{
|
||||
SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
||||
SetStyle(ControlStyles.UserPaint, true);
|
||||
SetStyle(ControlStyles.DoubleBuffer, true);
|
||||
SetStyle(ControlStyles.Opaque, true);
|
||||
SetStyle(ControlStyles.UserMouse, true);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A ViewportPanel with a vertical scroll bar
|
||||
/// </summary>
|
||||
public class ScrollableViewportPanel : UserControl
|
||||
{
|
||||
TableLayoutPanel table;
|
||||
ViewportPanel view;
|
||||
VScrollBar scroll;
|
||||
|
||||
public ViewportPanel View { get { return view; } }
|
||||
public VScrollBar Scrollbar { get { return scroll; } }
|
||||
|
||||
public int ScrollMax { get { return Scrollbar.Maximum; } set { Scrollbar.Maximum = value; } }
|
||||
public int ScrollLargeChange { get { return Scrollbar.LargeChange; } set { Scrollbar.LargeChange = value; } }
|
||||
|
||||
public ScrollableViewportPanel()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public void InitializeComponent()
|
||||
{
|
||||
table = new TableLayoutPanel();
|
||||
view = new ViewportPanel();
|
||||
scroll = new VScrollBar();
|
||||
|
||||
scroll.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom;
|
||||
view.Dock = DockStyle.Fill;
|
||||
|
||||
table.Dock = DockStyle.Fill;
|
||||
table.RowStyles.Add(new RowStyle(SizeType.Percent, 100));
|
||||
table.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100));
|
||||
table.ColumnStyles.Add(new ColumnStyle(SizeType.AutoSize, 0));
|
||||
table.RowCount = 1;
|
||||
table.ColumnCount = 2;
|
||||
table.Controls.Add(view);
|
||||
table.Controls.Add(scroll);
|
||||
table.SetColumn(view, 0);
|
||||
table.SetColumn(scroll, 1);
|
||||
|
||||
scroll.Scroll += (sender, e) => OnScroll(e);
|
||||
view.Paint += (sender, e) => OnPaint(e);
|
||||
|
||||
Controls.Add(table);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -52,11 +52,7 @@ namespace BizHawk.Client.EmuHawk
|
|||
|
||||
public string Bindings
|
||||
{
|
||||
get
|
||||
{
|
||||
return Text;
|
||||
}
|
||||
|
||||
get => Text;
|
||||
set
|
||||
{
|
||||
ClearBindings();
|
||||
|
|
|
@ -256,6 +256,7 @@
|
|||
<s:Boolean x:Key="/Default/UserDictionary/Words/=performant/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Phaser/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Pollable/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Prereqs/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Regionable/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=resizer/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Rewinder/@EntryIndexedValue">True</s:Boolean>
|
||||
|
|
Loading…
Reference in New Issue