Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
comparison FrmNewArmy.cs @ 203:b4e428dcfcb6 default-army-name
Re #153: Default name for armies
* Have a fight between VS.Net versions over how to reference projects (may need to update from 2K3 but still target .Net 2)
* Use property of race object and clean up comments
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Tue, 07 Sep 2010 20:03:52 +0000 |
parents | 6faadbbb7900 |
children | 9d17b4674f6e |
comparison
equal
deleted
inserted
replaced
202:6faadbbb7900 | 203:b4e428dcfcb6 |
---|---|
30 private System.Windows.Forms.NumericUpDown armySize; | 30 private System.Windows.Forms.NumericUpDown armySize; |
31 private IBBLabel lblGameSystem; | 31 private IBBLabel lblGameSystem; |
32 private ComboBox gameSystems; | 32 private ComboBox gameSystems; |
33 private System.Windows.Forms.TextBox txtArmyName; | 33 private System.Windows.Forms.TextBox txtArmyName; |
34 | 34 |
35 private string defaultArmyName; | |
36 private GameSystem system; | 35 private GameSystem system; |
37 private Race race; | 36 private Race race; |
38 private string armyName; | 37 private string armyName; |
39 private ToolTip gameSystemToolTip; | 38 private ToolTip gameSystemToolTip; |
40 private int maxPoints; | 39 private int maxPoints; |
114 this.gameSystems = new System.Windows.Forms.ComboBox(); | 113 this.gameSystems = new System.Windows.Forms.ComboBox(); |
115 this.lblGameSystem = new IBBoard.Windows.Forms.IBBLabel(); | 114 this.lblGameSystem = new IBBoard.Windows.Forms.IBBLabel(); |
116 this.gameSystemToolTip = new System.Windows.Forms.ToolTip(this.components); | 115 this.gameSystemToolTip = new System.Windows.Forms.ToolTip(this.components); |
117 ((System.ComponentModel.ISupportInitialize)(this.armySize)).BeginInit(); | 116 ((System.ComponentModel.ISupportInitialize)(this.armySize)).BeginInit(); |
118 this.SuspendLayout(); | 117 this.SuspendLayout(); |
119 // | 118 // |
120 // lstRaces | 119 // lstRaces |
121 // | 120 // |
122 this.lstRaces.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | 121 this.lstRaces.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
123 | System.Windows.Forms.AnchorStyles.Right))); | 122 | System.Windows.Forms.AnchorStyles.Right))); |
124 this.lstRaces.DisplayMember = "Name"; | 123 this.lstRaces.DisplayMember = "Name"; |
125 this.lstRaces.Enabled = false; | 124 this.lstRaces.Enabled = false; |
126 this.lstRaces.Location = new System.Drawing.Point(141, 33); | 125 this.lstRaces.Location = new System.Drawing.Point(141, 33); |
127 this.lstRaces.Name = "lstRaces"; | 126 this.lstRaces.Name = "lstRaces"; |
128 this.lstRaces.Size = new System.Drawing.Size(265, 121); | 127 this.lstRaces.Size = new System.Drawing.Size(265, 121); |
129 this.lstRaces.TabIndex = 7; | 128 this.lstRaces.TabIndex = 7; |
130 this.lstRaces.SelectedIndexChanged += new System.EventHandler(this.lstRaces_SelectedIndexChanged); | 129 this.lstRaces.SelectedIndexChanged += new System.EventHandler(this.lstRaces_SelectedIndexChanged); |
131 // | 130 // |
132 // bttnCancel | 131 // bttnCancel |
133 // | 132 // |
134 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; | 133 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
135 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; | 134 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; |
136 this.bttnCancel.Location = new System.Drawing.Point(12, 231); | 135 this.bttnCancel.Location = new System.Drawing.Point(12, 231); |
137 this.bttnCancel.Name = "bttnCancel"; | 136 this.bttnCancel.Name = "bttnCancel"; |
138 this.bttnCancel.Size = new System.Drawing.Size(80, 24); | 137 this.bttnCancel.Size = new System.Drawing.Size(80, 24); |
139 this.bttnCancel.TabIndex = 6; | 138 this.bttnCancel.TabIndex = 6; |
140 this.bttnCancel.Text = "cancel"; | 139 this.bttnCancel.Text = "cancel"; |
141 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); | 140 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); |
142 // | 141 // |
143 // lblRaceList | 142 // lblRaceList |
144 // | 143 // |
145 this.lblRaceList.Location = new System.Drawing.Point(12, 33); | 144 this.lblRaceList.Location = new System.Drawing.Point(12, 33); |
146 this.lblRaceList.Name = "lblRaceList"; | 145 this.lblRaceList.Name = "lblRaceList"; |
147 this.lblRaceList.Size = new System.Drawing.Size(123, 80); | 146 this.lblRaceList.Size = new System.Drawing.Size(123, 80); |
148 this.lblRaceList.TabIndex = 5; | 147 this.lblRaceList.TabIndex = 5; |
149 this.lblRaceList.Text = "race list"; | 148 this.lblRaceList.Text = "race list"; |
150 this.lblRaceList.TextAlign = System.Drawing.ContentAlignment.TopRight; | 149 this.lblRaceList.TextAlign = System.Drawing.ContentAlignment.TopRight; |
151 // | 150 // |
152 // bttnSelectRace | 151 // bttnSelectRace |
153 // | 152 // |
154 this.bttnSelectRace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | 153 this.bttnSelectRace.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
155 | System.Windows.Forms.AnchorStyles.Right))); | 154 | System.Windows.Forms.AnchorStyles.Right))); |
156 this.bttnSelectRace.Enabled = false; | 155 this.bttnSelectRace.Enabled = false; |
157 this.bttnSelectRace.FlatStyle = System.Windows.Forms.FlatStyle.System; | 156 this.bttnSelectRace.FlatStyle = System.Windows.Forms.FlatStyle.System; |
158 this.bttnSelectRace.Location = new System.Drawing.Point(254, 231); | 157 this.bttnSelectRace.Location = new System.Drawing.Point(254, 231); |
159 this.bttnSelectRace.Name = "bttnSelectRace"; | 158 this.bttnSelectRace.Name = "bttnSelectRace"; |
160 this.bttnSelectRace.Size = new System.Drawing.Size(152, 24); | 159 this.bttnSelectRace.Size = new System.Drawing.Size(152, 24); |
161 this.bttnSelectRace.TabIndex = 4; | 160 this.bttnSelectRace.TabIndex = 4; |
162 this.bttnSelectRace.Text = "create army"; | 161 this.bttnSelectRace.Text = "create army"; |
163 this.bttnSelectRace.Click += new System.EventHandler(this.bttnSelectRace_Click); | 162 this.bttnSelectRace.Click += new System.EventHandler(this.bttnSelectRace_Click); |
164 // | 163 // |
165 // lblArmyName | 164 // lblArmyName |
166 // | 165 // |
167 this.lblArmyName.Location = new System.Drawing.Point(12, 163); | 166 this.lblArmyName.Location = new System.Drawing.Point(12, 163); |
168 this.lblArmyName.Name = "lblArmyName"; | 167 this.lblArmyName.Name = "lblArmyName"; |
169 this.lblArmyName.Size = new System.Drawing.Size(123, 17); | 168 this.lblArmyName.Size = new System.Drawing.Size(123, 17); |
170 this.lblArmyName.TabIndex = 8; | 169 this.lblArmyName.TabIndex = 8; |
171 this.lblArmyName.Text = "army name"; | 170 this.lblArmyName.Text = "army name"; |
172 this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight; | 171 this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight; |
173 // | 172 // |
174 // txtArmyName | 173 // txtArmyName |
175 // | 174 // |
176 this.txtArmyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | 175 this.txtArmyName.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
177 | System.Windows.Forms.AnchorStyles.Right))); | 176 | System.Windows.Forms.AnchorStyles.Right))); |
178 this.txtArmyName.Enabled = false; | 177 this.txtArmyName.Enabled = false; |
179 this.txtArmyName.Location = new System.Drawing.Point(141, 160); | 178 this.txtArmyName.Location = new System.Drawing.Point(141, 160); |
180 this.txtArmyName.Name = "txtArmyName"; | 179 this.txtArmyName.Name = "txtArmyName"; |
181 this.txtArmyName.Size = new System.Drawing.Size(265, 20); | 180 this.txtArmyName.Size = new System.Drawing.Size(265, 20); |
182 this.txtArmyName.TabIndex = 9; | 181 this.txtArmyName.TabIndex = 9; |
183 this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged); | 182 this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged); |
184 // | 183 // |
185 // lblArmySize | 184 // lblArmySize |
186 // | 185 // |
187 this.lblArmySize.Location = new System.Drawing.Point(12, 188); | 186 this.lblArmySize.Location = new System.Drawing.Point(12, 188); |
188 this.lblArmySize.Name = "lblArmySize"; | 187 this.lblArmySize.Name = "lblArmySize"; |
189 this.lblArmySize.Size = new System.Drawing.Size(123, 18); | 188 this.lblArmySize.Size = new System.Drawing.Size(123, 18); |
190 this.lblArmySize.TabIndex = 10; | 189 this.lblArmySize.TabIndex = 10; |
191 this.lblArmySize.Text = "army size"; | 190 this.lblArmySize.Text = "army size"; |
192 this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight; | 191 this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight; |
193 // | 192 // |
194 // armySize | 193 // armySize |
195 // | 194 // |
196 this.armySize.Enabled = false; | 195 this.armySize.Enabled = false; |
197 this.armySize.Increment = new decimal(new int[] { | 196 this.armySize.Increment = new decimal(new int[] { |
198 50, | 197 50, |
199 0, | 198 0, |
200 0, | 199 0, |
212 this.armySize.Value = new decimal(new int[] { | 211 this.armySize.Value = new decimal(new int[] { |
213 2000, | 212 2000, |
214 0, | 213 0, |
215 0, | 214 0, |
216 0}); | 215 0}); |
217 // | 216 // |
218 // gameSystems | 217 // gameSystems |
219 // | 218 // |
220 this.gameSystems.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | 219 this.gameSystems.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) |
221 | System.Windows.Forms.AnchorStyles.Right))); | 220 | System.Windows.Forms.AnchorStyles.Right))); |
222 this.gameSystems.DisplayMember = "Name"; | 221 this.gameSystems.DisplayMember = "Name"; |
223 this.gameSystems.FormattingEnabled = true; | 222 this.gameSystems.FormattingEnabled = true; |
224 this.gameSystems.Location = new System.Drawing.Point(141, 6); | 223 this.gameSystems.Location = new System.Drawing.Point(141, 6); |
225 this.gameSystems.Name = "gameSystems"; | 224 this.gameSystems.Name = "gameSystems"; |
226 this.gameSystems.Size = new System.Drawing.Size(265, 21); | 225 this.gameSystems.Size = new System.Drawing.Size(265, 21); |
227 this.gameSystems.TabIndex = 13; | 226 this.gameSystems.TabIndex = 13; |
228 this.gameSystems.SelectedValueChanged += new System.EventHandler(this.gameSystems_SelectedValueChanged); | 227 this.gameSystems.SelectedValueChanged += new System.EventHandler(this.gameSystems_SelectedValueChanged); |
229 // | 228 // |
230 // lblGameSystem | 229 // lblGameSystem |
231 // | 230 // |
232 this.lblGameSystem.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.warning_sml; | 231 this.lblGameSystem.Image = global::IBBoard.WarFoundry.GUI.WinForms.Properties.Resources.warning_sml; |
233 this.lblGameSystem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; | 232 this.lblGameSystem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; |
234 this.lblGameSystem.Location = new System.Drawing.Point(12, 9); | 233 this.lblGameSystem.Location = new System.Drawing.Point(12, 9); |
235 this.lblGameSystem.Name = "lblGameSystem"; | 234 this.lblGameSystem.Name = "lblGameSystem"; |
236 this.lblGameSystem.Size = new System.Drawing.Size(123, 18); | 235 this.lblGameSystem.Size = new System.Drawing.Size(123, 18); |
237 this.lblGameSystem.TabIndex = 12; | 236 this.lblGameSystem.TabIndex = 12; |
238 this.lblGameSystem.Text = "game system"; | 237 this.lblGameSystem.Text = "game system"; |
239 this.lblGameSystem.TextAlign = System.Drawing.ContentAlignment.TopRight; | 238 this.lblGameSystem.TextAlign = System.Drawing.ContentAlignment.TopRight; |
240 // | 239 // |
241 // FrmNewArmy | 240 // FrmNewArmy |
242 // | 241 // |
243 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); | 242 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); |
244 this.ClientSize = new System.Drawing.Size(418, 267); | 243 this.ClientSize = new System.Drawing.Size(418, 267); |
245 this.Controls.Add(this.gameSystems); | 244 this.Controls.Add(this.gameSystems); |
246 this.Controls.Add(this.lblGameSystem); | 245 this.Controls.Add(this.lblGameSystem); |
247 this.Controls.Add(this.armySize); | 246 this.Controls.Add(this.armySize); |
327 { | 326 { |
328 setSelectRaceEnabledVal(); | 327 setSelectRaceEnabledVal(); |
329 bool raceSelected = lstRaces.SelectedItem != null; | 328 bool raceSelected = lstRaces.SelectedItem != null; |
330 txtArmyName.Enabled = raceSelected; | 329 txtArmyName.Enabled = raceSelected; |
331 armySize.Enabled = raceSelected; | 330 armySize.Enabled = raceSelected; |
332 race = (Race)lstRaces.SelectedItem; | 331 race = (Race)lstRaces.SelectedItem; |
333 //defaultArmyName = (string)WarFoundryLoader.GetDefault().GetRace(GetSelectedGameSystem(), race.ID).ArmyDefaultName; | 332 txtArmyName.Text = race.ArmyDefaultName; |
334 //System.Diagnostics.Debug.WriteLine(race.ArmyDefaultName +":FrmNewArmy"); | |
335 //defaultArmyName = (string) SelectedRace.Name; | |
336 //defaultArmyName = (string) race.Name; | |
337 txtArmyName.Text = race.Name + ArmySize ;//ArmyDefaultName; | |
338 } | 333 } |
339 | 334 |
340 private void gameSystems_SelectedValueChanged(object sender, EventArgs e) | 335 private void gameSystems_SelectedValueChanged(object sender, EventArgs e) |
341 { | 336 { |
342 GameSystem selected = GetSelectedGameSystem(); | 337 GameSystem selected = GetSelectedGameSystem(); |