Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
diff FrmUnit.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 | 1e85a0687e4d |
children | e4a8653b9536 |
line wrap: on
line diff
--- a/FrmUnit.cs Sat Oct 31 19:32:48 2009 +0000 +++ b/FrmUnit.cs Sat Oct 31 20:54:42 2009 +0000 @@ -11,6 +11,7 @@ using IBBoard.Commands; using IBBoard.Lang; using IBBoard.Windows.Forms; +using IBBoard.Windows.Forms.I18N; using IBBoard.WarFoundry.API; using IBBoard.WarFoundry.API.Commands; using IBBoard.WarFoundry.API.Objects; @@ -30,13 +31,13 @@ private System.Windows.Forms.DataGrid statsGrid; private System.Windows.Forms.TextBox tbUnitName; private System.Windows.Forms.NumericUpDown unitSize; - private System.Windows.Forms.Label lblUnitSize; - private System.Windows.Forms.Button bttnAddWeapon; - private System.Windows.Forms.Button bttnRemoveWeapon; - private System.Windows.Forms.Label lblEquip; + private IBBLabel lblUnitSize; + private IBBButton bttnAddWeapon; + private IBBButton bttnRemoveWeapon; + private IBBLabel lblEquip; private System.Windows.Forms.ListBox equipmentList; - private System.Windows.Forms.Button bttnReplaceWeapon; - private System.Windows.Forms.Button bttnEditWeapon; + private IBBButton bttnReplaceWeapon; + private IBBButton bttnEditWeapon; private Label lblPoints; /// <summary> /// Required designer variable. @@ -51,9 +52,8 @@ // Required for Windows Form Designer support // InitializeComponent(); - - tbUnitName.Text = unit.Name; - Text = unit.Name; + ControlTranslator.TranslateControl(this); + Text = Translation.GetTranslation("FrmUnit", "{0}", unit.Name); unit.NameChanged += new StringValChangedDelegate(unit_NameChanged); unit.UnitSizeChanged += new IntValChangedDelegate(unit_UnitSizeChanged); unit.UnitEquipmentAmountChanged += new DoubleValChangedDelegate(unit_UnitEquipmentAmountChanged); @@ -181,13 +181,13 @@ this.statsGrid = new System.Windows.Forms.DataGrid(); this.tbUnitName = new System.Windows.Forms.TextBox(); this.unitSize = new System.Windows.Forms.NumericUpDown(); - this.lblUnitSize = new System.Windows.Forms.Label(); - this.lblEquip = new System.Windows.Forms.Label(); - this.bttnAddWeapon = new System.Windows.Forms.Button(); - this.bttnRemoveWeapon = new System.Windows.Forms.Button(); + this.lblUnitSize = new IBBLabel(); + this.lblEquip = new IBBLabel(); + this.bttnAddWeapon = new IBBButton(); + this.bttnRemoveWeapon = new IBBButton(); this.equipmentList = new System.Windows.Forms.ListBox(); - this.bttnReplaceWeapon = new System.Windows.Forms.Button(); - this.bttnEditWeapon = new System.Windows.Forms.Button(); + this.bttnReplaceWeapon = new IBBButton(); + this.bttnEditWeapon = new IBBButton(); this.lblPoints = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize) (this.statsGrid)).BeginInit(); ((System.ComponentModel.ISupportInitialize) (this.unitSize)).BeginInit();