annotate FrmNewArmy.cs @ 9:ffb49ec86df7

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