video-preview/OptionsForm.cs

188 lines
9.5 KiB
C#
Raw Normal View History

2021-10-03 17:43:59 +00:00
using RyzStudio.Windows.ThemedForms;
using System;
using System.Windows.Forms;
namespace VideoPreview
{
public class OptionsForm : TDialogForm
{
private TButton button1;
private TYesNoPickerBox pickerBox1;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Label label8;
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1;
private TNumericPickerBox pickerBox2;
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator2;
public OptionsForm(AppSession session) : base()
{
InitializeComponent();
this.Session = session;
}
private void InitializeComponent()
{
this.button1 = new RyzStudio.Windows.ThemedForms.TButton();
this.pickerBox1 = new RyzStudio.Windows.ThemedForms.TYesNoPickerBox();
this.label6 = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator();
this.pickerBox2 = new RyzStudio.Windows.ThemedForms.TNumericPickerBox();
this.SuspendLayout();
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
// button1
2021-12-29 20:35:18 +00:00
//
this.button1.ActiveImage = null;
2021-10-03 17:43:59 +00:00
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.BackColor = System.Drawing.Color.Transparent;
2021-12-29 20:35:18 +00:00
this.button1.HoverImage = null;
this.button1.IdleImage = null;
2021-10-03 17:43:59 +00:00
this.button1.LabelText = "&Save";
this.button1.Location = new System.Drawing.Point(241, 469);
2021-12-29 20:35:18 +00:00
this.button1.Margin = new System.Windows.Forms.Padding(10, 0, 0, 10);
2021-10-03 17:43:59 +00:00
this.button1.Name = "button1";
this.button1.Padding = new System.Windows.Forms.Padding(4, 4, 3, 3);
this.button1.Size = new System.Drawing.Size(128, 32);
2021-12-29 20:35:18 +00:00
this.button1.TabIndex = 2;
2021-10-03 17:43:59 +00:00
this.button1.MouseClick += new System.Windows.Forms.MouseEventHandler(this.button1_MouseClick);
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
// pickerBox1
2021-12-29 20:35:18 +00:00
//
this.pickerBox1.AcceptButton = null;
2021-10-03 17:43:59 +00:00
this.pickerBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox1.BackColor = System.Drawing.Color.Transparent;
this.pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.pickerBox1.Location = new System.Drawing.Point(285, 21);
this.pickerBox1.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4);
this.pickerBox1.Name = "pickerBox1";
this.pickerBox1.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
2021-12-29 20:35:18 +00:00
this.pickerBox1.Size = new System.Drawing.Size(84, 35);
this.pickerBox1.TabIndex = 0;
2021-10-03 17:43:59 +00:00
this.pickerBox1.Value = true;
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
// label6
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
this.label6.AutoSize = true;
this.label6.BackColor = System.Drawing.Color.Transparent;
this.label6.ForeColor = System.Drawing.SystemColors.ControlText;
this.label6.Location = new System.Drawing.Point(10, 85);
this.label6.Margin = new System.Windows.Forms.Padding(0);
this.label6.Name = "label6";
this.label6.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label6.Size = new System.Drawing.Size(117, 34);
this.label6.TabIndex = 182;
this.label6.Text = "Generate No. Frames";
this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
// label8
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
this.label8.AutoSize = true;
this.label8.BackColor = System.Drawing.Color.Transparent;
this.label8.ForeColor = System.Drawing.SystemColors.ControlText;
this.label8.Location = new System.Drawing.Point(10, 21);
this.label8.Margin = new System.Windows.Forms.Padding(0);
this.label8.Name = "label8";
this.label8.Padding = new System.Windows.Forms.Padding(0, 9, 0, 10);
this.label8.Size = new System.Drawing.Size(89, 34);
this.label8.TabIndex = 186;
this.label8.Text = "Always-On-Top";
this.label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
// tHorizontalSeparator1
2021-12-29 20:35:18 +00:00
//
this.tHorizontalSeparator1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
2021-10-03 17:43:59 +00:00
| System.Windows.Forms.AnchorStyles.Right)));
this.tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent;
this.tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437);
2021-12-29 20:35:18 +00:00
this.tHorizontalSeparator1.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10);
2021-10-03 17:43:59 +00:00
this.tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
this.tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22);
this.tHorizontalSeparator1.Name = "tHorizontalSeparator1";
this.tHorizontalSeparator1.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
this.tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22);
this.tHorizontalSeparator1.TabIndex = 188;
2021-12-29 20:35:18 +00:00
this.tHorizontalSeparator1.TabStop = false;
//
2021-10-03 17:43:59 +00:00
// tHorizontalSeparator2
2021-12-29 20:35:18 +00:00
//
this.tHorizontalSeparator2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
2021-10-03 17:43:59 +00:00
| System.Windows.Forms.AnchorStyles.Right)));
this.tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0);
this.tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent;
this.tHorizontalSeparator2.Location = new System.Drawing.Point(10, 59);
2021-12-29 20:35:18 +00:00
this.tHorizontalSeparator2.Margin = new System.Windows.Forms.Padding(5, 0, 5, 10);
2021-10-03 17:43:59 +00:00
this.tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2);
this.tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22);
this.tHorizontalSeparator2.Name = "tHorizontalSeparator2";
this.tHorizontalSeparator2.Padding = new System.Windows.Forms.Padding(0, 10, 0, 10);
this.tHorizontalSeparator2.Size = new System.Drawing.Size(364, 22);
this.tHorizontalSeparator2.TabIndex = 190;
2021-12-29 20:35:18 +00:00
this.tHorizontalSeparator2.TabStop = false;
//
2021-10-03 17:43:59 +00:00
// pickerBox2
2021-12-29 20:35:18 +00:00
//
this.pickerBox2.AcceptButton = null;
2021-10-03 17:43:59 +00:00
this.pickerBox2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.pickerBox2.BackColor = System.Drawing.Color.Transparent;
this.pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point);
this.pickerBox2.Location = new System.Drawing.Point(285, 85);
this.pickerBox2.Margin = new System.Windows.Forms.Padding(10, 4, 10, 4);
this.pickerBox2.Name = "pickerBox2";
this.pickerBox2.Padding = new System.Windows.Forms.Padding(10, 6, 7, 5);
2021-12-29 20:35:18 +00:00
this.pickerBox2.Size = new System.Drawing.Size(84, 35);
this.pickerBox2.TabIndex = 1;
2021-10-03 17:43:59 +00:00
this.pickerBox2.Value = 0;
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
// OptionsForm
2021-12-29 20:35:18 +00:00
//
2021-10-03 17:43:59 +00:00
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(384, 521);
this.Controls.Add(this.pickerBox2);
this.Controls.Add(this.tHorizontalSeparator2);
this.Controls.Add(this.tHorizontalSeparator1);
this.Controls.Add(this.label8);
this.Controls.Add(this.pickerBox1);
this.Controls.Add(this.label6);
this.Controls.Add(this.button1);
this.MinimumSize = new System.Drawing.Size(400, 560);
this.Name = "OptionsForm";
this.Text = "Options";
this.ResumeLayout(false);
this.PerformLayout();
}
protected override void OnShown(EventArgs e)
{
base.OnShown(e);
this.DialogResult = System.Windows.Forms.DialogResult.None;
pickerBox1.Value = this.Session.AlwaysOnTop;
pickerBox2.Clear(1, 20, this.Session.NoFrames);
}
public AppSession Session { get; protected set; }
private void button1_MouseClick(object sender, MouseEventArgs e)
{
if (this.Session == null) this.Session = new AppSession();
this.Session.AlwaysOnTop = pickerBox1.Value;
this.Session.NoFrames = pickerBox2.Value;
this.DialogResult = DialogResult.OK;
this.Close();
}
}
}