274 lines
12 KiB
C#
274 lines
12 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using RyzStudio.Windows.Forms;
|
|
|
|
namespace RandomFileRunner
|
|
{
|
|
public class OptionsForm : Form
|
|
{
|
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox1;
|
|
private System.Windows.Forms.Label label6;
|
|
private System.Windows.Forms.Label label8;
|
|
private RyzStudio.Windows.ThemedForms.T4NumericBox pickerBox2;
|
|
private RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox textBox1;
|
|
private RyzStudio.Windows.ThemedForms.T3YnPickerBox pickerBox3;
|
|
private Label label1;
|
|
private Label label2;
|
|
private RyzStudio.Windows.ThemedForms.Composite.DialogFooter dialogFooter1;
|
|
private THorizontalSeparator tHorizontalSeparator1;
|
|
private THorizontalSeparator tHorizontalSeparator2;
|
|
private AppSession _session = null;
|
|
|
|
|
|
public OptionsForm(AppSession session) : base()
|
|
{
|
|
InitializeComponent();
|
|
|
|
this.SetupDialog();
|
|
|
|
_session = session;
|
|
|
|
if (_session != null)
|
|
{
|
|
pickerBox1.Value = _session.SearchTopDirectoryOnly;
|
|
pickerBox2.Value = _session.RetryOnError;
|
|
pickerBox3.Value = _session.ClosePrevOnNext;
|
|
|
|
if (_session.NextHotKey != null)
|
|
{
|
|
textBox1.UpdateKeyCode(_session.NextHotKey.IsCtrl, _session.NextHotKey.IsAlt, _session.NextHotKey.IsShift, _session.NextHotKey.KeyCode);
|
|
}
|
|
}
|
|
}
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results results2 = new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox.Results();
|
|
pickerBox1 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
|
label6 = new Label();
|
|
label8 = new Label();
|
|
pickerBox2 = new RyzStudio.Windows.ThemedForms.T4NumericBox();
|
|
textBox1 = new RyzStudio.Windows.FontForms.TextBox.T4KeyTextBox();
|
|
pickerBox3 = new RyzStudio.Windows.ThemedForms.T3YnPickerBox();
|
|
label1 = new Label();
|
|
label2 = new Label();
|
|
dialogFooter1 = new RyzStudio.Windows.ThemedForms.Composite.DialogFooter();
|
|
tHorizontalSeparator1 = new THorizontalSeparator();
|
|
tHorizontalSeparator2 = new THorizontalSeparator();
|
|
SuspendLayout();
|
|
//
|
|
// pickerBox1
|
|
//
|
|
pickerBox1.Align = RyzStudio.Enums.ContentAlignment.Right;
|
|
pickerBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
pickerBox1.BackColor = System.Drawing.Color.Transparent;
|
|
pickerBox1.EnableMovable = false;
|
|
pickerBox1.EnableStepWidth = true;
|
|
pickerBox1.Location = new System.Drawing.Point(274, 19);
|
|
pickerBox1.Name = "pickerBox1";
|
|
pickerBox1.SelectedIndex = 1;
|
|
pickerBox1.Size = new System.Drawing.Size(100, 32);
|
|
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, 76);
|
|
label6.Margin = new Padding(0);
|
|
label6.Name = "label6";
|
|
label6.Padding = new Padding(0, 8, 0, 0);
|
|
label6.Size = new System.Drawing.Size(81, 23);
|
|
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, 19);
|
|
label8.Margin = new Padding(0);
|
|
label8.Name = "label8";
|
|
label8.Padding = new Padding(0, 8, 0, 0);
|
|
label8.Size = new System.Drawing.Size(143, 23);
|
|
label8.TabIndex = 186;
|
|
label8.Text = "Search Top Directory Only";
|
|
label8.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
|
//
|
|
// pickerBox2
|
|
//
|
|
pickerBox2.Align = RyzStudio.Enums.ContentAlignment.Right;
|
|
pickerBox2.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
pickerBox2.BackColor = System.Drawing.Color.Transparent;
|
|
pickerBox2.EnableMovable = false;
|
|
pickerBox2.EnableStepWidth = true;
|
|
pickerBox2.Location = new System.Drawing.Point(274, 76);
|
|
pickerBox2.Maximum = 50;
|
|
pickerBox2.Minimum = 0;
|
|
pickerBox2.Name = "pickerBox2";
|
|
pickerBox2.Size = new System.Drawing.Size(100, 32);
|
|
pickerBox2.TabIndex = 1;
|
|
pickerBox2.TabStop = false;
|
|
pickerBox2.Value = 0;
|
|
//
|
|
// textBox1
|
|
//
|
|
textBox1.Align = RyzStudio.Enums.ContentAlignment.Right;
|
|
textBox1.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
textBox1.BackColor = System.Drawing.Color.Transparent;
|
|
textBox1.EnableMovable = false;
|
|
textBox1.EnableStepWidth = true;
|
|
textBox1.Icon = "O";
|
|
textBox1.IconSize = 13F;
|
|
results2.IsAlt = false;
|
|
results2.IsCtrl = false;
|
|
results2.IsShift = false;
|
|
results2.Key = Keys.None;
|
|
textBox1.KeyCodeResults = results2;
|
|
textBox1.Location = new System.Drawing.Point(220, 175);
|
|
textBox1.Name = "textBox1";
|
|
textBox1.Size = new System.Drawing.Size(160, 32);
|
|
textBox1.TabIndex = 3;
|
|
textBox1.TabStop = false;
|
|
textBox1.UseSystemPasswordChar = false;
|
|
//
|
|
// pickerBox3
|
|
//
|
|
pickerBox3.Align = RyzStudio.Enums.ContentAlignment.Right;
|
|
pickerBox3.Anchor = AnchorStyles.Top | AnchorStyles.Right;
|
|
pickerBox3.BackColor = System.Drawing.Color.Transparent;
|
|
pickerBox3.EnableMovable = false;
|
|
pickerBox3.EnableStepWidth = true;
|
|
pickerBox3.Location = new System.Drawing.Point(274, 118);
|
|
pickerBox3.Name = "pickerBox3";
|
|
pickerBox3.SelectedIndex = 1;
|
|
pickerBox3.Size = new System.Drawing.Size(100, 32);
|
|
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, 118);
|
|
label1.Margin = new Padding(0);
|
|
label1.Name = "label1";
|
|
label1.Padding = new Padding(0, 8, 0, 0);
|
|
label1.Size = new System.Drawing.Size(169, 23);
|
|
label1.TabIndex = 196;
|
|
label1.Text = "Close Current Process On Next";
|
|
label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
|
//
|
|
// label2
|
|
//
|
|
label2.AutoSize = true;
|
|
label2.BackColor = System.Drawing.Color.Transparent;
|
|
label2.ForeColor = System.Drawing.SystemColors.ControlText;
|
|
label2.Location = new System.Drawing.Point(10, 175);
|
|
label2.Margin = new Padding(0);
|
|
label2.Name = "label2";
|
|
label2.Padding = new Padding(0, 8, 0, 0);
|
|
label2.Size = new System.Drawing.Size(147, 23);
|
|
label2.TabIndex = 198;
|
|
label2.Text = "Run Next File Shortcut Key";
|
|
label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
|
|
//
|
|
// dialogFooter1
|
|
//
|
|
dialogFooter1.Align = RyzStudio.Enums.ContentAlignment.None;
|
|
dialogFooter1.BackColor = System.Drawing.Color.FromArgb(240, 240, 240);
|
|
dialogFooter1.Button1Result = DialogResult.OK;
|
|
dialogFooter1.Button1Text = "&Save";
|
|
dialogFooter1.Button1Visible = true;
|
|
dialogFooter1.Button2Result = DialogResult.Cancel;
|
|
dialogFooter1.Button2Text = "&Cancel";
|
|
dialogFooter1.Button2Visible = true;
|
|
dialogFooter1.Dock = DockStyle.Bottom;
|
|
dialogFooter1.EnableMovable = false;
|
|
dialogFooter1.EnableStepWidth = false;
|
|
dialogFooter1.Location = new System.Drawing.Point(0, 451);
|
|
dialogFooter1.Name = "dialogFooter1";
|
|
dialogFooter1.Size = new System.Drawing.Size(384, 70);
|
|
dialogFooter1.TabIndex = 0;
|
|
dialogFooter1.TabStop = false;
|
|
//
|
|
// tHorizontalSeparator1
|
|
//
|
|
tHorizontalSeparator1.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
tHorizontalSeparator1.AutoPosition = true;
|
|
tHorizontalSeparator1.Location = new System.Drawing.Point(5, 56);
|
|
tHorizontalSeparator1.Name = "tHorizontalSeparator1";
|
|
tHorizontalSeparator1.Size = new System.Drawing.Size(374, 10);
|
|
//
|
|
// tHorizontalSeparator2
|
|
//
|
|
tHorizontalSeparator2.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right;
|
|
tHorizontalSeparator2.AutoPosition = true;
|
|
tHorizontalSeparator2.Location = new System.Drawing.Point(5, 155);
|
|
tHorizontalSeparator2.Name = "tHorizontalSeparator2";
|
|
tHorizontalSeparator2.Size = new System.Drawing.Size(374, 10);
|
|
//
|
|
// OptionsForm
|
|
//
|
|
AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
|
|
AutoScaleMode = AutoScaleMode.Font;
|
|
BackColor = System.Drawing.Color.White;
|
|
ClientSize = new System.Drawing.Size(384, 521);
|
|
Controls.Add(tHorizontalSeparator2);
|
|
Controls.Add(tHorizontalSeparator1);
|
|
Controls.Add(dialogFooter1);
|
|
Controls.Add(label2);
|
|
Controls.Add(label1);
|
|
Controls.Add(pickerBox3);
|
|
Controls.Add(textBox1);
|
|
Controls.Add(pickerBox2);
|
|
Controls.Add(label8);
|
|
Controls.Add(pickerBox1);
|
|
Controls.Add(label6);
|
|
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);
|
|
|
|
pickerBox1.Focus();
|
|
}
|
|
|
|
|
|
public AppSession Result
|
|
{
|
|
get
|
|
{
|
|
if (_session == null)
|
|
{
|
|
_session = new AppSession();
|
|
}
|
|
|
|
_session.SearchTopDirectoryOnly = pickerBox1.Value;
|
|
_session.RetryOnError = pickerBox2.Value;
|
|
_session.ClosePrevOnNext = pickerBox3.Value;
|
|
_session.NextHotKey.IsCtrl = textBox1.KeyCodeResults.IsCtrl;
|
|
_session.NextHotKey.IsAlt = textBox1.KeyCodeResults.IsAlt;
|
|
_session.NextHotKey.IsShift = textBox1.KeyCodeResults.IsShift;
|
|
_session.NextHotKey.Key = textBox1.KeyCodeResults.KeyCode;
|
|
|
|
return _session;
|
|
}
|
|
}
|
|
|
|
}
|
|
} |