Inline `RecordMovie.InitializeComponent` (Designer file)

This commit is contained in:
YoshiRulz 2022-12-07 06:20:28 +10:00
parent 102874e480
commit 400b1b589b
No known key found for this signature in database
GPG Key ID: C4DE31C245353FB7
3 changed files with 144 additions and 324 deletions

View File

@ -1,199 +0,0 @@
namespace BizHawk.Client.EmuHawk
{
partial class RecordMovie
{
/// <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.Cancel = new System.Windows.Forms.Button();
this.OK = new System.Windows.Forms.Button();
this.BrowseBtn = new System.Windows.Forms.Button();
this.RecordBox = new System.Windows.Forms.TextBox();
this.StartFromCombo = new System.Windows.Forms.ComboBox();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.DefaultAuthorCheckBox = new System.Windows.Forms.CheckBox();
this.AuthorBox = new System.Windows.Forms.TextBox();
this.label3 = new BizHawk.WinForms.Controls.LocLabelEx();
this.label2 = new BizHawk.WinForms.Controls.LocLabelEx();
this.label1 = new BizHawk.WinForms.Controls.LocLabelEx();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// Cancel
//
this.Cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.Cancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.Cancel.Location = new System.Drawing.Point(391, 135);
this.Cancel.Name = "Cancel";
this.Cancel.Size = new System.Drawing.Size(75, 23);
this.Cancel.TabIndex = 1;
this.Cancel.Text = "&Cancel";
this.Cancel.UseVisualStyleBackColor = true;
this.Cancel.Click += new System.EventHandler(this.Cancel_Click);
//
// OK
//
this.OK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.OK.Location = new System.Drawing.Point(310, 135);
this.OK.Name = "OK";
this.OK.Size = new System.Drawing.Size(75, 23);
this.OK.TabIndex = 0;
this.OK.Text = "&OK";
this.OK.UseVisualStyleBackColor = true;
this.OK.Click += new System.EventHandler(this.Ok_Click);
//
// BrowseBtn
//
this.BrowseBtn.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.BrowseBtn.Location = new System.Drawing.Point(423, 13);
this.BrowseBtn.Name = "BrowseBtn";
this.BrowseBtn.Size = new System.Drawing.Size(25, 23);
this.BrowseBtn.TabIndex = 1;
this.BrowseBtn.UseVisualStyleBackColor = true;
this.BrowseBtn.Click += new System.EventHandler(this.BrowseBtn_Click);
//
// RecordBox
//
this.RecordBox.AllowDrop = true;
this.RecordBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.RecordBox.Location = new System.Drawing.Point(83, 13);
this.RecordBox.Name = "RecordBox";
this.RecordBox.Size = new System.Drawing.Size(334, 20);
this.RecordBox.TabIndex = 0;
this.RecordBox.DragDrop += new System.Windows.Forms.DragEventHandler(this.RecordBox_DragDrop);
this.RecordBox.DragEnter += new System.Windows.Forms.DragEventHandler(this.RecordBox_DragEnter);
//
// StartFromCombo
//
this.StartFromCombo.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.StartFromCombo.FormattingEnabled = true;
this.StartFromCombo.Items.AddRange(new object[] {
"Power-On",
"Now",
"SaveRam"});
this.StartFromCombo.Location = new System.Drawing.Point(83, 65);
this.StartFromCombo.MaxDropDownItems = 32;
this.StartFromCombo.Name = "StartFromCombo";
this.StartFromCombo.Size = new System.Drawing.Size(152, 21);
this.StartFromCombo.TabIndex = 3;
//
// groupBox1
//
this.groupBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.groupBox1.Controls.Add(this.DefaultAuthorCheckBox);
this.groupBox1.Controls.Add(this.AuthorBox);
this.groupBox1.Controls.Add(this.StartFromCombo);
this.groupBox1.Controls.Add(this.BrowseBtn);
this.groupBox1.Controls.Add(this.label3);
this.groupBox1.Controls.Add(this.label2);
this.groupBox1.Controls.Add(this.label1);
this.groupBox1.Controls.Add(this.RecordBox);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(454, 112);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
//
// DefaultAuthorCheckBox
//
this.DefaultAuthorCheckBox.Anchor = System.Windows.Forms.AnchorStyles.Right;
this.DefaultAuthorCheckBox.AutoSize = true;
this.DefaultAuthorCheckBox.Location = new System.Drawing.Point(327, 64);
this.DefaultAuthorCheckBox.Name = "DefaultAuthorCheckBox";
this.DefaultAuthorCheckBox.Size = new System.Drawing.Size(121, 17);
this.DefaultAuthorCheckBox.TabIndex = 6;
this.DefaultAuthorCheckBox.Text = "Make default author";
this.DefaultAuthorCheckBox.UseVisualStyleBackColor = true;
//
// AuthorBox
//
this.AuthorBox.AllowDrop = true;
this.AuthorBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.AuthorBox.Location = new System.Drawing.Point(83, 39);
this.AuthorBox.Name = "AuthorBox";
this.AuthorBox.Size = new System.Drawing.Size(365, 20);
this.AuthorBox.TabIndex = 2;
//
// label3
//
this.label3.Location = new System.Drawing.Point(36, 41);
this.label3.Name = "label3";
this.label3.Text = "Author:";
//
// label2
//
this.label2.Location = new System.Drawing.Point(6, 68);
this.label2.Name = "label2";
this.label2.Text = "Record From:";
//
// label1
//
this.label1.Location = new System.Drawing.Point(51, 16);
this.label1.Name = "label1";
this.label1.Text = "File:";
//
// RecordMovie
//
this.AcceptButton = this.OK;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.Cancel;
this.ClientSize = new System.Drawing.Size(478, 163);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.OK);
this.Controls.Add(this.Cancel);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(1440, 201);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(425, 201);
this.Name = "RecordMovie";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "Record Movie";
this.Load += new System.EventHandler(this.RecordMovie_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button Cancel;
private System.Windows.Forms.Button OK;
private System.Windows.Forms.Button BrowseBtn;
private System.Windows.Forms.TextBox RecordBox;
private System.Windows.Forms.ComboBox StartFromCombo;
private System.Windows.Forms.GroupBox groupBox1;
private BizHawk.WinForms.Controls.LocLabelEx label3;
private BizHawk.WinForms.Controls.LocLabelEx label2;
private BizHawk.WinForms.Controls.LocLabelEx label1;
private System.Windows.Forms.TextBox AuthorBox;
private System.Windows.Forms.CheckBox DefaultAuthorCheckBox;
}
}

View File

@ -7,12 +7,19 @@ using System.Linq;
using BizHawk.Emulation.Common;
using BizHawk.Client.Common;
using BizHawk.Common;
using BizHawk.WinForms.Controls;
namespace BizHawk.Client.EmuHawk
{
// TODO - Allow relative paths in record TextBox
public partial class RecordMovie : Form, IDialogParent
public sealed class RecordMovie : Form, IDialogParent
{
private const string START_FROM_POWERON = "Power-On";
private const string START_FROM_SAVERAM = "SaveRam";
private const string START_FROM_SAVESTATE = "Now";
private readonly IMainFormForTools _mainForm;
private readonly Config _config;
private readonly GameInfo _game;
@ -20,6 +27,14 @@ namespace BizHawk.Client.EmuHawk
private readonly IMovieSession _movieSession;
private readonly FirmwareManager _firmwareManager;
private readonly TextBox AuthorBox;
private readonly CheckBox DefaultAuthorCheckBox;
private readonly TextBox RecordBox;
private readonly ComboBox StartFromCombo;
public IDialogController DialogController => _mainForm;
public RecordMovie(
@ -38,9 +53,129 @@ namespace BizHawk.Client.EmuHawk
_emulator = core;
_movieSession = movieSession;
_firmwareManager = firmwareManager;
InitializeComponent();
Icon = Properties.Resources.TAStudioIcon;
Button Cancel = new();
Button OK = new();
Button BrowseBtn = new();
RecordBox = new();
StartFromCombo = new();
GroupBox groupBox1 = new();
DefaultAuthorCheckBox = new();
AuthorBox = new();
LocLabelEx label3 = new();
LocLabelEx label2 = new();
LocLabelEx label1 = new();
groupBox1.SuspendLayout();
SuspendLayout();
Cancel.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
Cancel.DialogResult = DialogResult.Cancel;
Cancel.Location = new(391, 135);
Cancel.Name = "Cancel";
Cancel.Size = new(75, 23);
Cancel.TabIndex = 1;
Cancel.Text = "&Cancel";
Cancel.UseVisualStyleBackColor = true;
Cancel.Click += Cancel_Click;
OK.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
OK.Location = new(310, 135);
OK.Name = "OK";
OK.Size = new(75, 23);
OK.TabIndex = 0;
OK.Text = "&OK";
OK.UseVisualStyleBackColor = true;
OK.Click += Ok_Click;
BrowseBtn.Anchor = AnchorStyles.Top | AnchorStyles.Right;
BrowseBtn.Image = Properties.Resources.OpenFile;
BrowseBtn.Location = new(423, 13);
BrowseBtn.Name = "BrowseBtn";
BrowseBtn.Size = new(25, 23);
BrowseBtn.TabIndex = 1;
BrowseBtn.UseVisualStyleBackColor = true;
BrowseBtn.Click += BrowseBtn_Click;
RecordBox.AllowDrop = true;
RecordBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
RecordBox.Location = new(83, 13);
RecordBox.Name = "RecordBox";
RecordBox.Size = new(334, 20);
RecordBox.TabIndex = 0;
RecordBox.DragDrop += RecordBox_DragDrop;
RecordBox.DragEnter += RecordBox_DragEnter;
StartFromCombo.DropDownStyle = ComboBoxStyle.DropDownList;
StartFromCombo.FormattingEnabled = true;
StartFromCombo.Location = new(83, 65);
StartFromCombo.MaxDropDownItems = 32;
StartFromCombo.Name = "StartFromCombo";
StartFromCombo.Size = new(152, 21);
StartFromCombo.TabIndex = 3;
StartFromCombo.Items.Add(START_FROM_POWERON);
StartFromCombo.Items.Add(START_FROM_SAVESTATE);
StartFromCombo.Items.Add(START_FROM_SAVERAM);
groupBox1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
groupBox1.Location = new(12, 12);
groupBox1.Name = "groupBox1";
groupBox1.Size = new(454, 112);
groupBox1.TabIndex = 0;
groupBox1.TabStop = false;
groupBox1.Controls.Add(DefaultAuthorCheckBox);
groupBox1.Controls.Add(AuthorBox);
groupBox1.Controls.Add(StartFromCombo);
groupBox1.Controls.Add(BrowseBtn);
groupBox1.Controls.Add(label3);
groupBox1.Controls.Add(label2);
groupBox1.Controls.Add(label1);
groupBox1.Controls.Add(RecordBox);
DefaultAuthorCheckBox.Anchor = AnchorStyles.Right;
DefaultAuthorCheckBox.AutoSize = true;
DefaultAuthorCheckBox.Location = new(327, 64);
DefaultAuthorCheckBox.Name = "DefaultAuthorCheckBox";
DefaultAuthorCheckBox.Size = new(121, 17);
DefaultAuthorCheckBox.TabIndex = 6;
DefaultAuthorCheckBox.Text = "Make default author";
DefaultAuthorCheckBox.UseVisualStyleBackColor = true;
AuthorBox.AllowDrop = true;
AuthorBox.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
AuthorBox.Location = new(83, 39);
AuthorBox.Name = "AuthorBox";
AuthorBox.Size = new(365, 20);
AuthorBox.TabIndex = 2;
label3.Location = new(36, 41);
label3.Name = "label3";
label3.Text = "Author:";
label2.Location = new(6, 68);
label2.Name = "label2";
label2.Text = "Record From:";
label1.Location = new(51, 16);
label1.Name = "label1";
label1.Text = "File:";
AcceptButton = OK;
AutoScaleDimensions = new(6.0f, 13.0f);
AutoScaleMode = AutoScaleMode.Font;
CancelButton = Cancel;
ClientSize = new(478, 163);
Icon = Properties.Resources.TAStudioIcon;
MaximizeBox = false;
MaximumSize = new(1440, 201);
MinimizeBox = false;
MinimumSize = new(425, 201);
Name = "RecordMovie";
StartPosition = FormStartPosition.CenterParent;
Text = "Record Movie";
Controls.Add(groupBox1);
Controls.Add(OK);
Controls.Add(Cancel);
Load += RecordMovie_Load;
if (OSTailoredCode.IsUnixHost) Load += (_, _) =>
{
//HACK to make this usable on Linux. No clue why this Form in particular is so much worse, maybe the GroupBox? --yoshi
@ -51,6 +186,10 @@ namespace BizHawk.Client.EmuHawk
Cancel.Location += s;
};
groupBox1.ResumeLayout(performLayout: false);
groupBox1.PerformLayout();
ResumeLayout(performLayout: false);
if (!_emulator.HasSavestates())
{
StartFromCombo.Items.Remove(
@ -119,7 +258,7 @@ namespace BizHawk.Client.EmuHawk
Directory.CreateDirectory(fileInfo.DirectoryName);
}
if (StartFromCombo.SelectedItem.ToString() == "Now" && _emulator.HasSavestates())
if (StartFromCombo.SelectedItem.ToString() is START_FROM_SAVESTATE && _emulator.HasSavestates())
{
var core = _emulator.AsStatable();
@ -143,7 +282,7 @@ namespace BizHawk.Client.EmuHawk
movieToRecord.SavestateFramebuffer = (int[])_emulator.AsVideoProvider().GetVideoBuffer().Clone();
}
}
else if (StartFromCombo.SelectedItem.ToString() == "SaveRam" && _emulator.HasSaveRam())
else if (StartFromCombo.SelectedItem.ToString() is START_FROM_SAVERAM && _emulator.HasSaveRam())
{
var core = _emulator.AsSaveRam();
movieToRecord.StartsFromSaveRam = true;

View File

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