annotate FrmNewUnit.cs @ 193:eaa7b639d390

* Fix build issues no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Sun, 03 Apr 2011 14:50:34 +0000
parents 1bcd7ea857c4
children 137ec6d45280
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: 24
diff changeset
1 // This file (FrmNewUnit.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard.
24
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
2 //
36
6ab7ddc038f9 Re #121: Move all code to AGPL
IBBoard <dev@ibboard.co.uk>
parents: 24
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.
24
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
4
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
5 using System;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
6 using System.Drawing;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
7 using System.ComponentModel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
8 using System.Windows.Forms;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
9 using IBBoard;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
10 using IBBoard.Lang;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
11 using IBBoard.Windows.Forms;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
12 using IBBoard.WarFoundry.API;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
13 using IBBoard.WarFoundry.API.Objects;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
14 using IBBoard.Windows.Forms.I18N;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
15
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
16 namespace IBBoard.WarFoundry
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
17 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
18 /// <summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
19 /// Summary description for FrmNewUnit.
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
20 /// </summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
21 public class FrmNewUnit : IBBForm
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
22 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
23 private System.ComponentModel.IContainer components;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
24 private IBBoard.Windows.Forms.IBBButton bttnCancel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
25 private IBBoard.Windows.Forms.IBBLabel lblUnitList;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
26 private IBBoard.Windows.Forms.IBBButton bttnSelectUnit;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
27 private System.Windows.Forms.ListBox lstUnits;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
28 private UnitType[] units;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
29 private Army army;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
30 private System.Windows.Forms.ImageList imageList;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
31 private System.Windows.Forms.Label lblNewUnitWarning;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
32 private System.Windows.Forms.Label lblWarningIcon;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
33 private bool[] allowed;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
34
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
35 public FrmNewUnit(Race race, Category cat, Army army)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
36 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
37 InitializeComponent();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
38
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
39 ControlTranslator.TranslateControl(this, cat.Name);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
40 units = race.GetUnitTypes(cat);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
41 allowed = new bool[units.Length];
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
42 this.army = army;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
43
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
44 for (int i = 0; i<units.Length; i++)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
45 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
46 allowed[i] = army.CanAddUnitType(units[i]).Count == 0;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
47 lstUnits.Items.Add(units[i].Name);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
48 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
49 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
50
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
51 /// <summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
52 /// Clean up any resources being used.
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
53 /// </summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
54 protected override void Dispose( bool disposing )
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
55 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
56 if( disposing )
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
57 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
58 if(components != null)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
59 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
60 components.Dispose();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
61 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
62 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
63 base.Dispose( disposing );
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
64 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
65
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
66 #region Windows Form Designer generated code
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
67 /// <summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
68 /// Required method for Designer support - do not modify
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
69 /// the contents of this method with the code editor.
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
70 /// </summary>
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
71 private void InitializeComponent()
147
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
72 {
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
73 this.components = new System.ComponentModel.Container();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
74 System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FrmNewUnit));
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
75 this.lstUnits = new System.Windows.Forms.ListBox();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
76 this.bttnCancel = new IBBoard.Windows.Forms.IBBButton();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
77 this.lblUnitList = new IBBoard.Windows.Forms.IBBLabel();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
78 this.bttnSelectUnit = new IBBoard.Windows.Forms.IBBButton();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
79 this.lblNewUnitWarning = new System.Windows.Forms.Label();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
80 this.imageList = new System.Windows.Forms.ImageList(this.components);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
81 this.lblWarningIcon = new System.Windows.Forms.Label();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
82 this.SuspendLayout();
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
83 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
84 // lstUnits
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
85 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
86 this.lstUnits.Location = new System.Drawing.Point(88, 8);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
87 this.lstUnits.Name = "lstUnits";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
88 this.lstUnits.Size = new System.Drawing.Size(272, 121);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
89 this.lstUnits.TabIndex = 7;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
90 this.lstUnits.SelectedIndexChanged += new System.EventHandler(this.lstUnits_SelectedIndexChanged);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
91 this.lstUnits.DoubleClick += new System.EventHandler(this.lstUnits_DoubleClick);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
92 this.lstUnits.MouseDown += new System.Windows.Forms.MouseEventHandler(this.lstUnits_MouseDown);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
93 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
94 // bttnCancel
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
95 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
96 this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
97 this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
98 this.bttnCancel.Location = new System.Drawing.Point(8, 168);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
99 this.bttnCancel.Name = "bttnCancel";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
100 this.bttnCancel.Size = new System.Drawing.Size(80, 24);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
101 this.bttnCancel.TabIndex = 6;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
102 this.bttnCancel.Text = "Cancel";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
103 this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
104 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
105 // lblUnitList
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
106 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
107 this.lblUnitList.Location = new System.Drawing.Point(0, 8);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
108 this.lblUnitList.Name = "lblUnitList";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
109 this.lblUnitList.Size = new System.Drawing.Size(88, 80);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
110 this.lblUnitList.TabIndex = 5;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
111 this.lblUnitList.Text = "unit list";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
112 this.lblUnitList.TextAlign = System.Drawing.ContentAlignment.TopRight;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
113 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
114 // bttnSelectUnit
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
115 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
116 this.bttnSelectUnit.Enabled = false;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
117 this.bttnSelectUnit.FlatStyle = System.Windows.Forms.FlatStyle.System;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
118 this.bttnSelectUnit.Location = new System.Drawing.Point(256, 168);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
119 this.bttnSelectUnit.Name = "bttnSelectUnit";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
120 this.bttnSelectUnit.Size = new System.Drawing.Size(104, 24);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
121 this.bttnSelectUnit.TabIndex = 4;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
122 this.bttnSelectUnit.Text = "create unit";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
123 this.bttnSelectUnit.Click += new System.EventHandler(this.bttnSelectUnit_Click);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
124 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
125 // lblNewUnitWarning
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
126 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
127 this.lblNewUnitWarning.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
128 this.lblNewUnitWarning.ImageList = this.imageList;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
129 this.lblNewUnitWarning.Location = new System.Drawing.Point(48, 136);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
130 this.lblNewUnitWarning.Name = "lblNewUnitWarning";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
131 this.lblNewUnitWarning.Size = new System.Drawing.Size(312, 32);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
132 this.lblNewUnitWarning.TabIndex = 9;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
133 this.lblNewUnitWarning.Text = "label1";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
134 this.lblNewUnitWarning.TextAlign = System.Drawing.ContentAlignment.TopRight;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
135 this.lblNewUnitWarning.Visible = false;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
136 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
137 // imageList
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
138 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
139 this.imageList.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imageList.ImageStream")));
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
140 this.imageList.TransparentColor = System.Drawing.Color.Transparent;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
141 this.imageList.Images.SetKeyName(0, "");
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
142 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
143 // lblWarningIcon
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
144 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
145 this.lblWarningIcon.Image = ((System.Drawing.Image)(resources.GetObject("lblWarningIcon.Image")));
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
146 this.lblWarningIcon.Location = new System.Drawing.Point(8, 136);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
147 this.lblWarningIcon.Name = "lblWarningIcon";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
148 this.lblWarningIcon.Size = new System.Drawing.Size(40, 32);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
149 this.lblWarningIcon.TabIndex = 10;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
150 this.lblWarningIcon.Visible = false;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
151 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
152 // FrmNewUnit
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
153 //
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
154 this.AcceptButton = this.bttnSelectUnit;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
155 this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
156 this.CancelButton = this.bttnCancel;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
157 this.ClientSize = new System.Drawing.Size(370, 196);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
158 this.Controls.Add(this.lblWarningIcon);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
159 this.Controls.Add(this.lblNewUnitWarning);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
160 this.Controls.Add(this.bttnCancel);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
161 this.Controls.Add(this.lblUnitList);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
162 this.Controls.Add(this.bttnSelectUnit);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
163 this.Controls.Add(this.lstUnits);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
164 this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
165 this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
166 this.MaximizeBox = false;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
167 this.MinimizeBox = false;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
168 this.Name = "FrmNewUnit";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
169 this.ShowInTaskbar = false;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
170 this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
171 this.Text = "FrmNewUni";
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
172 this.ResumeLayout(false);
1bcd7ea857c4 * Switch to using a single icon for the FrmNewUnit warning icon to work around Mono vs .Net2 SP2 serialisation bug (https://bugzilla.novell.com/show_bug.cgi?id=360429)
IBBoard <dev@ibboard.co.uk>
parents: 46
diff changeset
173
24
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
174 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
175 #endregion
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
176
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
177 public UnitType SelectedUnit
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
178 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
179 get { return units[lstUnits.SelectedIndex]; }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
180 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
181
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
182 private void bttnCancel_Click(object sender, System.EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
183 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
184 DialogResult = DialogResult.Cancel;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
185 this.Close();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
186 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
187
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
188 private void bttnSelectUnit_Click(object sender, System.EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
189 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
190 selectUnit();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
191 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
192
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
193 private void selectUnit()
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
194 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
195 DialogResult = DialogResult.OK;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
196 this.Close();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
197 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
198
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
199 private void setSelectUnitEnabledVal()
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
200 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
201 if (lstUnits.SelectedIndex>-1)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
202 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
203 bttnSelectUnit.Enabled = true;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
204 lblNewUnitWarning.Visible = !allowed[lstUnits.SelectedIndex];
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
205 lblWarningIcon.Visible = lblNewUnitWarning.Visible;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
206
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
207 if (lblNewUnitWarning.Visible)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
208 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
209 //lblNewUnitWarning.Text = army.GetFailedAddRequirement(units[lstUnits.SelectedIndex]).Description;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
210 //FIXME: Add failed requirement text
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
211 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
212 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
213 else
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
214 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
215 bttnSelectUnit.Enabled = false;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
216 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
217 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
218
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
219 private void lstUnits_SelectedIndexChanged(object sender, System.EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
220 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
221 setSelectUnitEnabledVal();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
222 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
223
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
224 private void lstUnits_DoubleClick(object sender, EventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
225 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
226 if (lstUnits.SelectedIndex>-1)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
227 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
228 selectUnit();
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
229 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
230 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
231
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
232 private void lstUnits_MouseDown(object sender, MouseEventArgs e)
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
233 {
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
234 //make sure no item is selected when a click is made outside a unit
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
235 int index = lstUnits.IndexFromPoint(e.X, e.Y);
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
236 lstUnits.SelectedIndex = index;
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
237 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
238 }
7c366fe55635 * Fix line terminators
IBBoard <dev@ibboard.co.uk>
parents: 3
diff changeset
239 }