changeset 40:740350673006

Re #117: Add percentage and number boxes to equipment item dialogs * Add a new EquipmentAmountControl to bundle the controls with some initial implementation * Add new control to "new equipment" dialog and remove old controls Also: * Update some namespaces
author IBBoard <dev@ibboard.co.uk>
date Sun, 06 Sep 2009 18:01:54 +0000
parents 25dfeb1db285
children 4fc87d6e6119
files AssemblyInfo.cs FrmArmyTree.cs FrmMain.cs FrmNewUnitEquipment.cs FrmNewUnitEquipment.resx FrmUnit.cs IBBoard.WarFoundry.GUI.WinForms.csproj UI/EquipmentAmountControl.Designer.cs UI/EquipmentAmountControl.cs UI/EquipmentAmountControl.resx UI/StatColumnStyle.cs
diffstat 11 files changed, 482 insertions(+), 244 deletions(-) [+]
line diff
     1.1 --- a/AssemblyInfo.cs	Tue Sep 01 19:47:33 2009 +0000
     1.2 +++ b/AssemblyInfo.cs	Sun Sep 06 18:01:54 2009 +0000
     1.3 @@ -1,62 +1,62 @@
     1.4  // This file (AssemblyInfo.cs) is a part of the IBBoard.WarFoundry.GUI.WinForms project and is copyright 2007, 2008, 2009 IBBoard.
     1.5  //
     1.6  // 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.
     1.7 -
     1.8 -using System.Reflection;
     1.9 -using System.Runtime.CompilerServices;
    1.10 -
    1.11 -//
    1.12 -// General Information about an assembly is controlled through the following
    1.13 -// set of attributes. Change these attribute values to modify the information
    1.14 -// associated with an assembly.
    1.15 -//
    1.16 -[assembly: AssemblyTitle("WarFoundry Army Builder")]
    1.17 -[assembly: AssemblyDescription("WarFoundry is an army creator/designer/builder designed to cover a wide range of war game systems")]
    1.18 -[assembly: AssemblyConfiguration("")]
    1.19 -[assembly: AssemblyCompany("")]
    1.20 -[assembly: AssemblyProduct("WarFoundry")]
    1.21 -[assembly: AssemblyCopyright("IBBoard, 2007-2009")]
    1.22 -[assembly: AssemblyTrademark("")]
    1.23 -[assembly: AssemblyCulture("")]
    1.24 -
    1.25 -//
    1.26 -// Version information for an assembly consists of the following four values:
    1.27 -//
    1.28 -//      Major Version
    1.29 -//      Minor Version
    1.30 -//      Build Number
    1.31 -//      Revision
    1.32 -//
    1.33 -// You can specify all the values or you can default the Revision and Build Numbers
    1.34 -// by using the '*' as shown below:
    1.35 -
    1.36 -[assembly: AssemblyVersion("1.0.0.*")]
    1.37 -
    1.38 -//
    1.39 -// In order to sign your assembly you must specify a key to use. Refer to the
    1.40 -// Microsoft .NET Framework documentation for more information on assembly signing.
    1.41 -//
    1.42 -// Use the attributes below to control which key is used for signing.
    1.43 -//
    1.44 -// Notes:
    1.45 -//   (*) If no key is specified, the assembly is not signed.
    1.46 -//   (*) KeyName refers to a key that has been installed in the Crypto Service
    1.47 -//       Provider (CSP) on your machine. KeyFile refers to a file which contains
    1.48 -//       a key.
    1.49 -//   (*) If the KeyFile and the KeyName values are both specified, the
    1.50 -//       following processing occurs:
    1.51 -//       (1) If the KeyName can be found in the CSP, that key is used.
    1.52 -//       (2) If the KeyName does not exist and the KeyFile does exist, the key
    1.53 -//           in the KeyFile is installed into the CSP and used.
    1.54 -//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
    1.55 -//       When specifying the KeyFile, the location of the KeyFile should be
    1.56 -//       relative to the project output directory which is
    1.57 -//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
    1.58 -//       located in the project directory, you would specify the AssemblyKeyFile
    1.59 -//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
    1.60 -//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
    1.61 -//       documentation for more information on this.
    1.62 -//
    1.63 -[assembly: AssemblyDelaySign(false)]
    1.64 -[assembly: AssemblyKeyFile("")]
    1.65 -[assembly: AssemblyKeyName("")]
    1.66 +
    1.67 +using System.Reflection;
    1.68 +using System.Runtime.CompilerServices;
    1.69 +
    1.70 +//
    1.71 +// General Information about an assembly is controlled through the following
    1.72 +// set of attributes. Change these attribute values to modify the information
    1.73 +// associated with an assembly.
    1.74 +//
    1.75 +[assembly: AssemblyTitle("WarFoundry Army Builder")]
    1.76 +[assembly: AssemblyDescription("WarFoundry is an army creator/designer/builder designed to cover a wide range of war game systems")]
    1.77 +[assembly: AssemblyConfiguration("")]
    1.78 +[assembly: AssemblyCompany("")]
    1.79 +[assembly: AssemblyProduct("WarFoundry")]
    1.80 +[assembly: AssemblyCopyright("IBBoard, 2007-2009")]
    1.81 +[assembly: AssemblyTrademark("")]
    1.82 +[assembly: AssemblyCulture("")]
    1.83 +
    1.84 +//
    1.85 +// Version information for an assembly consists of the following four values:
    1.86 +//
    1.87 +//      Major Version
    1.88 +//      Minor Version
    1.89 +//      Build Number
    1.90 +//      Revision
    1.91 +//
    1.92 +// You can specify all the values or you can default the Revision and Build Numbers
    1.93 +// by using the '*' as shown below:
    1.94 +
    1.95 +[assembly: AssemblyVersion("1.0.0.*")]
    1.96 +
    1.97 +//
    1.98 +// In order to sign your assembly you must specify a key to use. Refer to the
    1.99 +// Microsoft .NET Framework documentation for more information on assembly signing.
   1.100 +//
   1.101 +// Use the attributes below to control which key is used for signing.
   1.102 +//
   1.103 +// Notes:
   1.104 +//   (*) If no key is specified, the assembly is not signed.
   1.105 +//   (*) KeyName refers to a key that has been installed in the Crypto Service
   1.106 +//       Provider (CSP) on your machine. KeyFile refers to a file which contains
   1.107 +//       a key.
   1.108 +//   (*) If the KeyFile and the KeyName values are both specified, the
   1.109 +//       following processing occurs:
   1.110 +//       (1) If the KeyName can be found in the CSP, that key is used.
   1.111 +//       (2) If the KeyName does not exist and the KeyFile does exist, the key
   1.112 +//           in the KeyFile is installed into the CSP and used.
   1.113 +//   (*) In order to create a KeyFile, you can use the sn.exe (Strong Name) utility.
   1.114 +//       When specifying the KeyFile, the location of the KeyFile should be
   1.115 +//       relative to the project output directory which is
   1.116 +//       %Project Directory%\obj\<configuration>. For example, if your KeyFile is
   1.117 +//       located in the project directory, you would specify the AssemblyKeyFile
   1.118 +//       attribute as [assembly: AssemblyKeyFile("..\\..\\mykey.snk")]
   1.119 +//   (*) Delay Signing is an advanced option - see the Microsoft .NET Framework
   1.120 +//       documentation for more information on this.
   1.121 +//
   1.122 +[assembly: AssemblyDelaySign(false)]
   1.123 +[assembly: AssemblyKeyFile("")]
   1.124 +[assembly: AssemblyKeyName("")]
     2.1 --- a/FrmArmyTree.cs	Tue Sep 01 19:47:33 2009 +0000
     2.2 +++ b/FrmArmyTree.cs	Sun Sep 06 18:01:54 2009 +0000
     2.3 @@ -13,7 +13,7 @@
     2.4  using IBBoard.Windows.Forms;
     2.5  using IBBoard.WarFoundry.API.Objects;
     2.6  
     2.7 -namespace IBBoard.WarFoundry.WinForms
     2.8 +namespace IBBoard.WarFoundry.GUI.WinForms
     2.9  {
    2.10  	/// <summary>
    2.11  	/// Summary description for FrmArmyTree.
     3.1 --- a/FrmMain.cs	Tue Sep 01 19:47:33 2009 +0000
     3.2 +++ b/FrmMain.cs	Sun Sep 06 18:01:54 2009 +0000
     3.3 @@ -28,7 +28,7 @@
     3.4  using IBBoard.WarFoundry.API.Factories;
     3.5  using IBBoard.WarFoundry.API.Factories.Xml;
     3.6  
     3.7 -namespace IBBoard.WarFoundry.WinForms
     3.8 +namespace IBBoard.WarFoundry.GUI.WinForms
     3.9  {
    3.10  	/// <summary>
    3.11  	/// Summary description for Form1.
     4.1 --- a/FrmNewUnitEquipment.cs	Tue Sep 01 19:47:33 2009 +0000
     4.2 +++ b/FrmNewUnitEquipment.cs	Sun Sep 06 18:01:54 2009 +0000
     4.3 @@ -13,8 +13,9 @@
     4.4  using IBBoard.WarFoundry.API;
     4.5  using IBBoard.WarFoundry.API.Commands;
     4.6  using IBBoard.WarFoundry.API.Objects;
     4.7 +using IBBoard.WarFoundry.GUI.WinForms.Util;
     4.8  
     4.9 -namespace IBBoard.WarFoundry
    4.10 +namespace IBBoard.WarFoundry.GUI.WinForms
    4.11  {
    4.12  	/// <summary>
    4.13  	/// Summary description for FrmNewUnitEquipment.
    4.14 @@ -22,17 +23,13 @@
    4.15  	public class FrmNewUnitEquipment : System.Windows.Forms.Form
    4.16  	{
    4.17  		private Unit unit;
    4.18 -		private bool required;
    4.19  		private CommandStack commandStack;
    4.20 -
    4.21 -		private System.Windows.Forms.NumericUpDown numEquipAmount;
    4.22 -		private System.Windows.Forms.Label lblPercent;
    4.23  		private System.Windows.Forms.Label lblAmount;
    4.24  		private System.Windows.Forms.Button bttnCancel;
    4.25  		private System.Windows.Forms.Button bttnOkay;
    4.26 -		private System.Windows.Forms.CheckBox cbEquipAll;
    4.27  		private System.Windows.Forms.Label lblItem;
    4.28  		private System.Windows.Forms.ListBox listItems;
    4.29 +		private IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl equipmentAmount;
    4.30  		/// <summary>
    4.31  		/// Required designer variable.
    4.32  		/// </summary>
    4.33 @@ -70,35 +67,14 @@
    4.34  		/// </summary>
    4.35  		private void InitializeComponent()
    4.36  		{
    4.37 -			this.numEquipAmount = new System.Windows.Forms.NumericUpDown();
    4.38 -			this.lblPercent = new System.Windows.Forms.Label();
    4.39  			this.lblAmount = new System.Windows.Forms.Label();
    4.40  			this.bttnCancel = new System.Windows.Forms.Button();
    4.41  			this.bttnOkay = new System.Windows.Forms.Button();
    4.42 -			this.cbEquipAll = new System.Windows.Forms.CheckBox();
    4.43  			this.lblItem = new System.Windows.Forms.Label();
    4.44  			this.listItems = new System.Windows.Forms.ListBox();
    4.45 -			((System.ComponentModel.ISupportInitialize)(this.numEquipAmount)).BeginInit();
    4.46 +			this.equipmentAmount = new IBBoard.WarFoundry.GUI.WinForms.UI.EquipmentAmountControl();
    4.47  			this.SuspendLayout();
    4.48  			// 
    4.49 -			// numEquipAmount
    4.50 -			// 
    4.51 -			this.numEquipAmount.Enabled = false;
    4.52 -			this.numEquipAmount.Location = new System.Drawing.Point(88, 80);
    4.53 -			this.numEquipAmount.Name = "numEquipAmount";
    4.54 -			this.numEquipAmount.Size = new System.Drawing.Size(144, 20);
    4.55 -			this.numEquipAmount.TabIndex = 0;
    4.56 -			this.numEquipAmount.ValueChanged += new System.EventHandler(this.numEquipAmount_ValueChanged);
    4.57 -			// 
    4.58 -			// lblPercent
    4.59 -			// 
    4.60 -			this.lblPercent.Location = new System.Drawing.Point(208, 80);
    4.61 -			this.lblPercent.Name = "lblPercent";
    4.62 -			this.lblPercent.Size = new System.Drawing.Size(16, 16);
    4.63 -			this.lblPercent.TabIndex = 1;
    4.64 -			this.lblPercent.Text = "%";
    4.65 -			this.lblPercent.Visible = false;
    4.66 -			// 
    4.67  			// lblAmount
    4.68  			// 
    4.69  			this.lblAmount.Location = new System.Drawing.Point(8, 80);
    4.70 @@ -112,8 +88,9 @@
    4.71  			// 
    4.72  			this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
    4.73  			this.bttnCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
    4.74 -			this.bttnCancel.Location = new System.Drawing.Point(160, 136);
    4.75 +			this.bttnCancel.Location = new System.Drawing.Point(158, 162);
    4.76  			this.bttnCancel.Name = "bttnCancel";
    4.77 +			this.bttnCancel.Size = new System.Drawing.Size(75, 23);
    4.78  			this.bttnCancel.TabIndex = 3;
    4.79  			this.bttnCancel.Text = "cancel";
    4.80  			this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
    4.81 @@ -122,22 +99,13 @@
    4.82  			// 
    4.83  			this.bttnOkay.Enabled = false;
    4.84  			this.bttnOkay.FlatStyle = System.Windows.Forms.FlatStyle.System;
    4.85 -			this.bttnOkay.Location = new System.Drawing.Point(8, 136);
    4.86 +			this.bttnOkay.Location = new System.Drawing.Point(12, 162);
    4.87  			this.bttnOkay.Name = "bttnOkay";
    4.88 +			this.bttnOkay.Size = new System.Drawing.Size(75, 23);
    4.89  			this.bttnOkay.TabIndex = 4;
    4.90  			this.bttnOkay.Text = "okay";
    4.91  			this.bttnOkay.Click += new System.EventHandler(this.bttnOkay_Click);
    4.92  			// 
    4.93 -			// cbEquipAll
    4.94 -			// 
    4.95 -			this.cbEquipAll.Enabled = false;
    4.96 -			this.cbEquipAll.FlatStyle = System.Windows.Forms.FlatStyle.System;
    4.97 -			this.cbEquipAll.Location = new System.Drawing.Point(88, 104);
    4.98 -			this.cbEquipAll.Name = "cbEquipAll";
    4.99 -			this.cbEquipAll.TabIndex = 5;
   4.100 -			this.cbEquipAll.Text = "equip all";
   4.101 -			this.cbEquipAll.CheckedChanged += new System.EventHandler(this.cbEquipAll_CheckedChanged);
   4.102 -			// 
   4.103  			// lblItem
   4.104  			// 
   4.105  			this.lblItem.Location = new System.Drawing.Point(0, 8);
   4.106 @@ -151,31 +119,35 @@
   4.107  			// 
   4.108  			this.listItems.Location = new System.Drawing.Point(88, 8);
   4.109  			this.listItems.Name = "listItems";
   4.110 -			this.listItems.Size = new System.Drawing.Size(144, 69);
   4.111 +			this.listItems.Size = new System.Drawing.Size(145, 69);
   4.112  			this.listItems.TabIndex = 7;
   4.113  			this.listItems.SelectedIndexChanged += new System.EventHandler(this.listItems_SelectedIndexChanged);
   4.114  			// 
   4.115 +			// equipmentAmount
   4.116 +			// 
   4.117 +			this.equipmentAmount.Location = new System.Drawing.Point(88, 80);
   4.118 +			this.equipmentAmount.Name = "equipmentAmount";
   4.119 +			this.equipmentAmount.Size = new System.Drawing.Size(155, 77);
   4.120 +			this.equipmentAmount.TabIndex = 8;
   4.121 +			// 
   4.122  			// FrmNewUnitEquipment
   4.123  			// 
   4.124  			this.AcceptButton = this.bttnOkay;
   4.125  			this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
   4.126  			this.CancelButton = this.bttnCancel;
   4.127 -			this.ClientSize = new System.Drawing.Size(240, 164);
   4.128 +			this.ClientSize = new System.Drawing.Size(245, 190);
   4.129  			this.ControlBox = false;
   4.130 +			this.Controls.Add(this.equipmentAmount);
   4.131  			this.Controls.Add(this.listItems);
   4.132  			this.Controls.Add(this.lblItem);
   4.133 -			this.Controls.Add(this.cbEquipAll);
   4.134  			this.Controls.Add(this.bttnOkay);
   4.135  			this.Controls.Add(this.bttnCancel);
   4.136  			this.Controls.Add(this.lblAmount);
   4.137 -			this.Controls.Add(this.numEquipAmount);
   4.138 -			this.Controls.Add(this.lblPercent);
   4.139  			this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
   4.140  			this.Name = "FrmNewUnitEquipment";
   4.141  			this.ShowInTaskbar = false;
   4.142  			this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
   4.143  			this.Text = "FrmEditUnitEquipment";
   4.144 -			((System.ComponentModel.ISupportInitialize)(this.numEquipAmount)).EndInit();
   4.145  			this.ResumeLayout(false);
   4.146  
   4.147  		}
   4.148 @@ -183,28 +155,22 @@
   4.149  
   4.150  		private void bttnOkay_Click(object sender, System.EventArgs e)
   4.151  		{
   4.152 -			setValue();
   4.153 +			SetValue();
   4.154  			this.Close();
   4.155  		}
   4.156  
   4.157 -		private void setValue()
   4.158 +		private void SetValue()
   4.159  		{
   4.160  			UnitEquipmentItem equipItem = (UnitEquipmentItem)listItems.SelectedItem;
   4.161  
   4.162 -			if (cbEquipAll.Checked)
   4.163 +			if (equipmentAmount.IsRatioEquipmentAmount)
   4.164  			{
   4.165 -				commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, WarFoundryCore.INFINITY));
   4.166 +				commandStack.Execute(new SetUnitEquipmentRatioAmountCommand(unit, equipItem, equipmentAmount.EquipmentAmount));
   4.167  			}
   4.168  			else
   4.169  			{
   4.170 -				if (equipItem.IsRatioLimit)
   4.171 -				{
   4.172 -					commandStack.Execute(new SetUnitEquipmentRatioAmountCommand(unit, equipItem, (double)numEquipAmount.Value / 100.0));
   4.173 -				}
   4.174 -				else
   4.175 -				{
   4.176 -					commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, (int)numEquipAmount.Value));
   4.177 -				}
   4.178 +				//Just cast here - we should be returned a whole number anyway
   4.179 +				commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, (int) equipmentAmount.EquipmentAmount));
   4.180  			}
   4.181  		}
   4.182  
   4.183 @@ -215,7 +181,7 @@
   4.184  
   4.185  		private void cbEquipAll_CheckedChanged(object sender, System.EventArgs e)
   4.186  		{
   4.187 -			numEquipAmount.Enabled = ((UnitEquipmentItem)listItems.SelectedItem).MinNumber != WarFoundryCore.INFINITY && !cbEquipAll.Checked;
   4.188 +			//numEquipAmount.Enabled = ((UnitEquipmentItem) listItems.SelectedItem).MinNumber != WarFoundryCore.INFINITY && !rbEquipAll.Checked;
   4.189  			setOkayButton();
   4.190  		}
   4.191  
   4.192 @@ -227,6 +193,7 @@
   4.193  
   4.194  		private void refreshNumber()
   4.195  		{
   4.196 +			/*
   4.197  			if (listItems.SelectedIndex > -1)
   4.198  			{
   4.199  				UnitEquipmentItem equipItem = (UnitEquipmentItem)listItems.SelectedItem;
   4.200 @@ -238,7 +205,7 @@
   4.201  					numEquipAmount.Maximum = (decimal) equipItem.MaxPercentage;
   4.202  					numEquipAmount.Enabled = true;
   4.203  					numEquipAmount.Value = numEquipAmount.Minimum;
   4.204 -					cbEquipAll.Enabled = false;
   4.205 +					rbEquipAll.Enabled = false;
   4.206  					lblPercent.Visible = true;
   4.207  					numEquipAmount.Width = 120;
   4.208  				}
   4.209 @@ -248,8 +215,8 @@
   4.210  					numEquipAmount.Maximum = (decimal)(equipItem.MaxNumber != WarFoundryCore.INFINITY ? Math.Min(equipItem.MaxNumber, unit.Size) : unit.Size);
   4.211  					numEquipAmount.Value = numEquipAmount.Minimum;
   4.212  					numEquipAmount.Enabled = equipItem.MinNumber != WarFoundryCore.INFINITY;
   4.213 -					cbEquipAll.Enabled = equipItem.MinNumber != WarFoundryCore.INFINITY && equipItem.MaxNumber == WarFoundryCore.INFINITY;
   4.214 -					cbEquipAll.Checked = equipItem.MinNumber == WarFoundryCore.INFINITY;
   4.215 +					rbEquipAll.Enabled = equipItem.MinNumber != WarFoundryCore.INFINITY && equipItem.MaxNumber == WarFoundryCore.INFINITY;
   4.216 +					rbEquipAll.Checked = equipItem.MinNumber == WarFoundryCore.INFINITY;
   4.217  					lblPercent.Visible = false;
   4.218  					numEquipAmount.Width = 144;
   4.219  				}
   4.220 @@ -259,13 +226,13 @@
   4.221  				numEquipAmount.Minimum = 0;
   4.222  				numEquipAmount.Value = 0;
   4.223  				numEquipAmount.Enabled = false;
   4.224 -				cbEquipAll.Enabled = false;
   4.225 -			}
   4.226 +				rbEquipAll.Enabled = false;
   4.227 +			}*/
   4.228  		}
   4.229  
   4.230  		private void setOkayButton()
   4.231  		{
   4.232 -			bttnOkay.Enabled = listItems.SelectedIndex > -1 && (cbEquipAll.Checked || (numEquipAmount.Enabled && numEquipAmount.Value > 0));
   4.233 +			bttnOkay.Enabled = listItems.SelectedIndex > -1;// && (rbEquipAll.Checked || (numEquipAmount.Enabled && numEquipAmount.Value > 0));
   4.234  		}
   4.235  
   4.236  		private void numEquipAmount_ValueChanged(object sender, System.EventArgs e)
     5.1 --- a/FrmNewUnitEquipment.resx	Tue Sep 01 19:47:33 2009 +0000
     5.2 +++ b/FrmNewUnitEquipment.resx	Sun Sep 06 18:01:54 2009 +0000
     5.3 @@ -3,7 +3,7 @@
     5.4    <!-- 
     5.5      Microsoft ResX Schema 
     5.6      
     5.7 -    Version 1.3
     5.8 +    Version 2.0
     5.9      
    5.10      The primary goals of this format is to allow a simple XML format 
    5.11      that is mostly human readable. The generation and parsing of the 
    5.12 @@ -14,16 +14,17 @@
    5.13      
    5.14      ... ado.net/XML headers & schema ...
    5.15      <resheader name="resmimetype">text/microsoft-resx</resheader>
    5.16 -    <resheader name="version">1.3</resheader>
    5.17 +    <resheader name="version">2.0</resheader>
    5.18      <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
    5.19      <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
    5.20 -    <data name="Name1">this is my long string</data>
    5.21 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
    5.22      <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
    5.23      <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
    5.24 -        [base64 mime encoded serialized .NET Framework object]
    5.25 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
    5.26      </data>
    5.27      <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
    5.28 -        [base64 mime encoded string representing a byte array form of the .NET Framework object]
    5.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
    5.30 +        <comment>This is a comment</comment>
    5.31      </data>
    5.32                  
    5.33      There are any number of "resheader" rows that contain simple 
    5.34 @@ -35,7 +36,7 @@
    5.35      Classes that don't support this are serialized and stored with the 
    5.36      mimetype set.
    5.37      
    5.38 -    The mimetype is used forserialized objects, and tells the 
    5.39 +    The mimetype is used for serialized objects, and tells the 
    5.40      ResXResourceReader how to depersist the object. This is currently not 
    5.41      extensible. For a given mimetype the value must be set accordingly:
    5.42      
    5.43 @@ -45,7 +46,7 @@
    5.44      
    5.45      mimetype: application/x-microsoft.net.object.binary.base64
    5.46      value   : The object must be serialized with 
    5.47 -            : System.Serialization.Formatters.Binary.BinaryFormatter
    5.48 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
    5.49              : and then encoded with base64 encoding.
    5.50      
    5.51      mimetype: application/x-microsoft.net.object.soap.base64
    5.52 @@ -59,18 +60,37 @@
    5.53              : and then encoded with base64 encoding.
    5.54      -->
    5.55    <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
    5.56 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
    5.57      <xsd:element name="root" msdata:IsDataSet="true">
    5.58        <xsd:complexType>
    5.59          <xsd:choice maxOccurs="unbounded">
    5.60 +          <xsd:element name="metadata">
    5.61 +            <xsd:complexType>
    5.62 +              <xsd:sequence>
    5.63 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
    5.64 +              </xsd:sequence>
    5.65 +              <xsd:attribute name="name" use="required" type="xsd:string" />
    5.66 +              <xsd:attribute name="type" type="xsd:string" />
    5.67 +              <xsd:attribute name="mimetype" type="xsd:string" />
    5.68 +              <xsd:attribute ref="xml:space" />
    5.69 +            </xsd:complexType>
    5.70 +          </xsd:element>
    5.71 +          <xsd:element name="assembly">
    5.72 +            <xsd:complexType>
    5.73 +              <xsd:attribute name="alias" type="xsd:string" />
    5.74 +              <xsd:attribute name="name" type="xsd:string" />
    5.75 +            </xsd:complexType>
    5.76 +          </xsd:element>
    5.77            <xsd:element name="data">
    5.78              <xsd:complexType>
    5.79                <xsd:sequence>
    5.80                  <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
    5.81                  <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
    5.82                </xsd:sequence>
    5.83 -              <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
    5.84 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
    5.85                <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
    5.86                <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
    5.87 +              <xsd:attribute ref="xml:space" />
    5.88              </xsd:complexType>
    5.89            </xsd:element>
    5.90            <xsd:element name="resheader">
    5.91 @@ -89,114 +109,12 @@
    5.92      <value>text/microsoft-resx</value>
    5.93    </resheader>
    5.94    <resheader name="version">
    5.95 -    <value>1.3</value>
    5.96 +    <value>2.0</value>
    5.97    </resheader>
    5.98    <resheader name="reader">
    5.99 -    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   5.100 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   5.101    </resheader>
   5.102    <resheader name="writer">
   5.103 -    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   5.104 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   5.105    </resheader>
   5.106 -  <data name="numEquipAmount.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.107 -    <value>False</value>
   5.108 -  </data>
   5.109 -  <data name="numEquipAmount.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.110 -    <value>Private</value>
   5.111 -  </data>
   5.112 -  <data name="numEquipAmount.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.113 -    <value>Private</value>
   5.114 -  </data>
   5.115 -  <data name="lblPercent.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.116 -    <value>False</value>
   5.117 -  </data>
   5.118 -  <data name="lblPercent.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.119 -    <value>Private</value>
   5.120 -  </data>
   5.121 -  <data name="lblPercent.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.122 -    <value>Private</value>
   5.123 -  </data>
   5.124 -  <data name="lblAmount.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.125 -    <value>Private</value>
   5.126 -  </data>
   5.127 -  <data name="lblAmount.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.128 -    <value>False</value>
   5.129 -  </data>
   5.130 -  <data name="lblAmount.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.131 -    <value>Private</value>
   5.132 -  </data>
   5.133 -  <data name="bttnCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.134 -    <value>False</value>
   5.135 -  </data>
   5.136 -  <data name="bttnCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.137 -    <value>Private</value>
   5.138 -  </data>
   5.139 -  <data name="bttnCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.140 -    <value>Private</value>
   5.141 -  </data>
   5.142 -  <data name="bttnOkay.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.143 -    <value>False</value>
   5.144 -  </data>
   5.145 -  <data name="bttnOkay.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.146 -    <value>Private</value>
   5.147 -  </data>
   5.148 -  <data name="bttnOkay.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.149 -    <value>Private</value>
   5.150 -  </data>
   5.151 -  <data name="cbEquipAll.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.152 -    <value>False</value>
   5.153 -  </data>
   5.154 -  <data name="cbEquipAll.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.155 -    <value>Private</value>
   5.156 -  </data>
   5.157 -  <data name="cbEquipAll.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.158 -    <value>Private</value>
   5.159 -  </data>
   5.160 -  <data name="lblItem.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.161 -    <value>False</value>
   5.162 -  </data>
   5.163 -  <data name="lblItem.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.164 -    <value>Private</value>
   5.165 -  </data>
   5.166 -  <data name="lblItem.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.167 -    <value>Private</value>
   5.168 -  </data>
   5.169 -  <data name="listItems.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.170 -    <value>Private</value>
   5.171 -  </data>
   5.172 -  <data name="listItems.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.173 -    <value>False</value>
   5.174 -  </data>
   5.175 -  <data name="listItems.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.176 -    <value>Private</value>
   5.177 -  </data>
   5.178 -  <data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.179 -    <value>False</value>
   5.180 -  </data>
   5.181 -  <data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.182 -    <value>False</value>
   5.183 -  </data>
   5.184 -  <data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.185 -    <value>False</value>
   5.186 -  </data>
   5.187 -  <data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
   5.188 -    <value>8, 8</value>
   5.189 -  </data>
   5.190 -  <data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.191 -    <value>(Default)</value>
   5.192 -  </data>
   5.193 -  <data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.194 -    <value>True</value>
   5.195 -  </data>
   5.196 -  <data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.197 -    <value>80</value>
   5.198 -  </data>
   5.199 -  <data name="$this.Name">
   5.200 -    <value>FrmNewUnitEquipment</value>
   5.201 -  </data>
   5.202 -  <data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.203 -    <value>True</value>
   5.204 -  </data>
   5.205 -  <data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
   5.206 -    <value>Private</value>
   5.207 -  </data>
   5.208  </root>
   5.209 \ No newline at end of file
     6.1 --- a/FrmUnit.cs	Tue Sep 01 19:47:33 2009 +0000
     6.2 +++ b/FrmUnit.cs	Sun Sep 06 18:01:54 2009 +0000
     6.3 @@ -14,10 +14,10 @@
     6.4  using IBBoard.WarFoundry.API;
     6.5  using IBBoard.WarFoundry.API.Commands;
     6.6  using IBBoard.WarFoundry.API.Objects;
     6.7 -using IBBoard.WarFoundry.WinForms.UI;
     6.8 +using IBBoard.WarFoundry.GUI.WinForms.UI;
     6.9  using IBBoard.WarFoundry.GUI.WinForms.Util;
    6.10  
    6.11 -namespace IBBoard.WarFoundry.WinForms
    6.12 +namespace IBBoard.WarFoundry.GUI.WinForms
    6.13  {
    6.14  	/// <summary>
    6.15  	/// Summary description for FrmUnit.
     7.1 --- a/IBBoard.WarFoundry.GUI.WinForms.csproj	Tue Sep 01 19:47:33 2009 +0000
     7.2 +++ b/IBBoard.WarFoundry.GUI.WinForms.csproj	Sun Sep 06 18:01:54 2009 +0000
     7.3 @@ -17,9 +17,9 @@
     7.4      <DefaultTargetSchema>IE50</DefaultTargetSchema>
     7.5      <DelaySign>false</DelaySign>
     7.6      <OutputType>WinExe</OutputType>
     7.7 -    <RootNamespace>IBBoard.WarFoundry</RootNamespace>
     7.8 +    <RootNamespace>IBBoard.WarFoundry.GUI.WinForms</RootNamespace>
     7.9      <RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
    7.10 -    <StartupObject>IBBoard.WarFoundry.WinForms.FrmMain</StartupObject>
    7.11 +    <StartupObject>IBBoard.WarFoundry.GUI.WinForms.FrmMain</StartupObject>
    7.12      <FileUpgradeFlags>
    7.13      </FileUpgradeFlags>
    7.14      <UpgradeBackupLocation>
    7.15 @@ -145,6 +145,12 @@
    7.16      <Compile Include="FrmUnit.cs">
    7.17        <SubType>Form</SubType>
    7.18      </Compile>
    7.19 +    <Compile Include="UI\EquipmentAmountControl.cs">
    7.20 +      <SubType>UserControl</SubType>
    7.21 +    </Compile>
    7.22 +    <Compile Include="UI\EquipmentAmountControl.Designer.cs">
    7.23 +      <DependentUpon>EquipmentAmountControl.cs</DependentUpon>
    7.24 +    </Compile>
    7.25      <Compile Include="UI\StatColumnStyle.cs">
    7.26        <SubType>Component</SubType>
    7.27      </Compile>
    7.28 @@ -181,6 +187,10 @@
    7.29      <EmbeddedResource Include="FrmUnit.resx">
    7.30        <DependentUpon>FrmUnit.cs</DependentUpon>
    7.31      </EmbeddedResource>
    7.32 +    <EmbeddedResource Include="UI\EquipmentAmountControl.resx">
    7.33 +      <SubType>Designer</SubType>
    7.34 +      <DependentUpon>EquipmentAmountControl.cs</DependentUpon>
    7.35 +    </EmbeddedResource>
    7.36      <None Include="app.config" />
    7.37      <None Include="COPYING" />
    7.38      <None Include="translations\en.translation">
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/UI/EquipmentAmountControl.Designer.cs	Sun Sep 06 18:01:54 2009 +0000
     8.3 @@ -0,0 +1,132 @@
     8.4 +namespace IBBoard.WarFoundry.GUI.WinForms.UI
     8.5 +{
     8.6 +	partial class EquipmentAmountControl
     8.7 +	{
     8.8 +		/// <summary> 
     8.9 +		/// Required designer variable.
    8.10 +		/// </summary>
    8.11 +		private System.ComponentModel.IContainer components = null;
    8.12 +
    8.13 +		/// <summary> 
    8.14 +		/// Clean up any resources being used.
    8.15 +		/// </summary>
    8.16 +		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    8.17 +		protected override void Dispose(bool disposing)
    8.18 +		{
    8.19 +			if (disposing && (components != null))
    8.20 +			{
    8.21 +				components.Dispose();
    8.22 +			}
    8.23 +			base.Dispose(disposing);
    8.24 +		}
    8.25 +
    8.26 +		#region Component Designer generated code
    8.27 +
    8.28 +		/// <summary> 
    8.29 +		/// Required method for Designer support - do not modify 
    8.30 +		/// the contents of this method with the code editor.
    8.31 +		/// </summary>
    8.32 +		private void InitializeComponent()
    8.33 +		{
    8.34 +			this.rbNumeric = new System.Windows.Forms.RadioButton();
    8.35 +			this.rbPercentage = new System.Windows.Forms.RadioButton();
    8.36 +			this.rbEquipAll = new System.Windows.Forms.RadioButton();
    8.37 +			this.numeric = new System.Windows.Forms.NumericUpDown();
    8.38 +			this.percentage = new System.Windows.Forms.NumericUpDown();
    8.39 +			this.lblPercentSign = new System.Windows.Forms.Label();
    8.40 +			((System.ComponentModel.ISupportInitialize) (this.numeric)).BeginInit();
    8.41 +			((System.ComponentModel.ISupportInitialize) (this.percentage)).BeginInit();
    8.42 +			this.SuspendLayout();
    8.43 +			// 
    8.44 +			// rbNumeric
    8.45 +			// 
    8.46 +			this.rbNumeric.AutoSize = true;
    8.47 +			this.rbNumeric.Enabled = false;
    8.48 +			this.rbNumeric.Location = new System.Drawing.Point(6, 5);
    8.49 +			this.rbNumeric.Name = "rbNumeric";
    8.50 +			this.rbNumeric.Size = new System.Drawing.Size(14, 13);
    8.51 +			this.rbNumeric.TabIndex = 0;
    8.52 +			this.rbNumeric.TabStop = true;
    8.53 +			this.rbNumeric.UseVisualStyleBackColor = true;
    8.54 +			// 
    8.55 +			// rbPercentage
    8.56 +			// 
    8.57 +			this.rbPercentage.AutoSize = true;
    8.58 +			this.rbPercentage.Enabled = false;
    8.59 +			this.rbPercentage.Location = new System.Drawing.Point(6, 31);
    8.60 +			this.rbPercentage.Name = "rbPercentage";
    8.61 +			this.rbPercentage.Size = new System.Drawing.Size(14, 13);
    8.62 +			this.rbPercentage.TabIndex = 1;
    8.63 +			this.rbPercentage.TabStop = true;
    8.64 +			this.rbPercentage.UseVisualStyleBackColor = true;
    8.65 +			// 
    8.66 +			// rbEquipAll
    8.67 +			// 
    8.68 +			this.rbEquipAll.AutoSize = true;
    8.69 +			this.rbEquipAll.Enabled = false;
    8.70 +			this.rbEquipAll.Location = new System.Drawing.Point(6, 55);
    8.71 +			this.rbEquipAll.Name = "rbEquipAll";
    8.72 +			this.rbEquipAll.Size = new System.Drawing.Size(66, 17);
    8.73 +			this.rbEquipAll.TabIndex = 2;
    8.74 +			this.rbEquipAll.TabStop = true;
    8.75 +			this.rbEquipAll.Text = "Equip All";
    8.76 +			this.rbEquipAll.UseVisualStyleBackColor = true;
    8.77 +			this.rbEquipAll.CheckedChanged += new System.EventHandler(this.rbEquipAll_CheckedChanged);
    8.78 +			// 
    8.79 +			// numeric
    8.80 +			// 
    8.81 +			this.numeric.Enabled = false;
    8.82 +			this.numeric.Location = new System.Drawing.Point(26, 3);
    8.83 +			this.numeric.Name = "numeric";
    8.84 +			this.numeric.Size = new System.Drawing.Size(120, 20);
    8.85 +			this.numeric.TabIndex = 3;
    8.86 +			this.numeric.ValueChanged += new System.EventHandler(this.numeric_ValueChanged);
    8.87 +			// 
    8.88 +			// percentage
    8.89 +			// 
    8.90 +			this.percentage.DecimalPlaces = 1;
    8.91 +			this.percentage.Enabled = false;
    8.92 +			this.percentage.Location = new System.Drawing.Point(26, 29);
    8.93 +			this.percentage.Name = "percentage";
    8.94 +			this.percentage.Size = new System.Drawing.Size(105, 20);
    8.95 +			this.percentage.TabIndex = 4;
    8.96 +			this.percentage.ValueChanged += new System.EventHandler(this.percentage_ValueChanged);
    8.97 +			// 
    8.98 +			// lblPercentSign
    8.99 +			// 
   8.100 +			this.lblPercentSign.AutoSize = true;
   8.101 +			this.lblPercentSign.Location = new System.Drawing.Point(131, 31);
   8.102 +			this.lblPercentSign.Name = "lblPercentSign";
   8.103 +			this.lblPercentSign.Size = new System.Drawing.Size(15, 13);
   8.104 +			this.lblPercentSign.TabIndex = 5;
   8.105 +			this.lblPercentSign.Text = "%";
   8.106 +			// 
   8.107 +			// EquipmentAmountControl
   8.108 +			// 
   8.109 +			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
   8.110 +			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
   8.111 +			this.Controls.Add(this.lblPercentSign);
   8.112 +			this.Controls.Add(this.percentage);
   8.113 +			this.Controls.Add(this.numeric);
   8.114 +			this.Controls.Add(this.rbEquipAll);
   8.115 +			this.Controls.Add(this.rbPercentage);
   8.116 +			this.Controls.Add(this.rbNumeric);
   8.117 +			this.Name = "EquipmentAmountControl";
   8.118 +			this.Size = new System.Drawing.Size(155, 77);
   8.119 +			((System.ComponentModel.ISupportInitialize) (this.numeric)).EndInit();
   8.120 +			((System.ComponentModel.ISupportInitialize) (this.percentage)).EndInit();
   8.121 +			this.ResumeLayout(false);
   8.122 +			this.PerformLayout();
   8.123 +
   8.124 +		}
   8.125 +
   8.126 +		#endregion
   8.127 +
   8.128 +		private System.Windows.Forms.RadioButton rbNumeric;
   8.129 +		private System.Windows.Forms.RadioButton rbPercentage;
   8.130 +		private System.Windows.Forms.RadioButton rbEquipAll;
   8.131 +		private System.Windows.Forms.NumericUpDown numeric;
   8.132 +		private System.Windows.Forms.NumericUpDown percentage;
   8.133 +		private System.Windows.Forms.Label lblPercentSign;
   8.134 +	}
   8.135 +}
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/UI/EquipmentAmountControl.cs	Sun Sep 06 18:01:54 2009 +0000
     9.3 @@ -0,0 +1,91 @@
     9.4 +using System;
     9.5 +using System.Collections.Generic;
     9.6 +using System.ComponentModel;
     9.7 +using System.Drawing;
     9.8 +using System.Data;
     9.9 +using System.Text;
    9.10 +using System.Windows.Forms;
    9.11 +using IBBoard.Lang;
    9.12 +using IBBoard.WarFoundry.API;
    9.13 +using IBBoard.WarFoundry.API.Objects;
    9.14 +
    9.15 +namespace IBBoard.WarFoundry.GUI.WinForms.UI
    9.16 +{
    9.17 +	public partial class EquipmentAmountControl : UserControl
    9.18 +	{
    9.19 +		private Unit unit;
    9.20 +		private UnitEquipmentItem equip;
    9.21 +
    9.22 +		public EquipmentAmountControl()
    9.23 +		{
    9.24 +			InitializeComponent();
    9.25 +		}
    9.26 +
    9.27 +		public void SetUnit(Unit equipUnit)
    9.28 +		{
    9.29 +			unit = equipUnit;
    9.30 +		}
    9.31 +
    9.32 +		public void SetUnitEquipmentItem(UnitEquipmentItem unitEquipment)
    9.33 +		{
    9.34 +			equip = unitEquipment;
    9.35 +			//SetWidgetValues();
    9.36 +		}
    9.37 +
    9.38 +		private void rbEquipAll_CheckedChanged(object sender, EventArgs e)
    9.39 +		{
    9.40 +			bool equipAll = rbEquipAll.Checked;
    9.41 +			numeric.Enabled = !equipAll;
    9.42 +			percentage.Enabled = !equipAll;
    9.43 +
    9.44 +			if (equipAll)
    9.45 +			{
    9.46 +				numeric.Value = unit.Size;
    9.47 +				percentage.Value = 100;
    9.48 +			}
    9.49 +		}
    9.50 +
    9.51 +		private void percentage_ValueChanged(object sender, EventArgs e)
    9.52 +		{
    9.53 +			double percent = (double) percentage.Value;
    9.54 +			numeric.Value = (decimal) IBBMath.Round(unit.Size * (percent / 100.0), equip.RoundNumberUp);
    9.55 +			rbEquipAll.Checked = (percentage.Value == 100);
    9.56 +		}
    9.57 +
    9.58 +		private void numeric_ValueChanged(object sender, EventArgs e)
    9.59 +		{
    9.60 +			percentage.Value = (unit.Size / numeric.Value) * 100;
    9.61 +		}
    9.62 +
    9.63 +		public double EquipmentAmount
    9.64 +		{
    9.65 +			get
    9.66 +			{
    9.67 +				double val = 0;
    9.68 +
    9.69 +				if (rbNumeric.Checked)
    9.70 +				{
    9.71 +					val = (double) numeric.Value;
    9.72 +				}
    9.73 +				else if (rbPercentage.Enabled)
    9.74 +				{
    9.75 +					val = (double) percentage.Value / 100.0;
    9.76 +				}
    9.77 +				else
    9.78 +				{
    9.79 +					val = WarFoundryCore.INFINITY;
    9.80 +				}
    9.81 +
    9.82 +				return val;
    9.83 +			}
    9.84 +		}
    9.85 +
    9.86 +		public bool IsRatioEquipmentAmount
    9.87 +		{
    9.88 +			get
    9.89 +			{
    9.90 +				return rbPercentage.Checked;
    9.91 +			}
    9.92 +		}
    9.93 +	}
    9.94 +}
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/UI/EquipmentAmountControl.resx	Sun Sep 06 18:01:54 2009 +0000
    10.3 @@ -0,0 +1,120 @@
    10.4 +<?xml version="1.0" encoding="utf-8"?>
    10.5 +<root>
    10.6 +  <!-- 
    10.7 +    Microsoft ResX Schema 
    10.8 +    
    10.9 +    Version 2.0
   10.10 +    
   10.11 +    The primary goals of this format is to allow a simple XML format 
   10.12 +    that is mostly human readable. The generation and parsing of the 
   10.13 +    various data types are done through the TypeConverter classes 
   10.14 +    associated with the data types.
   10.15 +    
   10.16 +    Example:
   10.17 +    
   10.18 +    ... ado.net/XML headers & schema ...
   10.19 +    <resheader name="resmimetype">text/microsoft-resx</resheader>
   10.20 +    <resheader name="version">2.0</resheader>
   10.21 +    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
   10.22 +    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
   10.23 +    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
   10.24 +    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
   10.25 +    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
   10.26 +        <value>[base64 mime encoded serialized .NET Framework object]</value>
   10.27 +    </data>
   10.28 +    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
   10.29 +        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
   10.30 +        <comment>This is a comment</comment>
   10.31 +    </data>
   10.32 +                
   10.33 +    There are any number of "resheader" rows that contain simple 
   10.34 +    name/value pairs.
   10.35 +    
   10.36 +    Each data row contains a name, and value. The row also contains a 
   10.37 +    type or mimetype. Type corresponds to a .NET class that support 
   10.38 +    text/value conversion through the TypeConverter architecture. 
   10.39 +    Classes that don't support this are serialized and stored with the 
   10.40 +    mimetype set.
   10.41 +    
   10.42 +    The mimetype is used for serialized objects, and tells the 
   10.43 +    ResXResourceReader how to depersist the object. This is currently not 
   10.44 +    extensible. For a given mimetype the value must be set accordingly:
   10.45 +    
   10.46 +    Note - application/x-microsoft.net.object.binary.base64 is the format 
   10.47 +    that the ResXResourceWriter will generate, however the reader can 
   10.48 +    read any of the formats listed below.
   10.49 +    
   10.50 +    mimetype: application/x-microsoft.net.object.binary.base64
   10.51 +    value   : The object must be serialized with 
   10.52 +            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
   10.53 +            : and then encoded with base64 encoding.
   10.54 +    
   10.55 +    mimetype: application/x-microsoft.net.object.soap.base64
   10.56 +    value   : The object must be serialized with 
   10.57 +            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
   10.58 +            : and then encoded with base64 encoding.
   10.59 +
   10.60 +    mimetype: application/x-microsoft.net.object.bytearray.base64
   10.61 +    value   : The object must be serialized into a byte array 
   10.62 +            : using a System.ComponentModel.TypeConverter
   10.63 +            : and then encoded with base64 encoding.
   10.64 +    -->
   10.65 +  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
   10.66 +    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
   10.67 +    <xsd:element name="root" msdata:IsDataSet="true">
   10.68 +      <xsd:complexType>
   10.69 +        <xsd:choice maxOccurs="unbounded">
   10.70 +          <xsd:element name="metadata">
   10.71 +            <xsd:complexType>
   10.72 +              <xsd:sequence>
   10.73 +                <xsd:element name="value" type="xsd:string" minOccurs="0" />
   10.74 +              </xsd:sequence>
   10.75 +              <xsd:attribute name="name" use="required" type="xsd:string" />
   10.76 +              <xsd:attribute name="type" type="xsd:string" />
   10.77 +              <xsd:attribute name="mimetype" type="xsd:string" />
   10.78 +              <xsd:attribute ref="xml:space" />
   10.79 +            </xsd:complexType>
   10.80 +          </xsd:element>
   10.81 +          <xsd:element name="assembly">
   10.82 +            <xsd:complexType>
   10.83 +              <xsd:attribute name="alias" type="xsd:string" />
   10.84 +              <xsd:attribute name="name" type="xsd:string" />
   10.85 +            </xsd:complexType>
   10.86 +          </xsd:element>
   10.87 +          <xsd:element name="data">
   10.88 +            <xsd:complexType>
   10.89 +              <xsd:sequence>
   10.90 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
   10.91 +                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
   10.92 +              </xsd:sequence>
   10.93 +              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
   10.94 +              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
   10.95 +              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
   10.96 +              <xsd:attribute ref="xml:space" />
   10.97 +            </xsd:complexType>
   10.98 +          </xsd:element>
   10.99 +          <xsd:element name="resheader">
  10.100 +            <xsd:complexType>
  10.101 +              <xsd:sequence>
  10.102 +                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
  10.103 +              </xsd:sequence>
  10.104 +              <xsd:attribute name="name" type="xsd:string" use="required" />
  10.105 +            </xsd:complexType>
  10.106 +          </xsd:element>
  10.107 +        </xsd:choice>
  10.108 +      </xsd:complexType>
  10.109 +    </xsd:element>
  10.110 +  </xsd:schema>
  10.111 +  <resheader name="resmimetype">
  10.112 +    <value>text/microsoft-resx</value>
  10.113 +  </resheader>
  10.114 +  <resheader name="version">
  10.115 +    <value>2.0</value>
  10.116 +  </resheader>
  10.117 +  <resheader name="reader">
  10.118 +    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  10.119 +  </resheader>
  10.120 +  <resheader name="writer">
  10.121 +    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
  10.122 +  </resheader>
  10.123 +</root>
  10.124 \ No newline at end of file
    11.1 --- a/UI/StatColumnStyle.cs	Tue Sep 01 19:47:33 2009 +0000
    11.2 +++ b/UI/StatColumnStyle.cs	Sun Sep 06 18:01:54 2009 +0000
    11.3 @@ -8,7 +8,7 @@
    11.4  using System.Windows.Forms;
    11.5  using IBBoard.WarFoundry.API.Objects;
    11.6  
    11.7 -namespace IBBoard.WarFoundry.WinForms.UI
    11.8 +namespace IBBoard.WarFoundry.GUI.WinForms.UI
    11.9  {
   11.10  	class StatColumnStyle : DataGridTextBoxColumn
   11.11  	{