diff --git a/EduNetworkBuilder/TranslationWindow.Designer.cs b/EduNetworkBuilder/TranslationWindow.Designer.cs index aeec7a0..0a8850b 100644 --- a/EduNetworkBuilder/TranslationWindow.Designer.cs +++ b/EduNetworkBuilder/TranslationWindow.Designer.cs @@ -42,9 +42,8 @@ this.tb1URL = new System.Windows.Forms.TextBox(); this.tb2URL = new System.Windows.Forms.TextBox(); this.tpFormStuff = new System.Windows.Forms.TabPage(); - this.cbFormShowTranslated = new System.Windows.Forms.CheckBox(); - this.cbFormHighPriority = new System.Windows.Forms.CheckBox(); this.panelTranslateFormItems = new System.Windows.Forms.Panel(); + this.cbFormItemTranslated = new System.Windows.Forms.CheckBox(); this.tbFormItem2 = new System.Windows.Forms.TextBox(); this.tbFormItem1 = new System.Windows.Forms.TextBox(); this.lblFormItem = new System.Windows.Forms.Label(); @@ -53,8 +52,9 @@ this.cbFormLang1Choice = new System.Windows.Forms.ComboBox(); this.lblFormDir = new System.Windows.Forms.Label(); this.btnChooseDir = new System.Windows.Forms.Button(); - this.cbFormItemTranslated = new System.Windows.Forms.CheckBox(); this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.cbFormHighPriority = new System.Windows.Forms.CheckBox(); + this.cbFormShowTranslated = new System.Windows.Forms.CheckBox(); this.tcTabPages.SuspendLayout(); this.tpMessageTitle.SuspendLayout(); this.tpFormStuff.SuspendLayout(); @@ -216,28 +216,6 @@ this.tpFormStuff.Text = "Forms"; this.tpFormStuff.UseVisualStyleBackColor = true; // - // cbFormShowTranslated - // - this.cbFormShowTranslated.AutoSize = true; - this.cbFormShowTranslated.Location = new System.Drawing.Point(230, 8); - this.cbFormShowTranslated.Name = "cbFormShowTranslated"; - this.cbFormShowTranslated.Size = new System.Drawing.Size(150, 21); - this.cbFormShowTranslated.TabIndex = 4; - this.cbFormShowTranslated.Text = "Already Translated"; - this.cbFormShowTranslated.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(100, 7); - 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.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -255,6 +233,17 @@ this.panelTranslateFormItems.Size = new System.Drawing.Size(512, 307); this.panelTranslateFormItems.TabIndex = 2; // + // cbFormItemTranslated + // + this.cbFormItemTranslated.AutoSize = true; + this.cbFormItemTranslated.Location = new System.Drawing.Point(221, 178); + this.cbFormItemTranslated.Name = "cbFormItemTranslated"; + this.cbFormItemTranslated.Size = new System.Drawing.Size(98, 21); + this.cbFormItemTranslated.TabIndex = 7; + this.cbFormItemTranslated.Text = "Translated"; + this.cbFormItemTranslated.UseVisualStyleBackColor = true; + this.cbFormItemTranslated.CheckedChanged += new System.EventHandler(this.cbFormItemTranslated_CheckedChanged); + // // tbFormItem2 // this.tbFormItem2.AcceptsReturn = true; @@ -329,16 +318,6 @@ this.btnChooseDir.UseVisualStyleBackColor = true; this.btnChooseDir.Click += new System.EventHandler(this.btnChooseDir_Click); // - // cbFormItemTranslated - // - this.cbFormItemTranslated.AutoSize = true; - this.cbFormItemTranslated.Location = new System.Drawing.Point(221, 178); - this.cbFormItemTranslated.Name = "cbFormItemTranslated"; - this.cbFormItemTranslated.Size = new System.Drawing.Size(98, 21); - this.cbFormItemTranslated.TabIndex = 7; - this.cbFormItemTranslated.Text = "Translated"; - this.cbFormItemTranslated.UseVisualStyleBackColor = true; - // // groupBox1 // this.groupBox1.Controls.Add(this.cbFormHighPriority); @@ -350,6 +329,28 @@ this.groupBox1.TabStop = false; this.groupBox1.Text = "Show"; // + // cbFormHighPriority + // + this.cbFormHighPriority.AutoSize = true; + this.cbFormHighPriority.Checked = true; + this.cbFormHighPriority.CheckState = System.Windows.Forms.CheckState.Checked; + this.cbFormHighPriority.Location = new System.Drawing.Point(100, 7); + 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; + // + // cbFormShowTranslated + // + this.cbFormShowTranslated.AutoSize = true; + this.cbFormShowTranslated.Location = new System.Drawing.Point(230, 8); + this.cbFormShowTranslated.Name = "cbFormShowTranslated"; + this.cbFormShowTranslated.Size = new System.Drawing.Size(150, 21); + this.cbFormShowTranslated.TabIndex = 4; + this.cbFormShowTranslated.Text = "Already Translated"; + this.cbFormShowTranslated.UseVisualStyleBackColor = true; + // // TranslationWindow // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); diff --git a/EduNetworkBuilder/TranslationWindow.cs b/EduNetworkBuilder/TranslationWindow.cs index 558d17c..20274b5 100644 --- a/EduNetworkBuilder/TranslationWindow.cs +++ b/EduNetworkBuilder/TranslationWindow.cs @@ -368,7 +368,15 @@ namespace EduNetworkBuilder return null; } - private void btnChooseDir_Click(object sender, EventArgs e) + private TranslationItem GetEditedTranslationItem() + { + string code = CodeFromLang(cbFormLang1Choice.Text); + TranslationResxFile TRf = FileFromLangCode(code); + TranslationItem TI = ItemFromKey(TRf, cbFormItemChoice.Text); + return TI; + } + + private void btnChooseDir_Click(object sender, EventArgs e) { string startingDir = FormChosenDir; if (FormChosenDir == "" && File.Exists(myNet.NetworkFilename)) @@ -402,9 +410,20 @@ namespace EduNetworkBuilder if (TRf != null && TI != null) { tbFormItem2.Text = TI.Value; + cbFormItemTranslated.Checked = TI.translated; } } + + private void cbFormItemTranslated_CheckedChanged(object sender, EventArgs e) + { + TranslationItem TI = GetEditedTranslationItem(); + if(TI != null) + { + TI.translated = cbFormItemTranslated.Checked; + ChangedFormData = true; + } + } } #region TranslationClasses