annotate FrmUnit.cs @ 37:c07d3b982129

Re #121: Move all code to AGPL * Add Affero license file and remove old LGPL stuff
author IBBoard <dev@ibboard.co.uk>
date Sat, 15 Aug 2009 10:15:43 +0000
parents 6ab7ddc038f9
children 740350673006
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: 34
diff changeset
1 // This file (FrmUnit.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard.
27
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
2 //
36
6ab7ddc038f9 Re #121: Move all code to AGPL
IBBoard <dev@ibboard.co.uk>
parents: 34
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.
27
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
4
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
5 using System;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
6 using System.Drawing;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
7 using System.Data;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
8 using System.Collections.Generic;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
9 using System.ComponentModel;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
10 using System.Windows.Forms;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
11 using IBBoard.Commands;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
12 using IBBoard.Lang;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
13 using IBBoard.Windows.Forms;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
14 using IBBoard.WarFoundry.API;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
15 using IBBoard.WarFoundry.API.Commands;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
16 using IBBoard.WarFoundry.API.Objects;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
17 using IBBoard.WarFoundry.WinForms.UI;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
18 using IBBoard.WarFoundry.GUI.WinForms.Util;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
19
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
20 namespace IBBoard.WarFoundry.WinForms
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
21 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
22 /// <summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
23 /// Summary description for FrmUnit.
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
24 /// </summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
25 public class FrmUnit : IBBoard.Windows.Forms.IBBForm
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
26 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
27 private Unit unit;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
28 private Dictionary<UnitEquipmentItem, UnitEquipmentChoice> equipmentChoices = new Dictionary<UnitEquipmentItem, UnitEquipmentChoice>();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
29 private CommandStack commandStack;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
30 private System.Windows.Forms.DataGrid statsGrid;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
31 private System.Windows.Forms.TextBox tbUnitName;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
32 private System.Windows.Forms.NumericUpDown unitSize;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
33 private System.Windows.Forms.Label lblUnitSize;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
34 private System.Windows.Forms.Button bttnAddWeapon;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
35 private System.Windows.Forms.Button bttnRemoveWeapon;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
36 private System.Windows.Forms.Button bttnEditWeapon;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
37 private System.Windows.Forms.Label lblRequiredEquip;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
38 private System.Windows.Forms.ListBox reqdList;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
39 private System.Windows.Forms.ListBox optList;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
40 private System.Windows.Forms.Label lblOptionalEquip;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
41 private System.Windows.Forms.Button bttnReplaceWeapon;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
42 private System.Windows.Forms.Button bttnEditReqdWeapon;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
43 /// <summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
44 /// Required designer variable.
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
45 /// </summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
46 private System.ComponentModel.Container components = null;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
47
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
48 public FrmUnit(Unit toDisplay, CommandStack cmdStack)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
49 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
50 unit = toDisplay;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
51 commandStack = cmdStack;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
52 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
53 // Required for Windows Form Designer support
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
54 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
55 InitializeComponent();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
56
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
57 tbUnitName.Text = unit.Name;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
58 Text = unit.Name;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
59 unit.NameChanged += new StringValChangedDelegate(unit_NameChanged);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
60 unit.UnitSizeChanged += new IntValChangedDelegate(unit_UnitSizeChanged);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
61 unit.UnitEquipmentAmountChanged += new DoubleValChangedDelegate(unit_UnitEquipmentAmountChanged);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
62
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
63 if (unit.UnitType.MaxSize == unit.UnitType.MinSize)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
64 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
65 unitSize.Value = unit.UnitType.MaxSize;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
66 unitSize.Visible = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
67 lblUnitSize.Visible = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
68 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
69 else
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
70 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
71 unitSize.Value = unit.Size;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
72 unitSize.Maximum = (unit.UnitType.MaxSize == WarFoundryCore.INFINITY ? int.MaxValue : unit.UnitType.MaxSize);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
73 unitSize.Minimum = unit.UnitType.MinSize;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
74 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
75
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
76 SetStats();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
77 SetWeapons();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
78 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
79
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
80 private void SetStats()
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
81 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
82 DataTable dt = new DataTable();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
83 Stat[] stats = unit.UnitStatsArrayWithName;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
84 int statsCount = stats.Length;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
85 DataColumn[] dc = new DataColumn[statsCount];
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
86
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
87 DataGridTableStyle dgStyle = new DataGridTableStyle();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
88 dgStyle.RowHeadersVisible = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
89
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
90 Stat stat = stats[0];
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
91 DataColumn tempCol = new DataColumn(stat.ParentSlotName);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
92 tempCol.DataType = stat.GetType();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
93
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
94 for (int i = 0; i < statsCount; i++)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
95 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
96 stat = stats[i];
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
97 tempCol = new DataColumn(stat.ParentSlotName);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
98 tempCol.DataType = stat.GetType();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
99 dc[i] = tempCol;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
100 DataGridColumnStyle colStyle = new StatColumnStyle();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
101 colStyle.Width = 40;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
102 colStyle.MappingName = stat.ParentSlotName;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
103 colStyle.HeaderText = stat.ParentSlotName;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
104 colStyle.Alignment = HorizontalAlignment.Center;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
105 colStyle.ReadOnly = true;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
106 dgStyle.GridColumnStyles.Add(colStyle);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
107 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
108
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
109 DataGridColumnStyle nameColStyle = dgStyle.GridColumnStyles[0];
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
110 nameColStyle.HeaderText = Translation.GetTranslation("UnitName", "Name");
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
111 nameColStyle.Alignment = HorizontalAlignment.Left;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
112 nameColStyle.Width = statsGrid.ClientSize.Width - ((stats.Length - 1) * 40) - 4;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
113
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
114 dt.Columns.AddRange(dc);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
115
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
116 DataRow dr = dt.NewRow();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
117 dr.ItemArray = stats;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
118 dt.Rows.Add(dr);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
119 statsGrid.DataSource = dt;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
120 statsGrid.TableStyles.Add(dgStyle);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
121 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
122
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
123 private void SetWeapons()
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
124 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
125 foreach (UnitEquipmentItem item in unit.GetEquipment())
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
126 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
127 if (item.IsRequired)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
128 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
129 reqdList.Items.Add(GetEquipmentChoice(item));
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
130 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
131 else
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
132 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
133 optList.Items.Add(GetEquipmentChoice(item));
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
134 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
135 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
136 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
137
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
138 private UnitEquipmentChoice GetEquipmentChoice(UnitEquipmentItem item)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
139 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
140 UnitEquipmentChoice choice = null;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
141 equipmentChoices.TryGetValue(item, out choice);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
142
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
143 if (choice == null)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
144 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
145 choice = new UnitEquipmentChoice(Unit, item);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
146 equipmentChoices[item] = choice;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
147 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
148
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
149 return choice;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
150 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
151
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
152 /// <summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
153 /// Clean up any resources being used.
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
154 /// </summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
155 protected override void Dispose(bool disposing)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
156 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
157 //remove our leave events so that disposing doesn't trigger them
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
158 tbUnitName.Leave -= new System.EventHandler(this.tbUnitName_Leave);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
159 unitSize.Leave -= new System.EventHandler(this.unitSize_Leave);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
160
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
161 if (disposing)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
162 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
163 if (components != null)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
164 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
165 components.Dispose();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
166 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
167 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
168 base.Dispose(disposing);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
169 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
170
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
171 #region Windows Form Designer generated code
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
172 /// <summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
173 /// Required method for Designer support - do not modify
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
174 /// the contents of this method with the code editor.
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
175 /// </summary>
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
176 private void InitializeComponent()
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
177 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
178 this.statsGrid = new System.Windows.Forms.DataGrid();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
179 this.tbUnitName = new System.Windows.Forms.TextBox();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
180 this.unitSize = new System.Windows.Forms.NumericUpDown();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
181 this.lblUnitSize = new System.Windows.Forms.Label();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
182 this.lblRequiredEquip = new System.Windows.Forms.Label();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
183 this.bttnAddWeapon = new System.Windows.Forms.Button();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
184 this.bttnRemoveWeapon = new System.Windows.Forms.Button();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
185 this.reqdList = new System.Windows.Forms.ListBox();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
186 this.bttnEditWeapon = new System.Windows.Forms.Button();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
187 this.optList = new System.Windows.Forms.ListBox();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
188 this.lblOptionalEquip = new System.Windows.Forms.Label();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
189 this.bttnReplaceWeapon = new System.Windows.Forms.Button();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
190 this.bttnEditReqdWeapon = new System.Windows.Forms.Button();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
191 ((System.ComponentModel.ISupportInitialize) (this.statsGrid)).BeginInit();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
192 ((System.ComponentModel.ISupportInitialize) (this.unitSize)).BeginInit();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
193 this.SuspendLayout();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
194 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
195 // statsGrid
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
196 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
197 this.statsGrid.AllowNavigation = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
198 this.statsGrid.AllowSorting = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
199 this.statsGrid.AlternatingBackColor = System.Drawing.SystemColors.Control;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
200 this.statsGrid.BackgroundColor = System.Drawing.SystemColors.Control;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
201 this.statsGrid.CaptionVisible = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
202 this.statsGrid.DataMember = "";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
203 this.statsGrid.GridLineColor = System.Drawing.SystemColors.ControlDarkDark;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
204 this.statsGrid.HeaderForeColor = System.Drawing.SystemColors.ControlText;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
205 this.statsGrid.Location = new System.Drawing.Point(8, 32);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
206 this.statsGrid.Name = "statsGrid";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
207 this.statsGrid.PreferredColumnWidth = 40;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
208 this.statsGrid.ReadOnly = true;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
209 this.statsGrid.RowHeadersVisible = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
210 this.statsGrid.SelectionBackColor = System.Drawing.SystemColors.Control;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
211 this.statsGrid.SelectionForeColor = System.Drawing.SystemColors.WindowText;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
212 this.statsGrid.Size = new System.Drawing.Size(600, 88);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
213 this.statsGrid.TabIndex = 0;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
214 this.statsGrid.TabStop = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
215 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
216 // tbUnitName
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
217 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
218 this.tbUnitName.Location = new System.Drawing.Point(8, 8);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
219 this.tbUnitName.Name = "tbUnitName";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
220 this.tbUnitName.Size = new System.Drawing.Size(344, 20);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
221 this.tbUnitName.TabIndex = 1;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
222 this.tbUnitName.Text = "";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
223 this.tbUnitName.KeyDown += new System.Windows.Forms.KeyEventHandler(this.tbUnitName_KeyDown);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
224 this.tbUnitName.Leave += new System.EventHandler(this.tbUnitName_Leave);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
225 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
226 // unitSize
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
227 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
228 this.unitSize.Location = new System.Drawing.Point(528, 8);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
229 this.unitSize.Name = "unitSize";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
230 this.unitSize.Size = new System.Drawing.Size(80, 20);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
231 this.unitSize.TabIndex = 1;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
232 this.unitSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Right;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
233 this.unitSize.Value = new System.Decimal(new int[] {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
234 1,
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
235 0,
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
236 0,
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
237 0});
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
238 this.unitSize.KeyDown += new System.Windows.Forms.KeyEventHandler(this.unitSize_KeyDown);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
239 this.unitSize.Leave += new System.EventHandler(this.unitSize_Leave);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
240 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
241 // lblUnitSize
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
242 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
243 this.lblUnitSize.Location = new System.Drawing.Point(424, 8);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
244 this.lblUnitSize.Name = "lblUnitSize";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
245 this.lblUnitSize.TabIndex = 0;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
246 this.lblUnitSize.Text = "unit size";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
247 this.lblUnitSize.TextAlign = System.Drawing.ContentAlignment.TopRight;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
248 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
249 // lblRequiredEquip
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
250 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
251 this.lblRequiredEquip.Location = new System.Drawing.Point(8, 128);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
252 this.lblRequiredEquip.Name = "lblRequiredEquip";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
253 this.lblRequiredEquip.Size = new System.Drawing.Size(88, 32);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
254 this.lblRequiredEquip.TabIndex = 3;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
255 this.lblRequiredEquip.Text = "reqd equipment";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
256 this.lblRequiredEquip.TextAlign = System.Drawing.ContentAlignment.TopRight;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
257 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
258 // bttnAddWeapon
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
259 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
260 this.bttnAddWeapon.FlatStyle = System.Windows.Forms.FlatStyle.System;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
261 this.bttnAddWeapon.Location = new System.Drawing.Point(520, 200);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
262 this.bttnAddWeapon.Name = "bttnAddWeapon";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
263 this.bttnAddWeapon.Size = new System.Drawing.Size(88, 22);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
264 this.bttnAddWeapon.TabIndex = 4;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
265 this.bttnAddWeapon.Text = "add";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
266 this.bttnAddWeapon.Click += new System.EventHandler(this.bttnAddWeapon_Click);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
267 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
268 // bttnRemoveWeapon
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
269 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
270 this.bttnRemoveWeapon.Enabled = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
271 this.bttnRemoveWeapon.FlatStyle = System.Windows.Forms.FlatStyle.System;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
272 this.bttnRemoveWeapon.Location = new System.Drawing.Point(520, 248);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
273 this.bttnRemoveWeapon.Name = "bttnRemoveWeapon";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
274 this.bttnRemoveWeapon.Size = new System.Drawing.Size(88, 22);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
275 this.bttnRemoveWeapon.TabIndex = 5;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
276 this.bttnRemoveWeapon.Text = "remove";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
277 this.bttnRemoveWeapon.Click += new System.EventHandler(this.bttnRemoveWeapon_Click);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
278 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
279 // reqdList
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
280 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
281 this.reqdList.Location = new System.Drawing.Point(104, 128);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
282 this.reqdList.Name = "reqdList";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
283 this.reqdList.Size = new System.Drawing.Size(408, 69);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
284 this.reqdList.TabIndex = 6;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
285 this.reqdList.DoubleClick += new System.EventHandler(this.reqdList_DoubleClick);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
286 this.reqdList.SelectedIndexChanged += new System.EventHandler(this.reqdList_SelectedIndexChanged);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
287 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
288 // bttnEditWeapon
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
289 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
290 this.bttnEditWeapon.Enabled = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
291 this.bttnEditWeapon.FlatStyle = System.Windows.Forms.FlatStyle.System;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
292 this.bttnEditWeapon.Location = new System.Drawing.Point(520, 224);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
293 this.bttnEditWeapon.Name = "bttnEditWeapon";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
294 this.bttnEditWeapon.Size = new System.Drawing.Size(88, 22);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
295 this.bttnEditWeapon.TabIndex = 7;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
296 this.bttnEditWeapon.Text = "edit";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
297 this.bttnEditWeapon.Click += new System.EventHandler(this.bttnEditWeapon_Click);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
298 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
299 // optList
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
300 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
301 this.optList.Location = new System.Drawing.Point(104, 200);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
302 this.optList.Name = "optList";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
303 this.optList.Size = new System.Drawing.Size(408, 69);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
304 this.optList.TabIndex = 9;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
305 this.optList.DoubleClick += new System.EventHandler(this.optList_DoubleClick);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
306 this.optList.SelectedIndexChanged += new System.EventHandler(this.optList_SelectedIndexChanged);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
307 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
308 // lblOptionalEquip
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
309 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
310 this.lblOptionalEquip.Location = new System.Drawing.Point(8, 200);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
311 this.lblOptionalEquip.Name = "lblOptionalEquip";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
312 this.lblOptionalEquip.Size = new System.Drawing.Size(88, 32);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
313 this.lblOptionalEquip.TabIndex = 8;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
314 this.lblOptionalEquip.Text = "opt equipment";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
315 this.lblOptionalEquip.TextAlign = System.Drawing.ContentAlignment.TopRight;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
316 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
317 // bttnReplaceWeapon
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
318 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
319 this.bttnReplaceWeapon.Enabled = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
320 this.bttnReplaceWeapon.FlatStyle = System.Windows.Forms.FlatStyle.System;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
321 this.bttnReplaceWeapon.Location = new System.Drawing.Point(520, 128);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
322 this.bttnReplaceWeapon.Name = "bttnReplaceWeapon";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
323 this.bttnReplaceWeapon.Size = new System.Drawing.Size(88, 22);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
324 this.bttnReplaceWeapon.TabIndex = 10;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
325 this.bttnReplaceWeapon.Text = "replace";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
326 this.bttnReplaceWeapon.Click += new System.EventHandler(this.bttnReplaceWeapon_Click);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
327 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
328 // bttnEditReqdWeapon
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
329 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
330 this.bttnEditReqdWeapon.Enabled = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
331 this.bttnEditReqdWeapon.FlatStyle = System.Windows.Forms.FlatStyle.System;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
332 this.bttnEditReqdWeapon.Location = new System.Drawing.Point(520, 152);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
333 this.bttnEditReqdWeapon.Name = "bttnEditReqdWeapon";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
334 this.bttnEditReqdWeapon.Size = new System.Drawing.Size(88, 22);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
335 this.bttnEditReqdWeapon.TabIndex = 11;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
336 this.bttnEditReqdWeapon.Text = "edit";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
337 this.bttnEditReqdWeapon.Click += new System.EventHandler(this.bttnEditReqdWeapon_Click);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
338 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
339 // FrmUnit
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
340 //
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
341 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
342 this.ClientSize = new System.Drawing.Size(616, 314);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
343 this.Controls.Add(this.bttnEditReqdWeapon);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
344 this.Controls.Add(this.bttnReplaceWeapon);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
345 this.Controls.Add(this.optList);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
346 this.Controls.Add(this.lblOptionalEquip);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
347 this.Controls.Add(this.bttnEditWeapon);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
348 this.Controls.Add(this.reqdList);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
349 this.Controls.Add(this.bttnRemoveWeapon);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
350 this.Controls.Add(this.bttnAddWeapon);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
351 this.Controls.Add(this.lblRequiredEquip);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
352 this.Controls.Add(this.lblUnitSize);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
353 this.Controls.Add(this.unitSize);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
354 this.Controls.Add(this.tbUnitName);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
355 this.Controls.Add(this.statsGrid);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
356 this.Name = "FrmUnit";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
357 this.ShowInTaskbar = false;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
358 this.Text = "FrmUnit";
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
359 ((System.ComponentModel.ISupportInitialize) (this.statsGrid)).EndInit();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
360 ((System.ComponentModel.ISupportInitialize) (this.unitSize)).EndInit();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
361 this.ResumeLayout(false);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
362
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
363 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
364 #endregion
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
365
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
366 public Unit Unit
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
367 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
368 get { return unit; }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
369 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
370
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
371 private void tbUnitName_Leave(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
372 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
373 updateUnitName();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
374 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
375
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
376 private void tbUnitName_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
377 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
378 if (e.KeyCode == Keys.Enter)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
379 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
380 updateUnitName();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
381 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
382 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
383
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
384 private void updateUnitName()
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
385 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
386 if (unit.Name != tbUnitName.Text)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
387 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
388 commandStack.Execute(new SetNameCommand(unit, tbUnitName.Text));
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
389 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
390 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
391
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
392 private void unitSize_Leave(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
393 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
394 updateUnitSize();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
395 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
396
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
397 private void unitSize_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
398 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
399 if (e.KeyCode == Keys.Enter)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
400 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
401 updateUnitSize();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
402 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
403 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
404
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
405 private void updateUnitSize()
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
406 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
407 if (unit.Size != unitSize.Value)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
408 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
409 commandStack.Execute(new SetUnitSizeCommand(unit, (int) unitSize.Value));
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
410 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
411 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
412
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
413 private void unit_NameChanged(WarFoundryObject obj, string oldValue, string newValue)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
414 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
415 if (obj is Unit && obj.Equals(unit))
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
416 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
417 Unit u = (Unit) obj;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
418 tbUnitName.Text = obj.Name;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
419 Text = obj.Name;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
420 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
421 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
422
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
423 private void unit_UnitSizeChanged(WarFoundryObject obj, int oldValue, int newValue)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
424 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
425 if (obj is Unit && obj.Equals(unit))
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
426 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
427 unitSize.Value = newValue;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
428 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
429 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
430
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
431 private void reqdList_SelectedIndexChanged(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
432 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
433 bttnReplaceWeapon.Enabled = (reqdList.SelectedIndex > -1 && ((UnitEquipmentChoice) reqdList.SelectedItem).Item.HasAlternatives());
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
434 bttnEditReqdWeapon.Enabled = (reqdList.SelectedIndex > -1);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
435 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
436
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
437 private void optList_SelectedIndexChanged(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
438 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
439 bttnEditWeapon.Enabled = optList.SelectedIndex > -1;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
440 bttnRemoveWeapon.Enabled = bttnEditWeapon.Enabled;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
441 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
442
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
443 private void unit_UnitEquipmentAmountChanged(WarFoundryObject obj, double oldValue, double newValue)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
444 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
445 if (obj is UnitEquipmentItem)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
446 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
447 UnitEquipmentItem equip = (UnitEquipmentItem) obj;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
448 ListBox weaponList = (equip.IsRequired ? reqdList : optList);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
449
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
450 if (newValue == 0)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
451 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
452 weaponList.Items.Remove(GetEquipmentChoice(equip));
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
453 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
454 else
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
455 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
456 UnitEquipmentChoice equipObj = GetEquipmentChoice(equip);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
457 int idx = weaponList.Items.IndexOf(equipObj);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
458
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
459 if (idx > -1)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
460 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
461 weaponList.Items[idx] = equipObj;
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
462 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
463 else
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
464 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
465 weaponList.Items.Add(equipObj);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
466 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
467 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
468 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
469 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
470
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
471 private void editWeapon(ListBox list)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
472 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
473 FrmEditUnitEquipment editEquip = new FrmEditUnitEquipment(Unit, ((UnitEquipmentChoice) list.SelectedItem).Item, commandStack);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
474 editEquip.ShowDialog(this);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
475 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
476
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
477 private void bttnEditWeapon_Click(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
478 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
479 editWeapon(optList);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
480 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
481
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
482 private void optList_DoubleClick(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
483 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
484 editWeapon(optList);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
485 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
486
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
487 private void reqdList_DoubleClick(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
488 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
489 editWeapon(reqdList);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
490 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
491
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
492 private void addWeapon()
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
493 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
494 FrmNewUnitEquipment newEquip = new FrmNewUnitEquipment(Unit, commandStack);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
495 newEquip.ShowDialog(this);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
496 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
497
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
498 private void bttnAddWeapon_Click(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
499 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
500 addWeapon();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
501 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
502
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
503 private void removeWeapon()
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
504 {
34
3ceb0efd261f Re #118: Allow equipment amounts of "ratio" equipment to be define as absolute or ratio amounts
IBBoard <dev@ibboard.co.uk>
parents: 27
diff changeset
505 commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, ((UnitEquipmentChoice) optList.SelectedItem).Item, 0));
27
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
506 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
507
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
508 private void bttnRemoveWeapon_Click(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
509 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
510 removeWeapon();
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
511 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
512
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
513 private void bttnEditReqdWeapon_Click(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
514 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
515 editWeapon(reqdList);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
516 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
517
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
518 private void bttnReplaceWeapon_Click(object sender, System.EventArgs e)
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
519 {
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
520 FrmReplaceUnitEquipment replace = new FrmReplaceUnitEquipment(unit, ((UnitEquipmentChoice) reqdList.SelectedItem).Item, commandStack);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
521 replace.ShowDialog(this);
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
522 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
523 }
526fefefb16b Fixes #91: Fix WinForms rendering of unit stats
IBBoard <dev@ibboard.co.uk>
parents: 24
diff changeset
524 }