Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
diff FrmNewArmy.cs @ 80:c243b043aa62
Re #179: Make sure that translations are used throughout UI
* Put names back on menu items
* Add some more translation calls
* Make some extra items translatable
* Update English translation file
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 21 Oct 2009 20:11:18 +0000 |
parents | 11e81ba85684 |
children | 1e85a0687e4d |
line wrap: on
line diff
--- a/FrmNewArmy.cs Sun Oct 11 19:57:13 2009 +0000 +++ b/FrmNewArmy.cs Wed Oct 21 20:11:18 2009 +0000 @@ -1,49 +1,49 @@ -// This file (FrmNewArmy.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard. -// -// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. - -using System; -using System.Drawing; -using System.ComponentModel; -using System.Windows.Forms; -using IBBoard; -using IBBoard.Lang; -using IBBoard.Windows.Forms; -using IBBoard.WarFoundry.API; -using IBBoard.WarFoundry.API.Objects; +// This file (FrmNewArmy.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard. +// +// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license. + +using System; +using System.Drawing; +using System.ComponentModel; +using System.Windows.Forms; +using IBBoard; +using IBBoard.Lang; +using IBBoard.Windows.Forms; +using IBBoard.WarFoundry.API; +using IBBoard.WarFoundry.API.Objects; using IBBoard.Windows.Forms.I18N; -namespace IBBoard.WarFoundry.GUI.WinForms -{ - /// <summary> - /// Summary description for FrmNewArmy. - /// </summary> - public class FrmNewArmy : IBBForm - { - /// <summary> - /// Required designer variable. - /// </summary> - private System.ComponentModel.Container components = null; - private IBBoard.Windows.Forms.IBBButton bttnCancel; - private IBBoard.Windows.Forms.IBBLabel lblRaceList; - private IBBoard.Windows.Forms.IBBButton bttnSelectRace; - private System.Windows.Forms.ListBox lstRaces; - private IBBoard.Windows.Forms.IBBLabel lblArmyName; - private IBBoard.Windows.Forms.IBBLabel lblArmySize; +namespace IBBoard.WarFoundry.GUI.WinForms +{ + /// <summary> + /// Summary description for FrmNewArmy. + /// </summary> + public class FrmNewArmy : IBBForm + { + /// <summary> + /// Required designer variable. + /// </summary> + private System.ComponentModel.Container components = null; + private IBBoard.Windows.Forms.IBBButton bttnCancel; + private IBBoard.Windows.Forms.IBBLabel lblRaceList; + private IBBoard.Windows.Forms.IBBButton bttnSelectRace; + private System.Windows.Forms.ListBox lstRaces; + private IBBoard.Windows.Forms.IBBLabel lblArmyName; + private IBBoard.Windows.Forms.IBBLabel lblArmySize; private System.Windows.Forms.NumericUpDown armySize; - private Label lblGameSystem; - private ComboBox gameSystems; + private IBBLabel lblGameSystem; + private ComboBox gameSystems; private System.Windows.Forms.TextBox txtArmyName; private GameSystem system; private Race race; private string armyName; - private int maxPoints; - - public FrmNewArmy(GameSystem system) - { - InitializeComponent(); - + private int maxPoints; + + public FrmNewArmy(GameSystem system) + { + InitializeComponent(); + ControlTranslator.TranslateControl(this); foreach (GameSystem gameSystem in WarFoundryLoader.GetDefault().GetGameSystems()) @@ -54,7 +54,7 @@ if (WarFoundryCore.CurrentGameSystem != null) { gameSystems.SelectedItem = FrmMain.CurrentGameSystem; - } + } } private void SetRaces(GameSystem system) @@ -63,29 +63,29 @@ { lstRaces.Items.Add(race); } - } - - /// <summary> - /// Clean up any resources being used. - /// </summary> - protected override void Dispose( bool disposing ) - { - if( disposing ) - { - if(components != null) - { - components.Dispose(); - } - } - base.Dispose( disposing ); - } - - #region Windows Form Designer generated code - /// <summary> - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// </summary> - private void InitializeComponent() + } + + /// <summary> + /// Clean up any resources being used. + /// </summary> + protected override void Dispose( bool disposing ) + { + if( disposing ) + { + if(components != null) + { + components.Dispose(); + } + } + base.Dispose( disposing ); + } + + #region Windows Form Designer generated code + /// <summary> + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// </summary> + private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmNewArmy)); this.lstRaces = new System.Windows.Forms.ListBox(); @@ -96,7 +96,7 @@ this.txtArmyName = new System.Windows.Forms.TextBox(); this.lblArmySize = new IBBoard.Windows.Forms.IBBLabel(); this.armySize = new System.Windows.Forms.NumericUpDown(); - this.lblGameSystem = new System.Windows.Forms.Label(); + this.lblGameSystem = new IBBoard.Windows.Forms.IBBLabel(); this.gameSystems = new System.Windows.Forms.ComboBox(); ((System.ComponentModel.ISupportInitialize) (this.armySize)).BeginInit(); this.SuspendLayout(); @@ -237,40 +237,40 @@ this.ResumeLayout(false); this.PerformLayout(); - } + } #endregion public GameSystem SelectedSystem { get { return system; } - } - - public Race SelectedRace - { - get { return race; } - } - - public string ArmyName - { - get { return armyName; } - } - - public int ArmySize - { - get { return maxPoints; } - } - - private void bttnCancel_Click(object sender, System.EventArgs e) - { - DialogResult = DialogResult.Cancel; - this.Close(); - } - - private void bttnSelectRace_Click(object sender, System.EventArgs e) - { + } + + public Race SelectedRace + { + get { return race; } + } + + public string ArmyName + { + get { return armyName; } + } + + public int ArmySize + { + get { return maxPoints; } + } + + private void bttnCancel_Click(object sender, System.EventArgs e) + { + DialogResult = DialogResult.Cancel; + this.Close(); + } + + private void bttnSelectRace_Click(object sender, System.EventArgs e) + { DialogResult = DialogResult.OK; - SetValues(); - this.Close(); + SetValues(); + this.Close(); } private void SetValues() @@ -284,21 +284,21 @@ private GameSystem GetSelectedGameSystem() { return (GameSystem) gameSystems.SelectedItem; - } - - private void txtArmyName_TextChanged(object sender, System.EventArgs e) - { - setSelectRaceEnabledVal(); - } - - private void setSelectRaceEnabledVal() - { - bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0); - } - - private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e) - { - setSelectRaceEnabledVal(); + } + + private void txtArmyName_TextChanged(object sender, System.EventArgs e) + { + setSelectRaceEnabledVal(); + } + + private void setSelectRaceEnabledVal() + { + bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0); + } + + private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e) + { + setSelectRaceEnabledVal(); } private void gameSystems_SelectedValueChanged(object sender, EventArgs e) @@ -310,6 +310,6 @@ { SetRaces(selected); } - } - } -} + } + } +}