annotate FrmNewArmy.cs @ 48:cf644b2c65e6 WarFoundry_v0.1beta_Winforms

* Change assembly number to 0.0.1.* because we've not reached 0.1 yet, never mind 1.0! * Add "COPYING" to the copied files so that we have a license no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sun, 13 Sep 2009 19:03:37 +0000
parents 1576f669b3eb
children d6ff354a5d84
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
36
6ab7ddc038f9 Re #121: Move all code to AGPL
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
1 // This file (FrmNewArmy.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard.
24
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
2 //
36
6ab7ddc038f9 Re #121: Move all code to AGPL
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
3 // 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.
24
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
4
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
5 using System;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
6 using System.Drawing;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
7 using System.ComponentModel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
8 using System.Windows.Forms;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
9 using IBBoard;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
10 using IBBoard.Lang;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
11 using IBBoard.Windows.Forms;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
12 using IBBoard.WarFoundry.API;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
13 using IBBoard.WarFoundry.API.Objects;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
14 using IBBoard.Windows.Forms.I18N;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
15
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
16 namespace IBBoard.WarFoundry
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
17 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
18 /// <summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
19 /// Summary description for FrmNewArmy.
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
20 /// </summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
21 public class FrmNewArmy : IBBForm
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
22 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
23 /// <summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
24 /// Required designer variable.
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
25 /// </summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
26 private System.ComponentModel.Container components = null;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
27 private IBBoard.Windows.Forms.IBBButton bttnCancel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
28 private IBBoard.Windows.Forms.IBBLabel lblRaceList;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
29 private IBBoard.Windows.Forms.IBBButton bttnSelectRace;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
30 private System.Windows.Forms.ListBox lstRaces;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
31 private Race[] races;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
32 private IBBoard.Windows.Forms.IBBLabel lblArmyName;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
33 private IBBoard.Windows.Forms.IBBLabel lblArmySize;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
34 private System.Windows.Forms.NumericUpDown armySize;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
35 private System.Windows.Forms.TextBox txtArmyName;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
36
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
37 public FrmNewArmy(GameSystem system)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
38 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
39 InitializeComponent();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
40
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
41 ControlTranslator.TranslateControl(this);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
42
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
43 races = WarFoundryLoader.GetDefault().GetRaces(system);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
44
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
45 for (int i = 0; i<races.Length; i++)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
46 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
47 lstRaces.Items.Add(races[i].Name);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
48 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
49 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
50
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
51 /// <summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
52 /// Clean up any resources being used.
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
53 /// </summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
54 protected override void Dispose( bool disposing )
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
55 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
56 if( disposing )
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
57 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
58 if(components != null)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
59 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
60 components.Dispose();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
61 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
62 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
63 base.Dispose( disposing );
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
64 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
65
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
66 #region Windows Form Designer generated code
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
67 /// <summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
68 /// Required method for Designer support - do not modify
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
69 /// the contents of this method with the code editor.
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
70 /// </summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
71 private void InitializeComponent()
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
72 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
73 System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(FrmNewArmy));
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
74 this.lstRaces = new System.Windows.Forms.ListBox();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
75 this.bttnCancel = new IBBoard.Windows.Forms.IBBButton();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
76 this.lblRaceList = new IBBoard.Windows.Forms.IBBLabel();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
77 this.bttnSelectRace = new IBBoard.Windows.Forms.IBBButton();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
78 this.lblArmyName = new IBBoard.Windows.Forms.IBBLabel();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
79 this.txtArmyName = new System.Windows.Forms.TextBox();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
80 this.lblArmySize = new IBBoard.Windows.Forms.IBBLabel();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
81 this.armySize = new System.Windows.Forms.NumericUpDown();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
82 ((System.ComponentModel.ISupportInitialize)(this.armySize)).BeginInit();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
83 this.SuspendLayout();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
84 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
85 // lstRaces
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
86 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
87 this.lstRaces.Location = new System.Drawing.Point(88, 8);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
88 this.lstRaces.Name = "lstRaces";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
89 this.lstRaces.Size = new System.Drawing.Size(272, 121);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
90 this.lstRaces.TabIndex = 7;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
91 this.lstRaces.SelectedIndexChanged += new System.EventHandler(this.lstRaces_SelectedIndexChanged);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
92 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
93 // bttnCancel
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
94 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
95 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
96 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
97 this.bttnCancel.Location = new System.Drawing.Point(8, 200);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
98 this.bttnCancel.Name = "bttnCancel";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
99 this.bttnCancel.Size = new System.Drawing.Size(80, 24);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
100 this.bttnCancel.TabIndex = 6;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
101 this.bttnCancel.Text = "Cancel";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
102 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
103 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
104 // lblRaceList
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
105 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
106 this.lblRaceList.Location = new System.Drawing.Point(0, 8);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
107 this.lblRaceList.Name = "lblRaceList";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
108 this.lblRaceList.Size = new System.Drawing.Size(88, 80);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
109 this.lblRaceList.TabIndex = 5;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
110 this.lblRaceList.Text = "race list";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
111 this.lblRaceList.TextAlign = System.Drawing.ContentAlignment.TopRight;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
112 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
113 // bttnSelectRace
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
114 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
115 this.bttnSelectRace.Enabled = false;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
116 this.bttnSelectRace.FlatStyle = System.Windows.Forms.FlatStyle.System;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
117 this.bttnSelectRace.Location = new System.Drawing.Point(256, 200);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
118 this.bttnSelectRace.Name = "bttnSelectRace";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
119 this.bttnSelectRace.Size = new System.Drawing.Size(104, 24);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
120 this.bttnSelectRace.TabIndex = 4;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
121 this.bttnSelectRace.Text = "create race";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
122 this.bttnSelectRace.Click += new System.EventHandler(this.bttnSelectRace_Click);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
123 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
124 // lblArmyName
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
125 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
126 this.lblArmyName.Location = new System.Drawing.Point(0, 136);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
127 this.lblArmyName.Name = "lblArmyName";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
128 this.lblArmyName.Size = new System.Drawing.Size(88, 32);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
129 this.lblArmyName.TabIndex = 8;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
130 this.lblArmyName.Text = "army name";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
131 this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
132 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
133 // txtArmyName
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
134 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
135 this.txtArmyName.Location = new System.Drawing.Point(88, 136);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
136 this.txtArmyName.Name = "txtArmyName";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
137 this.txtArmyName.Size = new System.Drawing.Size(272, 20);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
138 this.txtArmyName.TabIndex = 9;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
139 this.txtArmyName.Text = "";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
140 this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
141 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
142 // lblArmySize
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
143 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
144 this.lblArmySize.Location = new System.Drawing.Point(0, 168);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
145 this.lblArmySize.Name = "lblArmySize";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
146 this.lblArmySize.Size = new System.Drawing.Size(88, 32);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
147 this.lblArmySize.TabIndex = 10;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
148 this.lblArmySize.Text = "army size";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
149 this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
150 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
151 // armySize
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
152 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
153 this.armySize.Increment = new System.Decimal(new int[] {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
154 50,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
155 0,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
156 0,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
157 0});
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
158 this.armySize.Location = new System.Drawing.Point(88, 168);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
159 this.armySize.Maximum = new System.Decimal(new int[] {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
160 1000000,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
161 0,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
162 0,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
163 0});
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
164 this.armySize.Name = "armySize";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
165 this.armySize.TabIndex = 11;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
166 this.armySize.ThousandsSeparator = true;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
167 this.armySize.Value = new System.Decimal(new int[] {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
168 2000,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
169 0,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
170 0,
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
171 0});
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
172 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
173 // FrmNewArmy
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
174 //
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
175 this.AcceptButton = this.bttnSelectRace;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
176 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
177 this.CancelButton = this.bttnCancel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
178 this.ClientSize = new System.Drawing.Size(370, 228);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
179 this.Controls.Add(this.armySize);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
180 this.Controls.Add(this.lblArmySize);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
181 this.Controls.Add(this.txtArmyName);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
182 this.Controls.Add(this.lblArmyName);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
183 this.Controls.Add(this.bttnCancel);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
184 this.Controls.Add(this.lblRaceList);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
185 this.Controls.Add(this.bttnSelectRace);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
186 this.Controls.Add(this.lstRaces);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
187 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
188 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
189 this.MaximizeBox = false;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
190 this.MinimizeBox = false;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
191 this.Name = "FrmNewArmy";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
192 this.ShowInTaskbar = false;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
193 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
194 this.Text = "FrmNewArmy";
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
195 ((System.ComponentModel.ISupportInitialize)(this.armySize)).EndInit();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
196 this.ResumeLayout(false);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
197
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
198 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
199 #endregion
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
200
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
201 public Race SelectedRace
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
202 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
203 get { return races[lstRaces.SelectedIndex]; }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
204 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
205
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
206 public string ArmyName
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
207 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
208 get { return txtArmyName.Text; }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
209 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
210
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
211 public int ArmySize
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
212 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
213 get { return (int)armySize.Value; }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
214 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
215
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
216 private void bttnCancel_Click(object sender, System.EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
217 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
218 DialogResult = DialogResult.Cancel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
219 this.Close();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
220 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
221
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
222 private void bttnSelectRace_Click(object sender, System.EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
223 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
224 DialogResult = DialogResult.OK;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
225 this.Close();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
226 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
227
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
228 private void txtArmyName_TextChanged(object sender, System.EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
229 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
230 setSelectRaceEnabledVal();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
231 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
232
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
233 private void setSelectRaceEnabledVal()
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
234 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
235 bttnSelectRace.Enabled = (lstRaces.SelectedIndex>-1 && txtArmyName.Text.Trim()!="" && armySize.Value > 0);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
236 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
237
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
238 private void lstRaces_SelectedIndexChanged(object sender, System.EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
239 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
240 setSelectRaceEnabledVal();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
241 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
242 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
243 }