update when changes made

This commit is contained in:
Tim Young 2017-10-31 18:27:36 -05:00
parent 308857a0d8
commit 3a04f81dde
2 changed files with 69 additions and 37 deletions

View File

@ -42,8 +42,10 @@
this.tb1URL = new System.Windows.Forms.TextBox();
this.tb2URL = new System.Windows.Forms.TextBox();
this.tpFormStuff = new System.Windows.Forms.TabPage();
this.cbFormSkipDone = new System.Windows.Forms.CheckBox();
this.cbFormHighPriority = new System.Windows.Forms.CheckBox();
this.panelTranslateFormItems = new System.Windows.Forms.Panel();
this.textBox1 = new System.Windows.Forms.TextBox();
this.tbFormItem2 = new System.Windows.Forms.TextBox();
this.tbFormItem1 = new System.Windows.Forms.TextBox();
this.lblFormItem = new System.Windows.Forms.Label();
this.cbFormItemChoice = new System.Windows.Forms.ComboBox();
@ -51,8 +53,6 @@
this.cbFormLang1Choice = new System.Windows.Forms.ComboBox();
this.lblFormDir = new System.Windows.Forms.Label();
this.btnChooseDir = new System.Windows.Forms.Button();
this.cbFormHighPriority = new System.Windows.Forms.CheckBox();
this.cbFormSkipDone = new System.Windows.Forms.CheckBox();
this.tcTabPages.SuspendLayout();
this.tpMessageTitle.SuspendLayout();
this.tpFormStuff.SuspendLayout();
@ -214,9 +214,33 @@
this.tpFormStuff.Text = "Forms";
this.tpFormStuff.UseVisualStyleBackColor = true;
//
// cbFormSkipDone
//
this.cbFormSkipDone.AutoSize = true;
this.cbFormSkipDone.Checked = true;
this.cbFormSkipDone.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbFormSkipDone.Location = new System.Drawing.Point(141, 49);
this.cbFormSkipDone.Name = "cbFormSkipDone";
this.cbFormSkipDone.Size = new System.Drawing.Size(95, 21);
this.cbFormSkipDone.TabIndex = 4;
this.cbFormSkipDone.Text = "Skip Done";
this.cbFormSkipDone.UseVisualStyleBackColor = true;
//
// cbFormHighPriority
//
this.cbFormHighPriority.AutoSize = true;
this.cbFormHighPriority.Checked = true;
this.cbFormHighPriority.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbFormHighPriority.Location = new System.Drawing.Point(28, 49);
this.cbFormHighPriority.Name = "cbFormHighPriority";
this.cbFormHighPriority.Size = new System.Drawing.Size(107, 21);
this.cbFormHighPriority.TabIndex = 3;
this.cbFormHighPriority.Text = "High Priority";
this.cbFormHighPriority.UseVisualStyleBackColor = true;
//
// panelTranslateFormItems
//
this.panelTranslateFormItems.Controls.Add(this.textBox1);
this.panelTranslateFormItems.Controls.Add(this.tbFormItem2);
this.panelTranslateFormItems.Controls.Add(this.tbFormItem1);
this.panelTranslateFormItems.Controls.Add(this.lblFormItem);
this.panelTranslateFormItems.Controls.Add(this.cbFormItemChoice);
@ -227,16 +251,16 @@
this.panelTranslateFormItems.Size = new System.Drawing.Size(434, 338);
this.panelTranslateFormItems.TabIndex = 2;
//
// textBox1
// tbFormItem2
//
this.textBox1.AcceptsReturn = true;
this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
this.tbFormItem2.AcceptsReturn = true;
this.tbFormItem2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.textBox1.Location = new System.Drawing.Point(28, 257);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(384, 72);
this.textBox1.TabIndex = 6;
this.tbFormItem2.Location = new System.Drawing.Point(28, 257);
this.tbFormItem2.Multiline = true;
this.tbFormItem2.Name = "tbFormItem2";
this.tbFormItem2.Size = new System.Drawing.Size(384, 72);
this.tbFormItem2.TabIndex = 6;
//
// tbFormItem1
//
@ -265,6 +289,7 @@
this.cbFormItemChoice.Name = "cbFormItemChoice";
this.cbFormItemChoice.Size = new System.Drawing.Size(306, 24);
this.cbFormItemChoice.TabIndex = 3;
this.cbFormItemChoice.SelectedIndexChanged += new System.EventHandler(this.cbFormItemChoice_SelectedIndexChanged);
//
// cbFormLang2Choice
//
@ -301,30 +326,6 @@
this.btnChooseDir.UseVisualStyleBackColor = true;
this.btnChooseDir.Click += new System.EventHandler(this.btnChooseDir_Click);
//
// cbFormHighPriority
//
this.cbFormHighPriority.AutoSize = true;
this.cbFormHighPriority.Checked = true;
this.cbFormHighPriority.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbFormHighPriority.Location = new System.Drawing.Point(28, 49);
this.cbFormHighPriority.Name = "cbFormHighPriority";
this.cbFormHighPriority.Size = new System.Drawing.Size(107, 21);
this.cbFormHighPriority.TabIndex = 3;
this.cbFormHighPriority.Text = "High Priority";
this.cbFormHighPriority.UseVisualStyleBackColor = true;
//
// cbFormSkipDone
//
this.cbFormSkipDone.AutoSize = true;
this.cbFormSkipDone.Checked = true;
this.cbFormSkipDone.CheckState = System.Windows.Forms.CheckState.Checked;
this.cbFormSkipDone.Location = new System.Drawing.Point(141, 49);
this.cbFormSkipDone.Name = "cbFormSkipDone";
this.cbFormSkipDone.Size = new System.Drawing.Size(95, 21);
this.cbFormSkipDone.TabIndex = 4;
this.cbFormSkipDone.Text = "Skip Done";
this.cbFormSkipDone.UseVisualStyleBackColor = true;
//
// TranslationWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
@ -367,7 +368,7 @@
private System.Windows.Forms.TextBox tb1URL;
private System.Windows.Forms.TextBox tb2URL;
private System.Windows.Forms.Panel panelTranslateFormItems;
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.TextBox tbFormItem2;
private System.Windows.Forms.TextBox tbFormItem1;
private System.Windows.Forms.Label lblFormItem;
private System.Windows.Forms.ComboBox cbFormItemChoice;

View File

@ -357,6 +357,17 @@ namespace EduNetworkBuilder
return null;
}
private TranslationItem ItemFromKey(TranslationResxFile File, string Key)
{
if (File == null) return null;
foreach(TranslationItem TI in File.Items)
{
if (TI.Key == Key)
return TI;
}
return null;
}
private void btnChooseDir_Click(object sender, EventArgs e)
{
string startingDir = FormChosenDir;
@ -374,6 +385,26 @@ namespace EduNetworkBuilder
}
}
}
private void cbFormItemChoice_SelectedIndexChanged(object sender, EventArgs e)
{
string code = CodeFromLang(cbFormLang1Choice.Text);
TranslationResxFile TRf = FileFromLangCode(code);
TranslationItem TI = ItemFromKey(TRf, cbFormItemChoice.Text);
if(TRf != null && TI != null)
{
tbFormItem1.Text = TI.Value;
}
code = CodeFromLang(cbFormLang2Choice.Text);
TRf = FileFromLangCode(code);
TI = ItemFromKey(TRf, cbFormItemChoice.Text);
if (TRf != null && TI != null)
{
tbFormItem2.Text = TI.Value;
}
}
}
#region TranslationClasses