diff FrmNewUnitEquipment.cs @ 85:0bb9f40d44eb

Re #88: Complete initial WinForms UI * Add basic initial "about" box * Translations (below) Re #179: Make sure that translations are used throughout UI * Make all controls translatable * Supply translations for all controls Re #204: Use new limits in WinForms UI * Warn the user and cap the number if we try to go out of range for equipment
author IBBoard <dev@ibboard.co.uk>
date Sat, 31 Oct 2009 20:54:42 +0000
parents f2006db02ad9
children c1a3993297b1
line wrap: on
line diff
--- a/FrmNewUnitEquipment.cs	Sat Oct 31 19:32:48 2009 +0000
+++ b/FrmNewUnitEquipment.cs	Sat Oct 31 20:54:42 2009 +0000
@@ -14,20 +14,22 @@
 using IBBoard.WarFoundry.API.Objects;
 using IBBoard.WarFoundry.API.Util;
 using IBBoard.WarFoundry.GUI.WinForms.Util;
+using IBBoard.Windows.Forms;
+using IBBoard.Windows.Forms.I18N;
 
 namespace IBBoard.WarFoundry.GUI.WinForms
 {
 	/// <summary>
 	/// Summary description for FrmNewUnitEquipment.
 	/// </summary>
-	public class FrmNewUnitEquipment : System.Windows.Forms.Form
+	public class FrmNewUnitEquipment : IBBForm
 	{
 		private Unit unit;
 		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;
 		/// <summary>
@@ -40,7 +42,8 @@
 			commandStack = stack;
 			this.unit = unit;
 			InitializeComponent();
-			this.Text = "New equipment for " + unit.Name;
+			ControlTranslator.TranslateControl(this);
+			this.Text = Translation.GetTranslation("FrmNewUnitEquipment", "new equipment for {0}", unit.Name);
 			object[] items = Arrays.Subtract(UnitEquipmentUtil.GetAllowedEquipmentItems(unit), unit.GetEquipment());
 			listItems.Items.AddRange(items);
 			equipmentAmount.SetUnit(unit);
@@ -68,19 +71,19 @@
 		/// </summary>
 		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.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.Location = new System.Drawing.Point(12, 80);
 			this.lblAmount.Name = "lblAmount";
-			this.lblAmount.Size = new System.Drawing.Size(72, 23);
+			this.lblAmount.Size = new System.Drawing.Size(68, 77);
 			this.lblAmount.TabIndex = 2;
 			this.lblAmount.Text = "amount";
 			this.lblAmount.TextAlign = System.Drawing.ContentAlignment.TopRight;
@@ -109,9 +112,9 @@
 			// 
 			// lblItem
 			// 
-			this.lblItem.Location = new System.Drawing.Point(0, 8);
+			this.lblItem.Location = new System.Drawing.Point(12, 8);
 			this.lblItem.Name = "lblItem";
-			this.lblItem.Size = new System.Drawing.Size(80, 23);
+			this.lblItem.Size = new System.Drawing.Size(68, 69);
 			this.lblItem.TabIndex = 6;
 			this.lblItem.Text = "item";
 			this.lblItem.TextAlign = System.Drawing.ContentAlignment.TopRight;