# HG changeset patch # User snowblizz # Date 1280078083 0 # Node ID b7899d084a14f6f11bec57ff94dba9b905bfa27e # Parent 2a8cdd4918ebb523c53bf3831195f53fbc775c5d "Re #299: Untranslated strings" fixed the Replaced equipment form to accept new translated strings. Added FrmReplaceUnitEquipment diff -r 2a8cdd4918eb -r b7899d084a14 FrmReplaceUnitEquipment.cs --- a/FrmReplaceUnitEquipment.cs Sun Jul 25 17:10:40 2010 +0000 +++ b/FrmReplaceUnitEquipment.cs Sun Jul 25 17:14:43 2010 +0000 @@ -8,25 +8,30 @@ using System.Windows.Forms; using IBBoard; using IBBoard.Commands; +using IBBoard.Lang; using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Commands; using IBBoard.WarFoundry.API.Objects; using IBBoard.WarFoundry.API.Util; +using IBBoard.WarFoundry.GUI.WinForms.UI; +using IBBoard.WarFoundry.GUI.WinForms.Util; +using IBBoard.Windows.Forms; +using IBBoard.Windows.Forms.I18N; -namespace IBBoard.WarFoundry +namespace IBBoard.WarFoundry.GUI.WinForms { /// /// Summary description for FrmNewUnitEquipment. /// - public class FrmReplaceUnitEquipment : System.Windows.Forms.Form + public class FrmReplaceUnitEquipment : IBBForm { private Unit unit; private UnitEquipmentItem oldItem; private CommandStack commandStack; - private System.Windows.Forms.Label lblAmount; - private System.Windows.Forms.Button bttnCancel; - private System.Windows.Forms.Button bttnOkay; - private System.Windows.Forms.Label lblItem; + private IBBLabel lblAmount; + private IBBButton bttnCancel; + private IBBButton bttnOkay; + private IBBLabel lblItem; private System.Windows.Forms.ListBox listItems; private IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl equipmentAmount; /// @@ -40,7 +45,8 @@ this.unit = unit; oldItem = item; InitializeComponent(); - this.Text = "Replace " + item.EquipmentItem.Name + " with new equipment"; + ControlTranslator.TranslateControl(this); + this.Text = Translation.GetTranslation("FrmReplaceUnitEquipment", "replace {0} with new equipment", item.EquipmentItem.Name); object[] items = Arrays.Subtract(unit.UnitType.GetEquipmentItemsByExclusionGroups(item.MutexGroups), unit.GetEquipment()); listItems.Items.AddRange(items); equipmentAmount.SetUnit(unit); @@ -68,86 +74,89 @@ /// private void InitializeComponent() { - this.lblAmount = new System.Windows.Forms.Label(); - this.bttnCancel = new System.Windows.Forms.Button(); - this.bttnOkay = new System.Windows.Forms.Button(); - this.lblItem = new System.Windows.Forms.Label(); - this.listItems = new System.Windows.Forms.ListBox(); - this.equipmentAmount = new IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl(); - this.SuspendLayout(); - // - // lblAmount - // - this.lblAmount.Location = new System.Drawing.Point(8, 80); - this.lblAmount.Name = "lblAmount"; - this.lblAmount.Size = new System.Drawing.Size(72, 23); - this.lblAmount.TabIndex = 2; - this.lblAmount.Text = "amount"; - this.lblAmount.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // bttnCancel - // - this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; - this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.bttnCancel.Location = new System.Drawing.Point(159, 184); - this.bttnCancel.Name = "bttnCancel"; - this.bttnCancel.Size = new System.Drawing.Size(75, 23); - this.bttnCancel.TabIndex = 3; - this.bttnCancel.Text = "cancel"; - this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); - // - // bttnOkay - // - this.bttnOkay.Enabled = false; - this.bttnOkay.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.bttnOkay.Location = new System.Drawing.Point(11, 184); - this.bttnOkay.Name = "bttnOkay"; - this.bttnOkay.Size = new System.Drawing.Size(75, 23); - this.bttnOkay.TabIndex = 4; - this.bttnOkay.Text = "okay"; - this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click); - // - // lblItem - // - this.lblItem.Location = new System.Drawing.Point(0, 8); - this.lblItem.Name = "lblItem"; - this.lblItem.Size = new System.Drawing.Size(80, 23); - this.lblItem.TabIndex = 6; - this.lblItem.Text = "item"; - this.lblItem.TextAlign = System.Drawing.ContentAlignment.TopRight; - // - // listItems - // - this.listItems.Location = new System.Drawing.Point(86, 8); - this.listItems.Name = "listItems"; - this.listItems.Size = new System.Drawing.Size(144, 69); - this.listItems.TabIndex = 7; - this.listItems.SelectedIndexChanged += new System.EventHandler(this.listItems_SelectedIndexChanged); - // - // equipmentAmount - // - this.equipmentAmount.Location = new System.Drawing.Point(86, 83); - this.equipmentAmount.Name = "equipmentAmount"; - this.equipmentAmount.Size = new System.Drawing.Size(155, 77); - this.equipmentAmount.TabIndex = 8; - // - // FrmReplaceUnitEquipment - // - this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); - this.ClientSize = new System.Drawing.Size(246, 219); - this.ControlBox = false; - this.Controls.Add(this.equipmentAmount); - this.Controls.Add(this.listItems); - this.Controls.Add(this.lblItem); - this.Controls.Add(this.bttnOkay); - this.Controls.Add(this.bttnCancel); - this.Controls.Add(this.lblAmount); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; - this.Name = "FrmReplaceUnitEquipment"; - this.ShowInTaskbar = false; - this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "FrmEditUnitEquipment"; - this.ResumeLayout(false); + this.lblAmount = new IBBoard.Windows.Forms.IBBLabel(); + this.bttnCancel = new IBBoard.Windows.Forms.IBBButton(); + this.bttnOkay = new IBBoard.Windows.Forms.IBBButton(); + this.lblItem = new IBBoard.Windows.Forms.IBBLabel(); + this.listItems = new System.Windows.Forms.ListBox(); + this.equipmentAmount = new IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl(); + this.SuspendLayout(); + // + // lblAmount + // + this.lblAmount.Location = new System.Drawing.Point(8, 80); + this.lblAmount.Name = "lblAmount"; + this.lblAmount.Size = new System.Drawing.Size(72, 23); + this.lblAmount.TabIndex = 2; + this.lblAmount.Text = "amount"; + this.lblAmount.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // bttnCancel + // + this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.bttnCancel.Location = new System.Drawing.Point(159, 184); + this.bttnCancel.Name = "bttnCancel"; + this.bttnCancel.Size = new System.Drawing.Size(75, 23); + this.bttnCancel.TabIndex = 3; + this.bttnCancel.Text = "cancel"; + this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); + // + // bttnOkay + // + this.bttnOkay.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.bttnOkay.Enabled = false; + this.bttnOkay.FlatStyle = System.Windows.Forms.FlatStyle.System; + this.bttnOkay.Location = new System.Drawing.Point(11, 184); + this.bttnOkay.Name = "bttnOkay"; + this.bttnOkay.Size = new System.Drawing.Size(75, 23); + this.bttnOkay.TabIndex = 4; + this.bttnOkay.Text = "okay"; + this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click); + // + // lblItem + // + this.lblItem.Location = new System.Drawing.Point(0, 8); + this.lblItem.Name = "lblItem"; + this.lblItem.Size = new System.Drawing.Size(68, 69); + this.lblItem.TabIndex = 6; + this.lblItem.Text = "item"; + this.lblItem.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // listItems + // + this.listItems.Location = new System.Drawing.Point(86, 8); + this.listItems.Name = "listItems"; + this.listItems.Size = new System.Drawing.Size(144, 69); + this.listItems.TabIndex = 7; + this.listItems.SelectedIndexChanged += new System.EventHandler(this.listItems_SelectedIndexChanged); + // + // equipmentAmount + // + this.equipmentAmount.Location = new System.Drawing.Point(86, 83); + this.equipmentAmount.Name = "equipmentAmount"; + this.equipmentAmount.Size = new System.Drawing.Size(155, 77); + this.equipmentAmount.TabIndex = 8; + // + // FrmReplaceUnitEquipment + // + this.AcceptButton = this.bttnOkay; + this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); + this.CancelButton = this.bttnCancel; + this.ClientSize = new System.Drawing.Size(246, 219); + this.ControlBox = false; + this.Controls.Add(this.equipmentAmount); + this.Controls.Add(this.listItems); + this.Controls.Add(this.lblItem); + this.Controls.Add(this.bttnOkay); + this.Controls.Add(this.bttnCancel); + this.Controls.Add(this.lblAmount); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.Name = "FrmReplaceUnitEquipment"; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "FrmReplaceUnitEquipment"; + this.ResumeLayout(false); } #endregion