Mercurial > repos > IBDev-IBBoard.WarFoundry.GUI.WinForms
comparison FrmNewArmy.cs @ 176:0e39412353c4
Fixes #153: Default name for armies
* Merge back in to Trunk
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Wed, 08 Sep 2010 20:17:48 +0000 |
parents | 0e17097db8e5 |
children | 3a561c3751f5 d084446348f5 |
comparison
equal
deleted
inserted
replaced
175:3d08fe8e65d5 | 176:0e39412353c4 |
---|---|
113 this.gameSystems = new System.Windows.Forms.ComboBox(); | 113 this.gameSystems = new System.Windows.Forms.ComboBox(); |
114 this.lblGameSystem = new IBBoard.Windows.Forms.IBBLabel(); | 114 this.lblGameSystem = new IBBoard.Windows.Forms.IBBLabel(); |
115 this.gameSystemToolTip = new System.Windows.Forms.ToolTip(this.components); | 115 this.gameSystemToolTip = new System.Windows.Forms.ToolTip(this.components); |
116 ((System.ComponentModel.ISupportInitialize)(this.armySize)).BeginInit(); | 116 ((System.ComponentModel.ISupportInitialize)(this.armySize)).BeginInit(); |
117 this.SuspendLayout(); | 117 this.SuspendLayout(); |
118 // | 118 // |
119 // lstRaces | 119 // lstRaces |
120 // | 120 // |
121 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) |
122 | System.Windows.Forms.AnchorStyles.Right))); | 122 | System.Windows.Forms.AnchorStyles.Right))); |
123 this.lstRaces.DisplayMember = "Name"; | 123 this.lstRaces.DisplayMember = "Name"; |
124 this.lstRaces.Enabled = false; | 124 this.lstRaces.Enabled = false; |
125 this.lstRaces.Location = new System.Drawing.Point(141, 33); | 125 this.lstRaces.Location = new System.Drawing.Point(141, 33); |
126 this.lstRaces.Name = "lstRaces"; | 126 this.lstRaces.Name = "lstRaces"; |
127 this.lstRaces.Size = new System.Drawing.Size(265, 121); | 127 this.lstRaces.Size = new System.Drawing.Size(265, 121); |
128 this.lstRaces.TabIndex = 7; | 128 this.lstRaces.TabIndex = 7; |
129 this.lstRaces.SelectedIndexChanged += new System.EventHandler(this.lstRaces_SelectedIndexChanged); | 129 this.lstRaces.SelectedIndexChanged += new System.EventHandler(this.lstRaces_SelectedIndexChanged); |
130 // | 130 // |
131 // bttnCancel | 131 // bttnCancel |
132 // | 132 // |
133 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; | 133 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; |
134 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; | 134 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; |
135 this.bttnCancel.Location = new System.Drawing.Point(12, 231); | 135 this.bttnCancel.Location = new System.Drawing.Point(12, 231); |
136 this.bttnCancel.Name = "bttnCancel"; | 136 this.bttnCancel.Name = "bttnCancel"; |
137 this.bttnCancel.Size = new System.Drawing.Size(80, 24); | 137 this.bttnCancel.Size = new System.Drawing.Size(80, 24); |
138 this.bttnCancel.TabIndex = 6; | 138 this.bttnCancel.TabIndex = 6; |
139 this.bttnCancel.Text = "cancel"; | 139 this.bttnCancel.Text = "cancel"; |
140 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); | 140 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click); |
141 // | 141 // |
142 // lblRaceList | 142 // lblRaceList |
143 // | 143 // |
144 this.lblRaceList.Location = new System.Drawing.Point(12, 33); | 144 this.lblRaceList.Location = new System.Drawing.Point(12, 33); |
145 this.lblRaceList.Name = "lblRaceList"; | 145 this.lblRaceList.Name = "lblRaceList"; |
146 this.lblRaceList.Size = new System.Drawing.Size(123, 80); | 146 this.lblRaceList.Size = new System.Drawing.Size(123, 80); |
147 this.lblRaceList.TabIndex = 5; | 147 this.lblRaceList.TabIndex = 5; |
148 this.lblRaceList.Text = "race list"; | 148 this.lblRaceList.Text = "race list"; |
149 this.lblRaceList.TextAlign = System.Drawing.ContentAlignment.TopRight; | 149 this.lblRaceList.TextAlign = System.Drawing.ContentAlignment.TopRight; |
150 // | 150 // |
151 // bttnSelectRace | 151 // bttnSelectRace |
152 // | 152 // |
153 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) |
154 | System.Windows.Forms.AnchorStyles.Right))); | 154 | System.Windows.Forms.AnchorStyles.Right))); |
155 this.bttnSelectRace.Enabled = false; | 155 this.bttnSelectRace.Enabled = false; |
156 this.bttnSelectRace.FlatStyle = System.Windows.Forms.FlatStyle.System; | 156 this.bttnSelectRace.FlatStyle = System.Windows.Forms.FlatStyle.System; |
157 this.bttnSelectRace.Location = new System.Drawing.Point(254, 231); | 157 this.bttnSelectRace.Location = new System.Drawing.Point(254, 231); |
158 this.bttnSelectRace.Name = "bttnSelectRace"; | 158 this.bttnSelectRace.Name = "bttnSelectRace"; |
159 this.bttnSelectRace.Size = new System.Drawing.Size(152, 24); | 159 this.bttnSelectRace.Size = new System.Drawing.Size(152, 24); |
160 this.bttnSelectRace.TabIndex = 4; | 160 this.bttnSelectRace.TabIndex = 4; |
161 this.bttnSelectRace.Text = "create army"; | 161 this.bttnSelectRace.Text = "create army"; |
162 this.bttnSelectRace.Click += new System.EventHandler(this.bttnSelectRace_Click); | 162 this.bttnSelectRace.Click += new System.EventHandler(this.bttnSelectRace_Click); |
163 // | 163 // |
164 // lblArmyName | 164 // lblArmyName |
165 // | 165 // |
166 this.lblArmyName.Location = new System.Drawing.Point(12, 163); | 166 this.lblArmyName.Location = new System.Drawing.Point(12, 163); |
167 this.lblArmyName.Name = "lblArmyName"; | 167 this.lblArmyName.Name = "lblArmyName"; |
168 this.lblArmyName.Size = new System.Drawing.Size(123, 17); | 168 this.lblArmyName.Size = new System.Drawing.Size(123, 17); |
169 this.lblArmyName.TabIndex = 8; | 169 this.lblArmyName.TabIndex = 8; |
170 this.lblArmyName.Text = "army name"; | 170 this.lblArmyName.Text = "army name"; |
171 this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight; | 171 this.lblArmyName.TextAlign = System.Drawing.ContentAlignment.TopRight; |
172 // | 172 // |
173 // txtArmyName | 173 // txtArmyName |
174 // | 174 // |
175 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) |
176 | System.Windows.Forms.AnchorStyles.Right))); | 176 | System.Windows.Forms.AnchorStyles.Right))); |
177 this.txtArmyName.Enabled = false; | 177 this.txtArmyName.Enabled = false; |
178 this.txtArmyName.Location = new System.Drawing.Point(141, 160); | 178 this.txtArmyName.Location = new System.Drawing.Point(141, 160); |
179 this.txtArmyName.Name = "txtArmyName"; | 179 this.txtArmyName.Name = "txtArmyName"; |
180 this.txtArmyName.Size = new System.Drawing.Size(265, 20); | 180 this.txtArmyName.Size = new System.Drawing.Size(265, 20); |
181 this.txtArmyName.TabIndex = 9; | 181 this.txtArmyName.TabIndex = 9; |
182 this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged); | 182 this.txtArmyName.TextChanged += new System.EventHandler(this.txtArmyName_TextChanged); |
183 // | 183 // |
184 // lblArmySize | 184 // lblArmySize |
185 // | 185 // |
186 this.lblArmySize.Location = new System.Drawing.Point(12, 188); | 186 this.lblArmySize.Location = new System.Drawing.Point(12, 188); |
187 this.lblArmySize.Name = "lblArmySize"; | 187 this.lblArmySize.Name = "lblArmySize"; |
188 this.lblArmySize.Size = new System.Drawing.Size(123, 18); | 188 this.lblArmySize.Size = new System.Drawing.Size(123, 18); |
189 this.lblArmySize.TabIndex = 10; | 189 this.lblArmySize.TabIndex = 10; |
190 this.lblArmySize.Text = "army size"; | 190 this.lblArmySize.Text = "army size"; |
191 this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight; | 191 this.lblArmySize.TextAlign = System.Drawing.ContentAlignment.TopRight; |
192 // | 192 // |
193 // armySize | 193 // armySize |
194 // | 194 // |
195 this.armySize.Enabled = false; | 195 this.armySize.Enabled = false; |
196 this.armySize.Increment = new decimal(new int[] { | 196 this.armySize.Increment = new decimal(new int[] { |
197 50, | 197 50, |
198 0, | 198 0, |
199 0, | 199 0, |
211 this.armySize.Value = new decimal(new int[] { | 211 this.armySize.Value = new decimal(new int[] { |
212 2000, | 212 2000, |
213 0, | 213 0, |
214 0, | 214 0, |
215 0}); | 215 0}); |
216 // | 216 // |
217 // gameSystems | 217 // gameSystems |
218 // | 218 // |
219 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) |
220 | System.Windows.Forms.AnchorStyles.Right))); | 220 | System.Windows.Forms.AnchorStyles.Right))); |
221 this.gameSystems.DisplayMember = "Name"; | 221 this.gameSystems.DisplayMember = "Name"; |
222 this.gameSystems.FormattingEnabled = true; | 222 this.gameSystems.FormattingEnabled = true; |
223 this.gameSystems.Location = new System.Drawing.Point(141, 6); | 223 this.gameSystems.Location = new System.Drawing.Point(141, 6); |
224 this.gameSystems.Name = "gameSystems"; | 224 this.gameSystems.Name = "gameSystems"; |
225 this.gameSystems.Size = new System.Drawing.Size(265, 21); | 225 this.gameSystems.Size = new System.Drawing.Size(265, 21); |
226 this.gameSystems.TabIndex = 13; | 226 this.gameSystems.TabIndex = 13; |
227 this.gameSystems.SelectedValueChanged += new System.EventHandler(this.gameSystems_SelectedValueChanged); | 227 this.gameSystems.SelectedValueChanged += new System.EventHandler(this.gameSystems_SelectedValueChanged); |
228 // | 228 // |
229 // lblGameSystem | 229 // lblGameSystem |
230 // | 230 // |
231 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; |
232 this.lblGameSystem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; | 232 this.lblGameSystem.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft; |
233 this.lblGameSystem.Location = new System.Drawing.Point(12, 9); | 233 this.lblGameSystem.Location = new System.Drawing.Point(12, 9); |
234 this.lblGameSystem.Name = "lblGameSystem"; | 234 this.lblGameSystem.Name = "lblGameSystem"; |
235 this.lblGameSystem.Size = new System.Drawing.Size(123, 18); | 235 this.lblGameSystem.Size = new System.Drawing.Size(123, 18); |
236 this.lblGameSystem.TabIndex = 12; | 236 this.lblGameSystem.TabIndex = 12; |
237 this.lblGameSystem.Text = "game system"; | 237 this.lblGameSystem.Text = "game system"; |
238 this.lblGameSystem.TextAlign = System.Drawing.ContentAlignment.TopRight; | 238 this.lblGameSystem.TextAlign = System.Drawing.ContentAlignment.TopRight; |
239 // | 239 // |
240 // FrmNewArmy | 240 // FrmNewArmy |
241 // | 241 // |
242 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); | 242 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); |
243 this.ClientSize = new System.Drawing.Size(418, 267); | 243 this.ClientSize = new System.Drawing.Size(418, 267); |
244 this.Controls.Add(this.gameSystems); | 244 this.Controls.Add(this.gameSystems); |
245 this.Controls.Add(this.lblGameSystem); | 245 this.Controls.Add(this.lblGameSystem); |
246 this.Controls.Add(this.armySize); | 246 this.Controls.Add(this.armySize); |
326 { | 326 { |
327 setSelectRaceEnabledVal(); | 327 setSelectRaceEnabledVal(); |
328 bool raceSelected = lstRaces.SelectedItem != null; | 328 bool raceSelected = lstRaces.SelectedItem != null; |
329 txtArmyName.Enabled = raceSelected; | 329 txtArmyName.Enabled = raceSelected; |
330 armySize.Enabled = raceSelected; | 330 armySize.Enabled = raceSelected; |
331 race = (Race)lstRaces.SelectedItem; | |
332 txtArmyName.Text = String.Format(race.ArmyDefaultName, Translation.GetTranslation("armySizePts", "{0}pt", armySize.Value)); | |
331 } | 333 } |
332 | 334 |
333 private void gameSystems_SelectedValueChanged(object sender, EventArgs e) | 335 private void gameSystems_SelectedValueChanged(object sender, EventArgs e) |
334 { | 336 { |
335 GameSystem selected = GetSelectedGameSystem(); | 337 GameSystem selected = GetSelectedGameSystem(); |