Added first part of adding a command to run afterwards

This is the basic first part of #48, only to provide basic functionality that may be useful to people. This is not a common occurance, so will allow people to run a program or powershell script if they need to do something unusual. This at least gives them a mechanism to do so.
This commit is contained in:
Terry MacDonald 2021-11-02 22:40:53 +13:00
parent 634b17c7f2
commit fb482030e2
2 changed files with 70 additions and 0 deletions

View File

@ -126,6 +126,10 @@ namespace DisplayMagician.UIForms
this.cb_autosuggest = new System.Windows.Forms.CheckBox(); this.cb_autosuggest = new System.Windows.Forms.CheckBox();
this.btn_hotkey = new System.Windows.Forms.Button(); this.btn_hotkey = new System.Windows.Forms.Button();
this.lbl_hotkey_assigned = new System.Windows.Forms.Label(); this.lbl_hotkey_assigned = new System.Windows.Forms.Label();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.cb_run_cmd_afterwards = new System.Windows.Forms.CheckBox();
this.btn_run_cmd_afterwards = new System.Windows.Forms.Button();
this.txt_run_cmd_afterwards = new System.Windows.Forms.TextBox();
this.tabc_shortcut.SuspendLayout(); this.tabc_shortcut.SuspendLayout();
this.tabp_display.SuspendLayout(); this.tabp_display.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLogo)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbLogo)).BeginInit();
@ -148,6 +152,7 @@ namespace DisplayMagician.UIForms
this.groupBox2.SuspendLayout(); this.groupBox2.SuspendLayout();
this.groupBox1.SuspendLayout(); this.groupBox1.SuspendLayout();
this.gb_display_after.SuspendLayout(); this.gb_display_after.SuspendLayout();
this.groupBox3.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// btn_save // btn_save
@ -1201,6 +1206,7 @@ namespace DisplayMagician.UIForms
// tabp_after // tabp_after
// //
this.tabp_after.BackColor = System.Drawing.Color.Black; this.tabp_after.BackColor = System.Drawing.Color.Black;
this.tabp_after.Controls.Add(this.groupBox3);
this.tabp_after.Controls.Add(this.groupBox2); this.tabp_after.Controls.Add(this.groupBox2);
this.tabp_after.Controls.Add(this.groupBox1); this.tabp_after.Controls.Add(this.groupBox1);
this.tabp_after.Controls.Add(this.gb_display_after); this.tabp_after.Controls.Add(this.gb_display_after);
@ -1415,6 +1421,50 @@ namespace DisplayMagician.UIForms
this.lbl_hotkey_assigned.Visible = false; this.lbl_hotkey_assigned.Visible = false;
this.lbl_hotkey_assigned.Click += new System.EventHandler(this.lbl_hotkey_assigned_Click); this.lbl_hotkey_assigned.Click += new System.EventHandler(this.lbl_hotkey_assigned_Click);
// //
// groupBox3
//
this.groupBox3.Controls.Add(this.btn_run_cmd_afterwards);
this.groupBox3.Controls.Add(this.txt_run_cmd_afterwards);
this.groupBox3.Controls.Add(this.cb_run_cmd_afterwards);
this.groupBox3.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.groupBox3.ForeColor = System.Drawing.Color.White;
this.groupBox3.Location = new System.Drawing.Point(175, 591);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(765, 110);
this.groupBox3.TabIndex = 14;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Run a program or command afterwards?";
//
// cb_run_cmd_afterwards
//
this.cb_run_cmd_afterwards.AutoSize = true;
this.cb_run_cmd_afterwards.Location = new System.Drawing.Point(98, 45);
this.cb_run_cmd_afterwards.Name = "cb_run_cmd_afterwards";
this.cb_run_cmd_afterwards.Size = new System.Drawing.Size(154, 24);
this.cb_run_cmd_afterwards.TabIndex = 0;
this.cb_run_cmd_afterwards.Text = "Run this program:";
this.cb_run_cmd_afterwards.UseVisualStyleBackColor = true;
this.cb_run_cmd_afterwards.CheckedChanged += new System.EventHandler(this.cb_run_cmd_afterwards_CheckedChanged);
//
// btn_run_cmd_afterwards
//
this.btn_run_cmd_afterwards.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btn_run_cmd_afterwards.ForeColor = System.Drawing.Color.White;
this.btn_run_cmd_afterwards.Location = new System.Drawing.Point(645, 42);
this.btn_run_cmd_afterwards.Name = "btn_run_cmd_afterwards";
this.btn_run_cmd_afterwards.Size = new System.Drawing.Size(85, 27);
this.btn_run_cmd_afterwards.TabIndex = 11;
this.btn_run_cmd_afterwards.Text = "Choose";
this.btn_run_cmd_afterwards.UseVisualStyleBackColor = true;
//
// txt_run_cmd_afterwards
//
this.txt_run_cmd_afterwards.Enabled = false;
this.txt_run_cmd_afterwards.Location = new System.Drawing.Point(250, 43);
this.txt_run_cmd_afterwards.Name = "txt_run_cmd_afterwards";
this.txt_run_cmd_afterwards.Size = new System.Drawing.Size(389, 26);
this.txt_run_cmd_afterwards.TabIndex = 10;
//
// ShortcutForm // ShortcutForm
// //
this.AcceptButton = this.btn_save; this.AcceptButton = this.btn_save;
@ -1476,6 +1526,8 @@ namespace DisplayMagician.UIForms
this.groupBox1.PerformLayout(); this.groupBox1.PerformLayout();
this.gb_display_after.ResumeLayout(false); this.gb_display_after.ResumeLayout(false);
this.gb_display_after.PerformLayout(); this.gb_display_after.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
@ -1576,5 +1628,9 @@ namespace DisplayMagician.UIForms
private System.Windows.Forms.PictureBox pb_exe_icon; private System.Windows.Forms.PictureBox pb_exe_icon;
private System.Windows.Forms.Button btn_choose_game_icon; private System.Windows.Forms.Button btn_choose_game_icon;
private System.Windows.Forms.PictureBox pb_game_icon; private System.Windows.Forms.PictureBox pb_game_icon;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.Button btn_run_cmd_afterwards;
private System.Windows.Forms.TextBox txt_run_cmd_afterwards;
private System.Windows.Forms.CheckBox cb_run_cmd_afterwards;
} }
} }

View File

@ -2613,6 +2613,20 @@ namespace DisplayMagician.UIForms
} }
} }
} }
private void cb_run_cmd_afterwards_CheckedChanged(object sender, EventArgs e)
{
if (cb_run_cmd_afterwards.Checked)
{
txt_run_cmd_afterwards.Enabled = true;
btn_run_cmd_afterwards.Enabled = true;
}
else
{
txt_run_cmd_afterwards.Enabled = false;
btn_run_cmd_afterwards.Enabled = false;
}
}
} }
// Class used to populate combo boxes // Class used to populate combo boxes