Renaming transition sequences enhanced..

This commit is contained in:
Milan Hanajik 2022-09-08 08:14:07 +02:00
parent d2e8f4f0e3
commit 67ba9986f2
3 changed files with 30 additions and 5 deletions

View File

@ -237,7 +237,9 @@ namespace TBF.UI.Bench.Transitions
TabNameDlg dlg = new TabNameDlg(true);
dlg.TabNameLabel = Strings.New_transition_name;
dlg.TabName = (tabPage.Tag is TransitionSequence) ? (tabPage.Tag as TransitionSequence).Name
: (tabPage.Tag is VirtualBenchSequence) ? (tabPage.Tag as VirtualBenchSequence).Name
: string.Empty;
if (dlg.ShowDialog() == DialogResult.OK)
{
bool nameUsed = false;

View File

@ -35,18 +35,20 @@ namespace TBF.UI.Shared
this.okButton = new System.Windows.Forms.Button();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// tabNameTextBox
//
this.tabNameTextBox.Location = new System.Drawing.Point(33, 25);
this.tabNameTextBox.Name = "tabNameTextBox";
this.tabNameTextBox.Size = new System.Drawing.Size(145, 20);
this.tabNameTextBox.Size = new System.Drawing.Size(206, 20);
this.tabNameTextBox.TabIndex = 1;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(209, 18);
this.okButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.okButton.Location = new System.Drawing.Point(267, 20);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(85, 33);
this.okButton.TabIndex = 2;
@ -76,11 +78,24 @@ namespace TBF.UI.Shared
this.radioButton2.Text = "Virtual bench sequence";
this.radioButton2.UseVisualStyleBackColor = true;
//
// cancelButton
//
this.cancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.cancelButton.Location = new System.Drawing.Point(376, 20);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(85, 33);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// TabNameDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(316, 122);
this.ClientSize = new System.Drawing.Size(488, 122);
this.ControlBox = false;
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.radioButton2);
this.Controls.Add(this.radioButton1);
this.Controls.Add(this.okButton);
@ -104,5 +119,6 @@ namespace TBF.UI.Shared
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.Button cancelButton;
}
}

View File

@ -34,7 +34,7 @@ namespace TBF.UI.Shared
{
radioButton1.Visible = false;
radioButton2.Visible = false;
Height -= 50;
Height = 111;
}
}
@ -46,6 +46,7 @@ namespace TBF.UI.Shared
radioButton1.Text = Strings.Transition_sequence;
radioButton2.Text = Strings.Virtual_bench_sequence;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
private void okButton_Click(object sender, EventArgs e)
@ -55,5 +56,11 @@ namespace TBF.UI.Shared
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}