bf6997c71b
Upgraded to .NET 8
308 lines
14 KiB
C#
308 lines
14 KiB
C#
using RyzStudio.Windows.ThemedForms;
|
|
using RyzStudio.Windows.ThemedForms.ButtonTextBox;
|
|
using RyzStudio.Windows.ThemedForms.PickerBox;
|
|
using System;
|
|
using System.Windows.Forms;
|
|
|
|
namespace RandomFileRunner
|
|
{
|
|
public class OptionsForm : Form
|
|
{
|
|
private ThButton button1;
|
|
private ThYesNoPickerBox pickerBox1;
|
|
private System.Windows.Forms.Label label6;
|
|
private System.Windows.Forms.Label label8;
|
|
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator1;
|
|
private ThNumericPickerBox pickerBox2;
|
|
private ThKeyCodeTextBox textBox1;
|
|
private ThYesNoPickerBox pickerBox3;
|
|
private Label label1;
|
|
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator3;
|
|
private Label label2;
|
|
private RyzStudio.Windows.Forms.THorizontalSeparator tHorizontalSeparator2;
|
|
|
|
|
|
public OptionsForm(AppSession session) : base()
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.Session = session;
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(OptionsForm));
|
|
ThKeyCodeTextBox.Results results1 = new ThKeyCodeTextBox.Results();
|
|
button1 = new ThButton();
|
|
pickerBox1 = new ThYesNoPickerBox();
|
|
label6 = new Label();
|
|
label8 = new Label();
|
|
tHorizontalSeparator1 = new RyzStudio.Windows.Forms.THorizontalSeparator();
|
|
tHorizontalSeparator2 = new RyzStudio.Windows.Forms.THorizontalSeparator();
|
|
pickerBox2 = new ThNumericPickerBox();
|
|
textBox1 = new ThKeyCodeTextBox();
|
|
pickerBox3 = new ThYesNoPickerBox();
|
|
label1 = new Label();
|
|
tHorizontalSeparator3 = new RyzStudio.Windows.Forms.THorizontalSeparator();
|
|
label2 = new Label();
|
|
SuspendLayout();
|
|
//
|
|
// button1
|
|
//
|
|
button1.AcceptButton = null;
|
|
button1.ActiveImage = null;
|
|
button1.Anchor = AnchorStyles.Bottom | AnchorStyles.Right;
|
|
button1.BackColor = System.Drawing.Color.Transparent;
|
|
button1.EnableMenuOnClick = false;
|
|
button1.EnableReactiveVisual = true;
|
|
button1.HoverImage = null;
|
|
button1.IdleImage = null;
|
|
button1.LabelText = "&Save";
|
|
button1.Location = new System.Drawing.Point(241, 469);
|
|
button1.Margin = new Padding(10, 0, 10, 10);
|
|
button1.Name = "button1";
|
|
button1.Padding = new Padding(4, 4, 3, 3);
|
|
button1.Size = new System.Drawing.Size(128, 32);
|
|
button1.TabIndex = 4;
|
|
button1.TabStop = false;
|
|
button1.MouseClick += button1_MouseClick;
|
|
//
|
|
// pickerBox1
|
|
//
|
|
pickerBox1.AcceptButton = null;
|
|
pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
pickerBox1.BackColor = System.Drawing.Color.Transparent;
|
|
pickerBox1.EnableReactiveVisual = true;
|
|
pickerBox1.Font = new System.Drawing.Font("Segoe UI", 9F);
|
|
pickerBox1.Location = new System.Drawing.Point(285, 21);
|
|
pickerBox1.Margin = new Padding(10, 10, 10, 0);
|
|
pickerBox1.Name = "pickerBox1";
|
|
pickerBox1.Padding = new Padding(4, 4, 3, 3);
|
|
pickerBox1.SelectedIndex = 1;
|
|
pickerBox1.Size = new System.Drawing.Size(84, 35);
|
|
pickerBox1.TabIndex = 0;
|
|
pickerBox1.TabStop = false;
|
|
pickerBox1.Value = true;
|
|
//
|
|
// label6
|
|
//
|
|
label6.AutoSize = true;
|
|
label6.BackColor = System.Drawing.Color.Transparent;
|
|
label6.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
label6.Location = new System.Drawing.Point(10, 85);
|
|
label6.Margin = new Padding(0);
|
|
label6.Name = "label6";
|
|
label6.Padding = new Padding(0, 9, 0, 10);
|
|
label6.Size = new System.Drawing.Size(81, 34);
|
|
label6.TabIndex = 182;
|
|
label6.Text = "Retry On Error";
|
|
label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
|
//
|
|
// label8
|
|
//
|
|
label8.AutoSize = true;
|
|
label8.BackColor = System.Drawing.Color.Transparent;
|
|
label8.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
label8.Location = new System.Drawing.Point(10, 21);
|
|
label8.Margin = new Padding(0);
|
|
label8.Name = "label8";
|
|
label8.Padding = new Padding(0, 9, 0, 10);
|
|
label8.Size = new System.Drawing.Size(143, 34);
|
|
label8.TabIndex = 186;
|
|
label8.Text = "Search Top Directory Only";
|
|
label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
|
//
|
|
// tHorizontalSeparator1
|
|
//
|
|
tHorizontalSeparator1.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
|
|
tHorizontalSeparator1.AutoScrollMargin = new System.Drawing.Size(0, 0);
|
|
tHorizontalSeparator1.AutoScrollMinSize = new System.Drawing.Size(0, 0);
|
|
tHorizontalSeparator1.BackColor = System.Drawing.Color.Transparent;
|
|
tHorizontalSeparator1.Location = new System.Drawing.Point(10, 437);
|
|
tHorizontalSeparator1.Margin = new Padding(0, 10, 0, 0);
|
|
tHorizontalSeparator1.MaximumSize = new System.Drawing.Size(4920, 2);
|
|
tHorizontalSeparator1.MinimumSize = new System.Drawing.Size(0, 22);
|
|
tHorizontalSeparator1.Name = "tHorizontalSeparator1";
|
|
tHorizontalSeparator1.Size = new System.Drawing.Size(364, 22);
|
|
tHorizontalSeparator1.TabIndex = 188;
|
|
tHorizontalSeparator1.TabStop = false;
|
|
//
|
|
// tHorizontalSeparator2
|
|
//
|
|
tHorizontalSeparator2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
tHorizontalSeparator2.AutoScrollMargin = new System.Drawing.Size(0, 0);
|
|
tHorizontalSeparator2.AutoScrollMinSize = new System.Drawing.Size(0, 0);
|
|
tHorizontalSeparator2.BackColor = System.Drawing.Color.Transparent;
|
|
tHorizontalSeparator2.Location = new System.Drawing.Point(10, 59);
|
|
tHorizontalSeparator2.Margin = new Padding(0, 10, 0, 0);
|
|
tHorizontalSeparator2.MaximumSize = new System.Drawing.Size(4920, 2);
|
|
tHorizontalSeparator2.MinimumSize = new System.Drawing.Size(0, 22);
|
|
tHorizontalSeparator2.Name = "tHorizontalSeparator2";
|
|
tHorizontalSeparator2.Size = new System.Drawing.Size(364, 22);
|
|
tHorizontalSeparator2.TabIndex = 190;
|
|
tHorizontalSeparator2.TabStop = false;
|
|
//
|
|
// pickerBox2
|
|
//
|
|
pickerBox2.AcceptButton = null;
|
|
pickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
pickerBox2.BackColor = System.Drawing.Color.Transparent;
|
|
pickerBox2.EnableReactiveVisual = true;
|
|
pickerBox2.Font = new System.Drawing.Font("Segoe UI", 9F);
|
|
pickerBox2.Location = new System.Drawing.Point(285, 85);
|
|
pickerBox2.Margin = new Padding(10, 10, 10, 0);
|
|
pickerBox2.MaxDropDownItems = 10;
|
|
pickerBox2.Maximum = 50;
|
|
pickerBox2.Minimum = 0;
|
|
pickerBox2.Name = "pickerBox2";
|
|
pickerBox2.Padding = new Padding(4, 4, 3, 3);
|
|
pickerBox2.SelectedIndex = 0;
|
|
pickerBox2.Size = new System.Drawing.Size(84, 35);
|
|
pickerBox2.TabIndex = 1;
|
|
pickerBox2.TabStop = false;
|
|
pickerBox2.Value = 0;
|
|
//
|
|
// textBox1
|
|
//
|
|
textBox1.AcceptButton = null;
|
|
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
textBox1.BackColor = System.Drawing.Color.Transparent;
|
|
textBox1.EnableReactiveVisual = true;
|
|
textBox1.Font = new System.Drawing.Font("Segoe UI", 9F);
|
|
textBox1.HighlightImage = (System.Drawing.Image)resources.GetObject("textBox1.HighlightImage");
|
|
results1.IsAlt = false;
|
|
results1.IsCtrl = false;
|
|
results1.IsShift = false;
|
|
results1.Key = Keys.None;
|
|
textBox1.KeyCodeResults = results1;
|
|
textBox1.Location = new System.Drawing.Point(241, 197);
|
|
textBox1.Margin = new Padding(10, 10, 10, 0);
|
|
textBox1.Name = "textBox1";
|
|
textBox1.NormalImage = (System.Drawing.Image)resources.GetObject("textBox1.NormalImage");
|
|
textBox1.Padding = new Padding(4, 4, 3, 3);
|
|
textBox1.Size = new System.Drawing.Size(128, 32);
|
|
textBox1.TabIndex = 3;
|
|
textBox1.TabStop = false;
|
|
textBox1.UseSystemPasswordChar = false;
|
|
//
|
|
// pickerBox3
|
|
//
|
|
pickerBox3.AcceptButton = null;
|
|
pickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
pickerBox3.BackColor = System.Drawing.Color.Transparent;
|
|
pickerBox3.EnableReactiveVisual = true;
|
|
pickerBox3.Font = new System.Drawing.Font("Segoe UI", 9F);
|
|
pickerBox3.Location = new System.Drawing.Point(285, 127);
|
|
pickerBox3.Margin = new Padding(10, 10, 10, 0);
|
|
pickerBox3.Name = "pickerBox3";
|
|
pickerBox3.Padding = new Padding(4, 4, 3, 3);
|
|
pickerBox3.SelectedIndex = 1;
|
|
pickerBox3.Size = new System.Drawing.Size(84, 35);
|
|
pickerBox3.TabIndex = 2;
|
|
pickerBox3.TabStop = false;
|
|
pickerBox3.Value = true;
|
|
//
|
|
// label1
|
|
//
|
|
label1.AutoSize = true;
|
|
label1.BackColor = System.Drawing.Color.Transparent;
|
|
label1.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
label1.Location = new System.Drawing.Point(10, 127);
|
|
label1.Margin = new Padding(0);
|
|
label1.Name = "label1";
|
|
label1.Padding = new Padding(0, 9, 0, 10);
|
|
label1.Size = new System.Drawing.Size(169, 34);
|
|
label1.TabIndex = 196;
|
|
label1.Text = "Close Current Process On Next";
|
|
label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
|
//
|
|
// tHorizontalSeparator3
|
|
//
|
|
tHorizontalSeparator3.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
tHorizontalSeparator3.AutoScrollMargin = new System.Drawing.Size(0, 0);
|
|
tHorizontalSeparator3.AutoScrollMinSize = new System.Drawing.Size(0, 0);
|
|
tHorizontalSeparator3.BackColor = System.Drawing.Color.Transparent;
|
|
tHorizontalSeparator3.Location = new System.Drawing.Point(10, 165);
|
|
tHorizontalSeparator3.Margin = new Padding(0, 10, 0, 0);
|
|
tHorizontalSeparator3.MaximumSize = new System.Drawing.Size(4920, 2);
|
|
tHorizontalSeparator3.MinimumSize = new System.Drawing.Size(0, 22);
|
|
tHorizontalSeparator3.Name = "tHorizontalSeparator3";
|
|
tHorizontalSeparator3.Size = new System.Drawing.Size(364, 22);
|
|
tHorizontalSeparator3.TabIndex = 197;
|
|
tHorizontalSeparator3.TabStop = false;
|
|
//
|
|
// label2
|
|
//
|
|
label2.AutoSize = true;
|
|
label2.BackColor = System.Drawing.Color.Transparent;
|
|
label2.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
label2.Location = new System.Drawing.Point(10, 197);
|
|
label2.Margin = new Padding(0);
|
|
label2.Name = "label2";
|
|
label2.Padding = new Padding(0, 9, 0, 10);
|
|
label2.Size = new System.Drawing.Size(123, 34);
|
|
label2.TabIndex = 198;
|
|
label2.Text = "Next File Shortcut Key";
|
|
label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
|
//
|
|
// OptionsForm
|
|
//
|
|
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
|
AutoScaleMode = AutoScaleMode.Font;
|
|
ClientSize = new System.Drawing.Size(384, 521);
|
|
Controls.Add(label2);
|
|
Controls.Add(tHorizontalSeparator3);
|
|
Controls.Add(label1);
|
|
Controls.Add(pickerBox3);
|
|
Controls.Add(textBox1);
|
|
Controls.Add(pickerBox2);
|
|
Controls.Add(tHorizontalSeparator2);
|
|
Controls.Add(tHorizontalSeparator1);
|
|
Controls.Add(label8);
|
|
Controls.Add(pickerBox1);
|
|
Controls.Add(label6);
|
|
Controls.Add(button1);
|
|
MinimumSize = new System.Drawing.Size(400, 560);
|
|
Name = "OptionsForm";
|
|
ShowIcon = false;
|
|
ShowInTaskbar = false;
|
|
Text = "Options";
|
|
ResumeLayout(false);
|
|
PerformLayout();
|
|
}
|
|
|
|
protected override void OnShown(EventArgs e)
|
|
{
|
|
base.OnShown(e);
|
|
|
|
this.DialogResult = System.Windows.Forms.DialogResult.None;
|
|
|
|
pickerBox1.Value = this.Session.SearchTopDirectoryOnly;
|
|
pickerBox2.Value = this.Session.RetryOnError;
|
|
//pickerBox2.Clear.Clear(0, 20, this.Session.RetryOnError);
|
|
pickerBox3.Value = this.Session.ClosePrevOnNext;
|
|
if (this.Session.NextHotKey != null) textBox1.UpdateKeyCode(this.Session.NextHotKey.IsCtrl, this.Session.NextHotKey.IsAlt, this.Session.NextHotKey.IsShift, this.Session.NextHotKey.KeyCode);
|
|
}
|
|
|
|
|
|
public AppSession Session { get; protected set; }
|
|
|
|
|
|
private void button1_MouseClick(object sender, MouseEventArgs e)
|
|
{
|
|
if (this.Session == null) this.Session = new AppSession();
|
|
|
|
this.Session.SearchTopDirectoryOnly = pickerBox1.Value;
|
|
this.Session.RetryOnError = pickerBox2.Value;
|
|
this.Session.ClosePrevOnNext = pickerBox3.Value;
|
|
this.Session.NextHotKey.IsCtrl = textBox1.KeyCodeResults.IsCtrl;
|
|
this.Session.NextHotKey.IsAlt = textBox1.KeyCodeResults.IsAlt;
|
|
this.Session.NextHotKey.IsShift = textBox1.KeyCodeResults.IsShift;
|
|
this.Session.NextHotKey.Key = textBox1.KeyCodeResults.KeyCode;
|
|
|
|
this.DialogResult = DialogResult.OK;
|
|
this.Close();
|
|
}
|
|
|
|
}
|
|
} |