Mercurial > repos > IBBoard.WarFoundry.GUI.WinForms
comparison FrmNewArmy.cs @ 100:88b5a0da73f2
Re #88: Complete initial WinForms UI
* Auto-select game system if there is only one to reduce user clicks
* Auto-select first race to reduce user clicks (especially when they only have one race)
author | IBBoard <dev@ibboard.co.uk> |
---|---|
date | Sat, 21 Nov 2009 20:17:10 +0000 |
parents | 1e85a0687e4d |
children | 3fae39208d06 |
comparison
equal
deleted
inserted
replaced
99:acaea18ac0a1 | 100:88b5a0da73f2 |
---|---|
52 } | 52 } |
53 | 53 |
54 if (WarFoundryCore.CurrentGameSystem != null) | 54 if (WarFoundryCore.CurrentGameSystem != null) |
55 { | 55 { |
56 gameSystems.SelectedItem = FrmMain.CurrentGameSystem; | 56 gameSystems.SelectedItem = FrmMain.CurrentGameSystem; |
57 } | |
58 else if (gameSystems.Items.Count == 1) | |
59 { | |
60 gameSystems.SelectedIndex = 0; | |
57 } | 61 } |
58 } | 62 } |
59 | 63 |
60 private void SetRaces(GameSystem system) | 64 private void SetRaces(GameSystem system) |
61 { | 65 { |
307 lstRaces.Items.Clear(); | 311 lstRaces.Items.Clear(); |
308 | 312 |
309 if (selected != null) | 313 if (selected != null) |
310 { | 314 { |
311 SetRaces(selected); | 315 SetRaces(selected); |
316 | |
317 if (lstRaces.Items.Count > 0) | |
318 { | |
319 lstRaces.SelectedIndex = 0; | |
320 } | |
312 } | 321 } |
313 } | 322 } |
314 } | 323 } |
315 } | 324 } |