changeset 169:b7899d084a14

"Re #299: Untranslated strings" fixed the Replaced equipment form to accept new translated strings. Added FrmReplaceUnitEquipment
author snowblizz
date Sun, 25 Jul 2010 17:14:43 +0000
parents 2a8cdd4918eb
children 1925af42100c
files FrmReplaceUnitEquipment.cs
diffstat 1 files changed, 96 insertions(+), 87 deletions(-) [+]
line diff
     1.1 --- a/FrmReplaceUnitEquipment.cs	Sun Jul 25 17:10:40 2010 +0000
     1.2 +++ b/FrmReplaceUnitEquipment.cs	Sun Jul 25 17:14:43 2010 +0000
     1.3 @@ -8,25 +8,30 @@
     1.4  using System.Windows.Forms;
     1.5  using IBBoard;
     1.6  using IBBoard.Commands;
     1.7 +using IBBoard.Lang;
     1.8  using IBBoard.WarFoundry.API;
     1.9  using IBBoard.WarFoundry.API.Commands;
    1.10  using IBBoard.WarFoundry.API.Objects;
    1.11  using IBBoard.WarFoundry.API.Util;
    1.12 +using IBBoard.WarFoundry.GUI.WinForms.UI;
    1.13 +using IBBoard.WarFoundry.GUI.WinForms.Util;
    1.14 +using IBBoard.Windows.Forms;
    1.15 +using IBBoard.Windows.Forms.I18N;
    1.16  
    1.17 -namespace IBBoard.WarFoundry
    1.18 +namespace IBBoard.WarFoundry.GUI.WinForms
    1.19  {
    1.20  	/// <summary>
    1.21  	/// Summary description for FrmNewUnitEquipment.
    1.22  	/// </summary>
    1.23 -	public class FrmReplaceUnitEquipment : System.Windows.Forms.Form
    1.24 +    public class FrmReplaceUnitEquipment : IBBForm
    1.25  	{
    1.26  		private Unit unit;
    1.27  		private UnitEquipmentItem oldItem;
    1.28  		private CommandStack commandStack;
    1.29 -		private System.Windows.Forms.Label lblAmount;
    1.30 -		private System.Windows.Forms.Button bttnCancel;
    1.31 -		private System.Windows.Forms.Button bttnOkay;
    1.32 -		private System.Windows.Forms.Label lblItem;
    1.33 +		private IBBLabel lblAmount;
    1.34 +        private IBBButton bttnCancel;
    1.35 +        private IBBButton bttnOkay;
    1.36 +        private IBBLabel lblItem;
    1.37  		private System.Windows.Forms.ListBox listItems;
    1.38  		private IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl equipmentAmount;
    1.39  		/// <summary>
    1.40 @@ -40,7 +45,8 @@
    1.41  			this.unit = unit;
    1.42  			oldItem = item;
    1.43  			InitializeComponent();
    1.44 -			this.Text = "Replace " + item.EquipmentItem.Name + " with new equipment";
    1.45 +            ControlTranslator.TranslateControl(this);
    1.46 +            this.Text = Translation.GetTranslation("FrmReplaceUnitEquipment", "replace {0} with new equipment", item.EquipmentItem.Name);
    1.47  			object[] items = Arrays.Subtract(unit.UnitType.GetEquipmentItemsByExclusionGroups(item.MutexGroups), unit.GetEquipment());
    1.48  			listItems.Items.AddRange(items);
    1.49  			equipmentAmount.SetUnit(unit);
    1.50 @@ -68,86 +74,89 @@
    1.51  		/// </summary>
    1.52  		private void InitializeComponent()
    1.53  		{
    1.54 -			this.lblAmount = new System.Windows.Forms.Label();
    1.55 -			this.bttnCancel = new System.Windows.Forms.Button();
    1.56 -			this.bttnOkay = new System.Windows.Forms.Button();
    1.57 -			this.lblItem = new System.Windows.Forms.Label();
    1.58 -			this.listItems = new System.Windows.Forms.ListBox();
    1.59 -			this.equipmentAmount = new IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl();
    1.60 -			this.SuspendLayout();
    1.61 -			// 
    1.62 -			// lblAmount
    1.63 -			// 
    1.64 -			this.lblAmount.Location = new System.Drawing.Point(8, 80);
    1.65 -			this.lblAmount.Name = "lblAmount";
    1.66 -			this.lblAmount.Size = new System.Drawing.Size(72, 23);
    1.67 -			this.lblAmount.TabIndex = 2;
    1.68 -			this.lblAmount.Text = "amount";
    1.69 -			this.lblAmount.TextAlign = System.Drawing.ContentAlignment.TopRight;
    1.70 -			// 
    1.71 -			// bttnCancel
    1.72 -			// 
    1.73 -			this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    1.74 -			this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
    1.75 -			this.bttnCancel.Location = new System.Drawing.Point(159, 184);
    1.76 -			this.bttnCancel.Name = "bttnCancel";
    1.77 -			this.bttnCancel.Size = new System.Drawing.Size(75, 23);
    1.78 -			this.bttnCancel.TabIndex = 3;
    1.79 -			this.bttnCancel.Text = "cancel";
    1.80 -			this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
    1.81 -			// 
    1.82 -			// bttnOkay
    1.83 -			// 
    1.84 -			this.bttnOkay.Enabled = false;
    1.85 -			this.bttnOkay.FlatStyle = System.Windows.Forms.FlatStyle.System;
    1.86 -			this.bttnOkay.Location = new System.Drawing.Point(11, 184);
    1.87 -			this.bttnOkay.Name = "bttnOkay";
    1.88 -			this.bttnOkay.Size = new System.Drawing.Size(75, 23);
    1.89 -			this.bttnOkay.TabIndex = 4;
    1.90 -			this.bttnOkay.Text = "okay";
    1.91 -			this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click);
    1.92 -			// 
    1.93 -			// lblItem
    1.94 -			// 
    1.95 -			this.lblItem.Location = new System.Drawing.Point(0, 8);
    1.96 -			this.lblItem.Name = "lblItem";
    1.97 -			this.lblItem.Size = new System.Drawing.Size(80, 23);
    1.98 -			this.lblItem.TabIndex = 6;
    1.99 -			this.lblItem.Text = "item";
   1.100 -			this.lblItem.TextAlign = System.Drawing.ContentAlignment.TopRight;
   1.101 -			// 
   1.102 -			// listItems
   1.103 -			// 
   1.104 -			this.listItems.Location = new System.Drawing.Point(86, 8);
   1.105 -			this.listItems.Name = "listItems";
   1.106 -			this.listItems.Size = new System.Drawing.Size(144, 69);
   1.107 -			this.listItems.TabIndex = 7;
   1.108 -			this.listItems.SelectedIndexChanged += new System.EventHandler(this.listItems_SelectedIndexChanged);
   1.109 -			// 
   1.110 -			// equipmentAmount
   1.111 -			// 
   1.112 -			this.equipmentAmount.Location = new System.Drawing.Point(86, 83);
   1.113 -			this.equipmentAmount.Name = "equipmentAmount";
   1.114 -			this.equipmentAmount.Size = new System.Drawing.Size(155, 77);
   1.115 -			this.equipmentAmount.TabIndex = 8;
   1.116 -			// 
   1.117 -			// FrmReplaceUnitEquipment
   1.118 -			// 
   1.119 -			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   1.120 -			this.ClientSize = new System.Drawing.Size(246, 219);
   1.121 -			this.ControlBox = false;
   1.122 -			this.Controls.Add(this.equipmentAmount);
   1.123 -			this.Controls.Add(this.listItems);
   1.124 -			this.Controls.Add(this.lblItem);
   1.125 -			this.Controls.Add(this.bttnOkay);
   1.126 -			this.Controls.Add(this.bttnCancel);
   1.127 -			this.Controls.Add(this.lblAmount);
   1.128 -			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
   1.129 -			this.Name = "FrmReplaceUnitEquipment";
   1.130 -			this.ShowInTaskbar = false;
   1.131 -			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
   1.132 -			this.Text = "FrmEditUnitEquipment";
   1.133 -			this.ResumeLayout(false);
   1.134 +            this.lblAmount = new IBBoard.Windows.Forms.IBBLabel();
   1.135 +            this.bttnCancel = new IBBoard.Windows.Forms.IBBButton();
   1.136 +            this.bttnOkay = new IBBoard.Windows.Forms.IBBButton();
   1.137 +            this.lblItem = new IBBoard.Windows.Forms.IBBLabel();
   1.138 +            this.listItems = new System.Windows.Forms.ListBox();
   1.139 +            this.equipmentAmount = new IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl();
   1.140 +            this.SuspendLayout();
   1.141 +            // 
   1.142 +            // lblAmount
   1.143 +            // 
   1.144 +            this.lblAmount.Location = new System.Drawing.Point(8, 80);
   1.145 +            this.lblAmount.Name = "lblAmount";
   1.146 +            this.lblAmount.Size = new System.Drawing.Size(72, 23);
   1.147 +            this.lblAmount.TabIndex = 2;
   1.148 +            this.lblAmount.Text = "amount";
   1.149 +            this.lblAmount.TextAlign = System.Drawing.ContentAlignment.TopRight;
   1.150 +            // 
   1.151 +            // bttnCancel
   1.152 +            // 
   1.153 +            this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
   1.154 +            this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
   1.155 +            this.bttnCancel.Location = new System.Drawing.Point(159, 184);
   1.156 +            this.bttnCancel.Name = "bttnCancel";
   1.157 +            this.bttnCancel.Size = new System.Drawing.Size(75, 23);
   1.158 +            this.bttnCancel.TabIndex = 3;
   1.159 +            this.bttnCancel.Text = "cancel";
   1.160 +            this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
   1.161 +            // 
   1.162 +            // bttnOkay
   1.163 +            // 
   1.164 +            this.bttnOkay.DialogResult = System.Windows.Forms.DialogResult.Cancel;
   1.165 +            this.bttnOkay.Enabled = false;
   1.166 +            this.bttnOkay.FlatStyle = System.Windows.Forms.FlatStyle.System;
   1.167 +            this.bttnOkay.Location = new System.Drawing.Point(11, 184);
   1.168 +            this.bttnOkay.Name = "bttnOkay";
   1.169 +            this.bttnOkay.Size = new System.Drawing.Size(75, 23);
   1.170 +            this.bttnOkay.TabIndex = 4;
   1.171 +            this.bttnOkay.Text = "okay";
   1.172 +            this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click);
   1.173 +            // 
   1.174 +            // lblItem
   1.175 +            // 
   1.176 +            this.lblItem.Location = new System.Drawing.Point(0, 8);
   1.177 +            this.lblItem.Name = "lblItem";
   1.178 +            this.lblItem.Size = new System.Drawing.Size(68, 69);
   1.179 +            this.lblItem.TabIndex = 6;
   1.180 +            this.lblItem.Text = "item";
   1.181 +            this.lblItem.TextAlign = System.Drawing.ContentAlignment.TopRight;
   1.182 +            // 
   1.183 +            // listItems
   1.184 +            // 
   1.185 +            this.listItems.Location = new System.Drawing.Point(86, 8);
   1.186 +            this.listItems.Name = "listItems";
   1.187 +            this.listItems.Size = new System.Drawing.Size(144, 69);
   1.188 +            this.listItems.TabIndex = 7;
   1.189 +            this.listItems.SelectedIndexChanged += new System.EventHandler(this.listItems_SelectedIndexChanged);
   1.190 +            // 
   1.191 +            // equipmentAmount
   1.192 +            // 
   1.193 +            this.equipmentAmount.Location = new System.Drawing.Point(86, 83);
   1.194 +            this.equipmentAmount.Name = "equipmentAmount";
   1.195 +            this.equipmentAmount.Size = new System.Drawing.Size(155, 77);
   1.196 +            this.equipmentAmount.TabIndex = 8;
   1.197 +            // 
   1.198 +            // FrmReplaceUnitEquipment
   1.199 +            // 
   1.200 +            this.AcceptButton = this.bttnOkay;
   1.201 +            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   1.202 +            this.CancelButton = this.bttnCancel;
   1.203 +            this.ClientSize = new System.Drawing.Size(246, 219);
   1.204 +            this.ControlBox = false;
   1.205 +            this.Controls.Add(this.equipmentAmount);
   1.206 +            this.Controls.Add(this.listItems);
   1.207 +            this.Controls.Add(this.lblItem);
   1.208 +            this.Controls.Add(this.bttnOkay);
   1.209 +            this.Controls.Add(this.bttnCancel);
   1.210 +            this.Controls.Add(this.lblAmount);
   1.211 +            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
   1.212 +            this.Name = "FrmReplaceUnitEquipment";
   1.213 +            this.ShowInTaskbar = false;
   1.214 +            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
   1.215 +            this.Text = "FrmReplaceUnitEquipment";
   1.216 +            this.ResumeLayout(false);
   1.217  
   1.218  		}
   1.219  		#endregion