changeset 113:4a33b3012100 WarFoundry_v0.1RC1

* Tag v0.1RC1 release no-open-ticket
author IBBoard <dev@ibboard.co.uk>
date Mon, 17 Jan 2011 19:43:47 +0000
parents 146b7a893a01
children 8b99d6aa623f
files App-lrg.png AssemblyInfo.cs FrmAbout.cs FrmAboutCredits.cs FrmAddEquipment.cs FrmEditEquipment.cs FrmMainWindow.cs FrmNewArmy.cs FrmNewUnit.cs FrmPreferences.cs FrmReplaceEquipment.cs IBBoard.WarFoundry.GUI.GTK.csproj IBBoard.WarFoundry.GUI.GTK.sln UIControl/AbstractBaseEquipmentUIControl.cs UIControl/AddEquipmentUIControl.cs UIControl/EditEquipmentUIControl.cs UIControl/Interfaces/IAddEquipmentUI.cs UIControl/Interfaces/IBaseEquipmentUI.cs UIControl/Interfaces/IEditEquipmentUI.cs UIControl/Interfaces/IReplaceEquipmentUI.cs UIControl/Interfaces/ISelectableItemEquipmentUI.cs UIControl/ReplaceEquipmentUIControl.cs Util/GtkWarFoundryUtil.cs WarFoundry-GTK.exe.log4net WarFoundry-GTKPref.xml WarFoundryGTK.exe.log4net WarFoundryGTKPref.xml Widgets/UnitDisplayWidget.cs gtk-gui/IBBoard.WarFoundry.GTK.FrmMainWindow.cs gtk-gui/IBBoard.WarFoundry.GTK.FrmNewArmy.cs gtk-gui/IBBoard.WarFoundry.GTK.FrmNewUnit.cs gtk-gui/IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAbout.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAboutCredits.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmPreferences.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget.cs gtk-gui/generated.cs gtk-gui/gui.stetic gtk-gui/objects.xml translations/en.translation translations/fr.translation
diffstat 47 files changed, 6666 insertions(+), 1596 deletions(-) [+]
line diff
     1.1 Binary file App-lrg.png has changed
     2.1 --- a/AssemblyInfo.cs	Sun Jan 31 20:46:06 2010 +0000
     2.2 +++ b/AssemblyInfo.cs	Mon Jan 17 19:43:47 2011 +0000
     2.3 @@ -16,7 +16,7 @@
     2.4  [assembly: AssemblyConfiguration("")]
     2.5  [assembly: AssemblyCompany("")]
     2.6  [assembly: AssemblyProduct("IBBoard.WarFoundry.GTK")]
     2.7 -[assembly: AssemblyCopyright("IBBoard 2009")]
     2.8 +[assembly: AssemblyCopyright("IBBoard 2009-2011")]
     2.9  [assembly: AssemblyTrademark("")]
    2.10  [assembly: AssemblyCulture("")]
    2.11  
    2.12 @@ -27,7 +27,7 @@
    2.13  // You can specify all values by your own or you can build default build and revision
    2.14  // numbers with the '*' character (the default):
    2.15  
    2.16 -[assembly: AssemblyVersion("1.0.0.*")]
    2.17 +[assembly: AssemblyVersion("0.0.*")]
    2.18  
    2.19  // The following attributes specify the key for the sign of your assembly. See the
    2.20  // .NET Framework documentation for more information about signing.
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/FrmAbout.cs	Mon Jan 17 19:43:47 2011 +0000
     3.3 @@ -0,0 +1,57 @@
     3.4 +//  This file (FrmAbout.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
     3.5 +// 
     3.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.
     3.7 +
     3.8 +using System;
     3.9 +using Gtk;
    3.10 +using IBBoard.GtkSharp.Translatable;
    3.11 +using IBBoard.Lang;
    3.12 +
    3.13 +namespace IBBoard.WarFoundry.GUI.GTK
    3.14 +{
    3.15 +	public partial class FrmAbout : TranslatableDialog
    3.16 +	{
    3.17 +		private static FrmAbout frm;
    3.18 +
    3.19 +		public static FrmAbout GetForm()
    3.20 +		{
    3.21 +			if (frm == null)
    3.22 +			{
    3.23 +				frm = new FrmAbout();
    3.24 +			}
    3.25 +			
    3.26 +			return frm;
    3.27 +		}
    3.28 +
    3.29 +		private FrmAbout()
    3.30 +		{
    3.31 +			this.Build();
    3.32 +			Translation.TranslationChanged += Retranslate;
    3.33 +			Translate();
    3.34 +		}
    3.35 +
    3.36 +		private void Retranslate()
    3.37 +		{
    3.38 +			Translate();
    3.39 +		}
    3.40 +
    3.41 +		public override void Dispose()
    3.42 +		{
    3.43 +			Translation.TranslationChanged -= Retranslate;
    3.44 +			base.Dispose();
    3.45 +		}
    3.46 +
    3.47 +		protected virtual void CloseClicked(object sender, System.EventArgs e)
    3.48 +		{
    3.49 +			Respond(ResponseType.Close);
    3.50 +		}
    3.51 +
    3.52 +		protected virtual void BttnCreditsClicked(object sender, System.EventArgs e)
    3.53 +		{
    3.54 +			FrmAboutCredits credits = new FrmAboutCredits();
    3.55 +			credits.Run();
    3.56 +			credits.Hide();
    3.57 +		}
    3.58 +	}
    3.59 +}
    3.60 +
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/FrmAboutCredits.cs	Mon Jan 17 19:43:47 2011 +0000
     4.3 @@ -0,0 +1,31 @@
     4.4 +//  This file (FrmAboutCredits.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
     4.5 +// 
     4.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.
     4.7 +
     4.8 +using IBBoard.GtkSharp.Translatable;
     4.9 +using IBBoard.Lang;
    4.10 +
    4.11 +namespace IBBoard.WarFoundry.GUI.GTK
    4.12 +{
    4.13 +	public partial class FrmAboutCredits : TranslatableDialog
    4.14 +	{
    4.15 +		public FrmAboutCredits()
    4.16 +		{
    4.17 +			this.Build();
    4.18 +			Translation.TranslationChanged += Retranslate;
    4.19 +			Translate();
    4.20 +		}
    4.21 +
    4.22 +		private void Retranslate()
    4.23 +		{
    4.24 +			Translate();
    4.25 +		}
    4.26 +
    4.27 +		public override void Dispose()
    4.28 +		{
    4.29 +			Translation.TranslationChanged -= Retranslate;
    4.30 +			base.Dispose();
    4.31 +		}
    4.32 +	}
    4.33 +}
    4.34 +
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/FrmAddEquipment.cs	Mon Jan 17 19:43:47 2011 +0000
     5.3 @@ -0,0 +1,274 @@
     5.4 +//  This file (FrmAddEquipment.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
     5.5 +// 
     5.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.
     5.7 +
     5.8 +using System;
     5.9 +using Gtk;
    5.10 +using IBBoard.GtkSharp;
    5.11 +using IBBoard.GtkSharp.Translatable;
    5.12 +using IBBoard.WarFoundry.API.Objects;
    5.13 +using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
    5.14 +using IBBoard.WarFoundry.GUI.GTK.Util;
    5.15 +using log4net;
    5.16 +using IBBoard.Lang;
    5.17 +
    5.18 +namespace IBBoard.WarFoundry.GUI.GTK
    5.19 +{
    5.20 +	public partial class FrmAddEquipment : TranslatableDialog, IAddEquipmentUI
    5.21 +	{
    5.22 +		private static ILog log = LogManager.GetLogger(typeof(FrmAddEquipment));
    5.23 +
    5.24 +		public event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged;
    5.25 +		public event MethodInvoker UnitEquipmentAmountTypeChanged;
    5.26 +		public event MethodInvoker UnitEquipmentAmountChanged;
    5.27 +
    5.28 +		private bool isRatioLimited;
    5.29 +
    5.30 +		public FrmAddEquipment()
    5.31 +		{
    5.32 +			this.Build();
    5.33 +			lstEquipment.Selection.Changed += OnSelectionChanged;
    5.34 +			TreeViewColumn equipColumn = new TreeViewColumn();
    5.35 +			CellRendererText equipCell = new CellRendererText();
    5.36 +			equipColumn.PackStart(equipCell, true);
    5.37 +			equipColumn.SetCellDataFunc(equipCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);
    5.38 +			lstEquipment.AppendColumn(equipColumn);
    5.39 +			Translation.TranslationChanged += Retranslate;
    5.40 +			Translate();
    5.41 +		}
    5.42 +
    5.43 +		private void Retranslate()
    5.44 +		{
    5.45 +			Translate();
    5.46 +		}
    5.47 +
    5.48 +		public override void Dispose()
    5.49 +		{
    5.50 +			Translation.TranslationChanged -= Retranslate;
    5.51 +			base.Dispose();
    5.52 +		}
    5.53 +
    5.54 +		protected override void Translate()
    5.55 +		{
    5.56 +			base.Translate();
    5.57 +			lstEquipment.Columns[0].Title = Translation.GetTranslation("frmAddEquipmentColumnTitle", "equipment");
    5.58 +		}
    5.59 +
    5.60 +		private void OnUnitEquipmentAmountChanged()
    5.61 +		{
    5.62 +			if (UnitEquipmentAmountChanged != null)
    5.63 +			{
    5.64 +				UnitEquipmentAmountChanged();
    5.65 +			}
    5.66 +		}
    5.67 +
    5.68 +		private void OnUnitEquipmentAmountTypeChanged()
    5.69 +		{
    5.70 +			if (UnitEquipmentAmountChanged != null)
    5.71 +			{
    5.72 +				UnitEquipmentAmountTypeChanged();
    5.73 +			}
    5.74 +		}
    5.75 +
    5.76 +		protected void OnSelectionChanged(object o, EventArgs e)
    5.77 +		{
    5.78 +			if (UnitEquipmentItemChoiceChanged != null)
    5.79 +			{
    5.80 +				UnitEquipmentItemChoiceChanged(SelectedUnitEquipmentItem);
    5.81 +			}
    5.82 +		}
    5.83 +
    5.84 +		public void SetUnitEquipmentItems(UnitEquipmentItem[] items)
    5.85 +		{
    5.86 +			ListStore store = new ListStore(typeof(UnitEquipmentItem));
    5.87 +			
    5.88 +			foreach (UnitEquipmentItem equipItem in items)
    5.89 +			{
    5.90 +				store.AppendValues(equipItem);
    5.91 +			}
    5.92 +			
    5.93 +			lstEquipment.Model = store;
    5.94 +		}
    5.95 +
    5.96 +		public void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber)
    5.97 +		{
    5.98 +			log.DebugFormat("IsRatio? {0}. Limits: {1}->{2}, {3}%->{4}%", isRatioLimit, minNumber, maxNumber, minPercent, maxPercent);
    5.99 +			numericAmount.SetRange(minNumber, maxNumber);
   5.100 +			percentageAmount.SetRange(minPercent, maxPercent);
   5.101 +			
   5.102 +			if (isRatioLimit)
   5.103 +			{
   5.104 +				if (minPercent == 100)
   5.105 +				{
   5.106 +					rbEquipAll.Active = true;
   5.107 +				}
   5.108 +				else
   5.109 +				{
   5.110 +					rbEquipPercent.Active = true;
   5.111 +				}
   5.112 +			}
   5.113 +			else
   5.114 +			{
   5.115 +				rbEquipNumeric.Active = true;
   5.116 +			}
   5.117 +			
   5.118 +			isRatioLimited = isRatioLimit;
   5.119 +		}
   5.120 +
   5.121 +		public void SetUnitEquipmentLimitsEnabled(bool isEnabled)
   5.122 +		{
   5.123 +			SetNumericAmountEnabledState(isEnabled);
   5.124 +			SetPercentageAmountEnabledState(isEnabled);
   5.125 +		}
   5.126 +
   5.127 +		public bool ShowControl()
   5.128 +		{
   5.129 +			int result = Run();
   5.130 +			bool okayClicked = (result == (int)ResponseType.Ok);
   5.131 +			this.Hide();
   5.132 +			return okayClicked;
   5.133 +		}
   5.134 +
   5.135 +		protected virtual void CancelButtonClicked(object sender, System.EventArgs e)
   5.136 +		{
   5.137 +			log.Debug("Cancel clicked");
   5.138 +			Respond(ResponseType.Cancel);
   5.139 +		}	
   5.140 +
   5.141 +		protected virtual void OkayButtonClicked(object sender, System.EventArgs e)
   5.142 +		{
   5.143 +			log.Debug("Okay clicked");
   5.144 +			Respond(ResponseType.Ok);
   5.145 +		}		
   5.146 +
   5.147 +		public void SetOkayEnabledState(bool enabled)
   5.148 +		{
   5.149 +			bttnOkay.Sensitive = enabled;
   5.150 +		}
   5.151 +
   5.152 +		protected virtual void SpinButtonValueChanged(object sender, System.EventArgs e)
   5.153 +		{
   5.154 +			OnUnitEquipmentAmountChanged();
   5.155 +		}		
   5.156 +
   5.157 +		protected virtual void RadioButtonClicked(object sender, System.EventArgs e)
   5.158 +		{
   5.159 +			OnUnitEquipmentAmountTypeChanged();
   5.160 +		}
   5.161 +
   5.162 +		public void SetNumericAmountEnabledState(bool enabled)
   5.163 +		{
   5.164 +			double minPercent = GetMinPercentage();
   5.165 +			rbEquipNumeric.Sensitive = enabled && !(isRatioLimited && minPercent == 100);
   5.166 +			numericAmount.Sensitive = rbEquipNumeric.Sensitive;
   5.167 +		}		
   5.168 +
   5.169 +		public void SetPercentageAmountEnabledState(bool enabled)
   5.170 +		{
   5.171 +			if (enabled)
   5.172 +			{
   5.173 +				double minPercentage = GetMinPercentage();
   5.174 +				rbEquipPercent.Sensitive = isRatioLimited && minPercentage != 100;
   5.175 +				percentageAmount.Sensitive = rbEquipPercent.Sensitive;
   5.176 +				double maxPercentage = GetMaxPercentage();				
   5.177 +				rbEquipAll.Sensitive = isRatioLimited && maxPercentage == 100;
   5.178 +				lblEquipAll.Sensitive = rbEquipAll.Sensitive;
   5.179 +			}
   5.180 +			else
   5.181 +			{
   5.182 +				rbEquipPercent.Sensitive = false;
   5.183 +				percentageAmount.Sensitive = false;
   5.184 +				rbEquipAll.Sensitive = false;
   5.185 +				lblEquipAll.Sensitive = false;
   5.186 +			}
   5.187 +		}
   5.188 +
   5.189 +		private double GetMaxPercentage()
   5.190 +		{
   5.191 +			double min, max;
   5.192 +			percentageAmount.GetRange(out min, out max);
   5.193 +			return max;
   5.194 +		}
   5.195 +
   5.196 +		private double GetMinPercentage()
   5.197 +		{
   5.198 +			double min, max;
   5.199 +			percentageAmount.GetRange(out min, out max);
   5.200 +			return min;
   5.201 +		}
   5.202 +
   5.203 +		public void ListenToWidgets()
   5.204 +		{
   5.205 +			rbEquipAll.Clicked += RadioButtonClicked;
   5.206 +			rbEquipNumeric.Clicked += RadioButtonClicked;
   5.207 +			rbEquipPercent.Clicked += RadioButtonClicked;
   5.208 +			numericAmount.ValueChanged += SpinButtonValueChanged;
   5.209 +			percentageAmount.ValueChanged += SpinButtonValueChanged;
   5.210 +			lstEquipment.Selection.Changed += OnSelectionChanged;
   5.211 +		}
   5.212 +
   5.213 +		public void IgnoreWidgets()
   5.214 +		{
   5.215 +			rbEquipAll.Clicked -= RadioButtonClicked;
   5.216 +			rbEquipNumeric.Clicked -= RadioButtonClicked;
   5.217 +			rbEquipPercent.Clicked -= RadioButtonClicked;
   5.218 +			numericAmount.ValueChanged -= SpinButtonValueChanged;
   5.219 +			percentageAmount.ValueChanged -= SpinButtonValueChanged;
   5.220 +			lstEquipment.Selection.Changed -= OnSelectionChanged;
   5.221 +		}
   5.222 +
   5.223 +		public UnitEquipmentItem SelectedUnitEquipmentItem
   5.224 +		{
   5.225 +			get
   5.226 +			{
   5.227 +				return (UnitEquipmentItem)TreeUtils.GetSelectedItem(lstEquipment);
   5.228 +			}
   5.229 +		}
   5.230 +
   5.231 +		public bool IsRatioEquipmentAmount
   5.232 +		{
   5.233 +			get
   5.234 +			{
   5.235 +				return !rbEquipNumeric.Active;
   5.236 +			}
   5.237 +		}
   5.238 +
   5.239 +		public int EquipmentNumericAmount
   5.240 +		{
   5.241 +			get
   5.242 +			{
   5.243 +				return (int)numericAmount.Value;
   5.244 +			}
   5.245 +			
   5.246 +			set
   5.247 +			{
   5.248 +				numericAmount.Value = value;
   5.249 +			}
   5.250 +		}
   5.251 +
   5.252 +		public double EquipmentPercentageAmount
   5.253 +		{
   5.254 +			get
   5.255 +			{
   5.256 +				double percent;
   5.257 +				
   5.258 +				if (rbEquipAll.Active)
   5.259 +				{
   5.260 +					percent = 100;
   5.261 +				}
   5.262 +				else
   5.263 +				{
   5.264 +					percent = percentageAmount.Value;
   5.265 +				}
   5.266 +				
   5.267 +				return percent;
   5.268 +			}
   5.269 +			
   5.270 +			set
   5.271 +			{
   5.272 +				percentageAmount.Value = value;
   5.273 +			}
   5.274 +		}
   5.275 +	}
   5.276 +}
   5.277 +
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/FrmEditEquipment.cs	Mon Jan 17 19:43:47 2011 +0000
     6.3 @@ -0,0 +1,236 @@
     6.4 +//  This file (FrmEditEquipment.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
     6.5 +// 
     6.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.
     6.7 +
     6.8 +using System;
     6.9 +using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
    6.10 +using IBBoard.WarFoundry.API.Objects;
    6.11 +using Gtk;
    6.12 +using IBBoard.WarFoundry.GUI.GTK.Util;
    6.13 +using IBBoard.GtkSharp;
    6.14 +using log4net.Repository.Hierarchy;
    6.15 +using log4net;
    6.16 +using IBBoard.GtkSharp.Translatable;
    6.17 +using IBBoard.Lang;
    6.18 +
    6.19 +namespace IBBoard.WarFoundry.GUI.GTK
    6.20 +{
    6.21 +	public partial class FrmEditEquipment : TranslatableDialog, IEditEquipmentUI
    6.22 +	{
    6.23 +		private static ILog log = LogManager.GetLogger(typeof(FrmAddEquipment));
    6.24 +
    6.25 +		public event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged;
    6.26 +		public event MethodInvoker UnitEquipmentAmountTypeChanged;
    6.27 +		public event MethodInvoker UnitEquipmentAmountChanged;
    6.28 +
    6.29 +		private bool isRatioLimited;
    6.30 +
    6.31 +		public FrmEditEquipment()
    6.32 +		{
    6.33 +			this.Build();
    6.34 +			Translation.TranslationChanged += Retranslate;
    6.35 +			Translate();
    6.36 +		}
    6.37 +
    6.38 +		private void Retranslate()
    6.39 +		{
    6.40 +			Translate();
    6.41 +		}
    6.42 +
    6.43 +		public override void Dispose()
    6.44 +		{
    6.45 +			Translation.TranslationChanged -= Retranslate;
    6.46 +			base.Dispose();
    6.47 +		}
    6.48 +
    6.49 +		public void ListenToWidgets()
    6.50 +		{
    6.51 +			rbEquipAll.Clicked += RadioButtonClicked;
    6.52 +			rbEquipNumeric.Clicked += RadioButtonClicked;
    6.53 +			rbEquipPercent.Clicked += RadioButtonClicked;
    6.54 +			numericAmount.ValueChanged += SpinButtonValueChanged;
    6.55 +			percentageAmount.ValueChanged += SpinButtonValueChanged;
    6.56 +		}
    6.57 +
    6.58 +		public void IgnoreWidgets()
    6.59 +		{
    6.60 +			rbEquipAll.Clicked -= RadioButtonClicked;
    6.61 +			rbEquipNumeric.Clicked -= RadioButtonClicked;
    6.62 +			rbEquipPercent.Clicked -= RadioButtonClicked;
    6.63 +			numericAmount.ValueChanged -= SpinButtonValueChanged;
    6.64 +			percentageAmount.ValueChanged -= SpinButtonValueChanged;
    6.65 +		}
    6.66 +
    6.67 +		private void OnUnitEquipmentAmountChanged()
    6.68 +		{
    6.69 +			if (UnitEquipmentAmountChanged != null)
    6.70 +			{
    6.71 +				UnitEquipmentAmountChanged();
    6.72 +			}
    6.73 +		}
    6.74 +
    6.75 +		private void OnUnitEquipmentAmountTypeChanged()
    6.76 +		{
    6.77 +			if (UnitEquipmentAmountChanged != null)
    6.78 +			{
    6.79 +				UnitEquipmentAmountTypeChanged();
    6.80 +			}
    6.81 +		}
    6.82 +
    6.83 +		public void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber)
    6.84 +		{
    6.85 +			log.DebugFormat("IsRatio? {0}. Limits: {1}->{2}, {3}%->{4}%", isRatioLimit, minNumber, maxNumber, minPercent, maxPercent);
    6.86 +			numericAmount.SetRange(minNumber, maxNumber);
    6.87 +			percentageAmount.SetRange(minPercent, maxPercent);			
    6.88 +			SetEquipmentAmountType(isRatioLimit);
    6.89 +			isRatioLimited = isRatioLimit;
    6.90 +		}
    6.91 +
    6.92 +		public void SetEquipmentAmountType(bool isRatioAmount)
    6.93 +		{
    6.94 +			if (isRatioAmount)
    6.95 +			{
    6.96 +				if (percentageAmount.Value == 100)
    6.97 +				{
    6.98 +					rbEquipAll.Active = true;
    6.99 +				}
   6.100 +				else
   6.101 +				{
   6.102 +					rbEquipPercent.Active = true;
   6.103 +				}
   6.104 +			}
   6.105 +			else
   6.106 +			{
   6.107 +				rbEquipNumeric.Active = true;
   6.108 +			}
   6.109 +		}
   6.110 +
   6.111 +		public void SetUnitEquipmentLimitsEnabled(bool isEnabled)
   6.112 +		{
   6.113 +			SetNumericAmountEnabledState(isEnabled);
   6.114 +			SetPercentageAmountEnabledState(isEnabled);
   6.115 +		}
   6.116 +
   6.117 +		public bool ShowControl()
   6.118 +		{
   6.119 +			int result = Run();
   6.120 +			bool okayClicked = (result == (int)ResponseType.Ok);
   6.121 +			this.Hide();
   6.122 +			return okayClicked;
   6.123 +		}
   6.124 +
   6.125 +		protected virtual void CancelButtonClicked(object sender, System.EventArgs e)
   6.126 +		{
   6.127 +			log.Debug("Cancel clicked");
   6.128 +			Respond(ResponseType.Cancel);
   6.129 +		}	
   6.130 +
   6.131 +		protected virtual void OkayButtonClicked(object sender, System.EventArgs e)
   6.132 +		{
   6.133 +			log.Debug("Okay clicked");
   6.134 +			Respond(ResponseType.Ok);
   6.135 +		}		
   6.136 +
   6.137 +		public void SetOkayEnabledState(bool enabled)
   6.138 +		{
   6.139 +			bttnOkay.Sensitive = enabled;
   6.140 +		}
   6.141 +
   6.142 +		protected virtual void SpinButtonValueChanged(object sender, System.EventArgs e)
   6.143 +		{
   6.144 +			OnUnitEquipmentAmountChanged();
   6.145 +		}		
   6.146 +
   6.147 +		protected virtual void RadioButtonClicked(object sender, System.EventArgs e)
   6.148 +		{
   6.149 +			OnUnitEquipmentAmountTypeChanged();
   6.150 +		}
   6.151 +
   6.152 +		public void SetNumericAmountEnabledState(bool enabled)
   6.153 +		{
   6.154 +			double minPercent = GetMinPercentage();
   6.155 +			rbEquipNumeric.Sensitive = enabled && !(isRatioLimited && minPercent == 100);
   6.156 +			numericAmount.Sensitive = rbEquipNumeric.Sensitive;
   6.157 +		}		
   6.158 +
   6.159 +		public void SetPercentageAmountEnabledState(bool enabled)
   6.160 +		{
   6.161 +			if (enabled)
   6.162 +			{
   6.163 +				double minPercentage = GetMinPercentage();
   6.164 +				rbEquipPercent.Sensitive = isRatioLimited && minPercentage != 100;
   6.165 +				percentageAmount.Sensitive = rbEquipPercent.Sensitive;
   6.166 +				double maxPercentage = GetMaxPercentage();				
   6.167 +				rbEquipAll.Sensitive = isRatioLimited && maxPercentage == 100;
   6.168 +				lblEquipAll.Sensitive = rbEquipAll.Sensitive;
   6.169 +			}
   6.170 +			else
   6.171 +			{
   6.172 +				rbEquipPercent.Sensitive = false;
   6.173 +				percentageAmount.Sensitive = false;
   6.174 +				rbEquipAll.Sensitive = false;
   6.175 +				lblEquipAll.Sensitive = false;
   6.176 +			}
   6.177 +		}
   6.178 +
   6.179 +		private double GetMaxPercentage()
   6.180 +		{
   6.181 +			double min, max;
   6.182 +			percentageAmount.GetRange(out min, out max);
   6.183 +			return max;
   6.184 +		}
   6.185 +
   6.186 +		private double GetMinPercentage()
   6.187 +		{
   6.188 +			double min, max;
   6.189 +			percentageAmount.GetRange(out min, out max);
   6.190 +			return min;
   6.191 +		}		
   6.192 +
   6.193 +		public bool IsRatioEquipmentAmount
   6.194 +		{
   6.195 +			get
   6.196 +			{
   6.197 +				return !rbEquipNumeric.Active;
   6.198 +			}
   6.199 +		}
   6.200 +
   6.201 +		public int EquipmentNumericAmount
   6.202 +		{
   6.203 +			get
   6.204 +			{
   6.205 +				return (int)numericAmount.Value;
   6.206 +			}
   6.207 +			
   6.208 +			set
   6.209 +			{
   6.210 +				numericAmount.Value = value;
   6.211 +			}
   6.212 +		}
   6.213 +
   6.214 +		public double EquipmentPercentageAmount
   6.215 +		{
   6.216 +			get
   6.217 +			{
   6.218 +				double percent;
   6.219 +				
   6.220 +				if (rbEquipAll.Active)
   6.221 +				{
   6.222 +					percent = 100;
   6.223 +				}
   6.224 +				else
   6.225 +				{
   6.226 +					percent = percentageAmount.Value;
   6.227 +				}
   6.228 +				
   6.229 +				return percent;
   6.230 +			}
   6.231 +			
   6.232 +			set
   6.233 +			{
   6.234 +				percentageAmount.Value = value;
   6.235 +			}
   6.236 +		}
   6.237 +	}
   6.238 +}
   6.239 +
     7.1 --- a/FrmMainWindow.cs	Sun Jan 31 20:46:06 2010 +0000
     7.2 +++ b/FrmMainWindow.cs	Mon Jan 17 19:43:47 2011 +0000
     7.3 @@ -3,105 +3,129 @@
     7.4  // 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.
     7.5  
     7.6  using System;
     7.7 -using System.IO;
     7.8  using System.Collections.Generic;
     7.9  using System.Configuration;
    7.10 +using System.IO;
    7.11 +using GLib;
    7.12  using Gtk;
    7.13  using IBBoard;
    7.14  using IBBoard.Commands;
    7.15 +using IBBoard.CustomMath;
    7.16  using IBBoard.GtkSharp;
    7.17 +using IBBoard.GtkSharp.Translatable;
    7.18  using IBBoard.IO;
    7.19  using IBBoard.Lang;
    7.20  using IBBoard.Logging;
    7.21 -using IBBoard.CustomMath;
    7.22  using IBBoard.WarFoundry.API;
    7.23 +using IBBoard.WarFoundry.API.Commands;
    7.24  using IBBoard.WarFoundry.API.Exporters;
    7.25  using IBBoard.WarFoundry.API.Factories;
    7.26  using IBBoard.WarFoundry.API.Factories.Xml;
    7.27  using IBBoard.WarFoundry.API.Objects;
    7.28 -using IBBoard.WarFoundry.API.Commands;
    7.29 +using IBBoard.WarFoundry.API.Requirements;
    7.30  using IBBoard.WarFoundry.API.Savers;
    7.31 -using IBBoard.WarFoundry.API.Requirements;
    7.32 -using IBBoard.WarFoundry.GTK.Widgets;
    7.33 +using IBBoard.WarFoundry.GUI.GTK.Widgets;
    7.34  using IBBoard.WarFoundry.Plugin.Rollcall;
    7.35  using IBBoard.Xml;
    7.36  using log4net;
    7.37 +using WFObjects = IBBoard.WarFoundry.API.Objects;
    7.38 +using System.Collections;
    7.39  
    7.40 -namespace IBBoard.WarFoundry.GTK
    7.41 +namespace IBBoard.WarFoundry.GUI.GTK
    7.42  {
    7.43 -	public partial class FrmMainWindow: Gtk.Window
    7.44 +	public partial class FrmMainWindow: TranslatableWindowWithActions
    7.45  	{
    7.46  		private static readonly string AppTitle = "WarFoundry";
    7.47  		private const int CATEGORY_BUTTON_SEPARATOR_INDEX = 6;
    7.48 -
    7.49  		private Preferences preferences;
    7.50  		private ILog logger = LogManager.GetLogger(typeof(FrmMainWindow));
    7.51 -
    7.52  		private CommandStack commandStack;
    7.53 -		private Dictionary<ToolButton, Category> categoryMap = new Dictionary<ToolButton, Category>();
    7.54 -		private Dictionary<IBBoard.WarFoundry.API.Objects.Unit, UnitDisplayWidget> unitToWidgetMap = new Dictionary<IBBoard.WarFoundry.API.Objects.Unit,UnitDisplayWidget>();
    7.55 -
    7.56 +		private Dictionary<WFObjects.Unit, UnitDisplayWidget> unitToWidgetMap = new Dictionary<WFObjects.Unit,UnitDisplayWidget>();
    7.57  		private ObjectAddDelegate UnitAddedMethod;
    7.58  		private ObjectRemoveDelegate UnitRemovedMethod;
    7.59  		private DoubleValChangedDelegate PointsValueChangedMethod;
    7.60  		private FailedUnitRequirementDelegate FailedUnitRequirementMethod;
    7.61  		private StringValChangedDelegate UnitNameChangedMethod;
    7.62 -
    7.63  		private GameSystem system;
    7.64  		private string loadedArmyPath;
    7.65 -
    7.66  		private MenuToolButton undoMenuButton, redoMenuButton;
    7.67  
    7.68 -		public static void Main (string[] args)
    7.69 +		public static void Main(string[] args)
    7.70  		{
    7.71  			try
    7.72  			{
    7.73 +				ExceptionManager.UnhandledException += HandleUnhandledException;
    7.74  				Application.Init();
    7.75  				FrmMainWindow win = new FrmMainWindow(args);
    7.76  				win.Show();
    7.77  				Application.Run();
    7.78  				LogManager.GetLogger(typeof(FrmMainWindow)).Debug("Application ended");
    7.79  			}
    7.80 -			catch(Exception ex)
    7.81 +			catch (Exception ex)
    7.82  			{
    7.83 -				LogManager.GetLogger(typeof(FrmMainWindow)).Fatal("("+ex.GetType().Name+") "+ex.Message + Environment.NewLine + ex.StackTrace);
    7.84 +				HandleUnhandledException(ex);
    7.85  			}
    7.86  		}
    7.87  
    7.88 +		private static void HandleUnhandledException(UnhandledExceptionArgs args)
    7.89 +		{
    7.90 +			object obj = args.ExceptionObject;
    7.91 +			Exception ex = null;
    7.92 +			
    7.93 +			if (obj is Exception)
    7.94 +			{
    7.95 +				ex = (Exception)obj;
    7.96 +			}
    7.97 +			else
    7.98 +			{
    7.99 +				ex = new Exception("GLib returned unexpected exception object type " + obj.GetType());
   7.100 +			}
   7.101 +			
   7.102 +			HandleUnhandledException(ex);
   7.103 +		}
   7.104 +
   7.105 +		private static void HandleUnhandledException(Exception ex)
   7.106 +		{
   7.107 +			string msg = String.Format("({0}) {1}", ex.GetType().FullName, ex.Message);
   7.108 +			LogManager.GetLogger(typeof(FrmMainWindow)).Fatal(msg, ex);
   7.109 +			MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, false, "An unhandled exception occurred. Please check the log for more details.");
   7.110 +			dialog.Run();
   7.111 +			dialog.Hide();
   7.112 +			dialog.Dispose();
   7.113 +		}
   7.114 +
   7.115  		public FrmMainWindow() : this(new string[0])
   7.116  		{
   7.117  			//Do nothing extra
   7.118  		}
   7.119  
   7.120 -		public FrmMainWindow (string[] args): base (Gtk.WindowType.Toplevel)
   7.121 +		public FrmMainWindow(string[] args) : base(Gtk.WindowType.Toplevel)
   7.122  		{
   7.123  			logger.Info("Opening FrmMainWindow");
   7.124 -			Build ();
   7.125 +			Build();
   7.126  			//Replace the undo/redo buttons with menu versions, which Monodevelop's GUI editor doesn't currently support
   7.127  			redoMenuButton = new MenuToolButton("gtk-redo");
   7.128 -			redoMenuButton.Label = "Redo";
   7.129 -			redoMenuButton.TooltipText = "Redo";
   7.130 -			redoMenuButton.Clicked+= redoTBButtonActivated;
   7.131 +			redoMenuButton.Name = "bttnRedo";
   7.132 +			redoMenuButton.Clicked += redoTBButtonActivated;
   7.133 +			redoMenuButton.Sensitive = false;
   7.134  			toolbar.Insert(redoMenuButton, CATEGORY_BUTTON_SEPARATOR_INDEX);
   7.135  			undoMenuButton = new MenuToolButton("gtk-undo");
   7.136 -			undoMenuButton.Label = "Undo";
   7.137 -			undoMenuButton.TooltipText = "Undo";
   7.138 -			undoMenuButton.Clicked+= undoTBButtonActivated;
   7.139 +			undoMenuButton.Name = "bttnUndo";
   7.140 +			undoMenuButton.Clicked += undoTBButtonActivated;
   7.141 +			undoMenuButton.Sensitive = false;
   7.142  			toolbar.Insert(undoMenuButton, CATEGORY_BUTTON_SEPARATOR_INDEX);
   7.143 -			toolbar.Remove(toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX-1]);
   7.144 -			toolbar.Remove(toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX-2]);
   7.145 +			toolbar.Remove(toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX - 1]);
   7.146 +			toolbar.Remove(toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX - 2]);
   7.147  			toolbar.ShowAll();
   7.148  
   7.149 -			Title = AppTitle;
   7.150 -			TreeViewColumn mainColumn = new TreeViewColumn ();
   7.151 -			mainColumn.Title = "Army Categories";
   7.152 -			CellRendererText mainCell = new CellRendererText ();
   7.153 -			mainColumn.PackStart (mainCell, true);
   7.154 +			TreeViewColumn mainColumn = new TreeViewColumn();
   7.155 +			CellRendererText mainCell = new CellRendererText();
   7.156 +			mainColumn.PackStart(mainCell, true);
   7.157  			treeUnits.AppendColumn(mainColumn);
   7.158  			mainColumn.SetCellDataFunc(mainCell, new TreeCellDataFunc(RenderCategoryTreeObjectName));
   7.159  			treeUnits.Model = new TreeStore(typeof(WarFoundryObject));
   7.160  			logger.Debug("Loading preferences");
   7.161 -			Preferences = new Preferences("WarFoundryGTK");
   7.162 +			Preferences = new Preferences("WarFoundry-GTK");
   7.163  			logger.Debug("Loading translations");
   7.164  
   7.165  			try
   7.166 @@ -119,11 +143,12 @@
   7.167  
   7.168  			logger.Debug("Initialising");
   7.169  			commandStack = new CommandStack();
   7.170 -			commandStack.CommandStackUpdated+=new MethodInvoker(commandStack_CommandStackUpdated);
   7.171 -			WarFoundryCore.GameSystemChanged+= new GameSystemChangedDelegate(OnGameSystemChanged);
   7.172 -			WarFoundryCore.ArmyChanged+= new ArmyChangedDelegate(OnArmyChanged);
   7.173 -			Destroyed+= new EventHandler(OnWindowDestroyed);
   7.174 -			//TODO: Translate and subscribe to other events
   7.175 +			commandStack.CommandStackUpdated += new MethodInvoker(commandStack_CommandStackUpdated);
   7.176 +			WarFoundryCore.GameSystemChanged += new GameSystemChangedDelegate(OnGameSystemChanged);
   7.177 +			WarFoundryCore.ArmyChanged += new ArmyChangedDelegate(OnArmyChanged);
   7.178 +			Destroyed += new EventHandler(OnWindowDestroyed);
   7.179 +			Translation.TranslationChanged += Retranslate;
   7.180 +			Translate();
   7.181  			UnitAddedMethod = new ObjectAddDelegate(OnUnitAdded);
   7.182  			UnitRemovedMethod = new ObjectRemoveDelegate(OnUnitRemoved);
   7.183  			PointsValueChangedMethod = new DoubleValChangedDelegate(OnPointsValueChanged);
   7.184 @@ -159,10 +184,14 @@
   7.185  							WarFoundryCore.CurrentArmy = (Army)loadedObject;
   7.186  							logger.InfoFormat("Loaded army from {0}", file.FullName);
   7.187  						}
   7.188 -						else if (loadedObject is GameSystem)
   7.189 +						else
   7.190  						{
   7.191 -							WarFoundryCore.CurrentGameSystem = (GameSystem)loadedObject;
   7.192 -							logger.InfoFormat("Loaded game system from {0}", file.FullName);
   7.193 +							if (loadedObject is GameSystem)
   7.194 +							{
   7.195 +								WarFoundryCore.CurrentGameSystem = (GameSystem)loadedObject;
   7.196 +								logger.InfoFormat("Loaded game system from {0}", file.FullName);
   7.197 +							}
   7.198 +
   7.199  						}
   7.200  					}
   7.201  				}
   7.202 @@ -176,12 +205,12 @@
   7.203  			{
   7.204  				string gameSystemID = Preferences.GetStringProperty("currSystem");
   7.205  
   7.206 -				if (gameSystemID!=null && !"".Equals(gameSystemID))
   7.207 +				if (gameSystemID != null && !"".Equals(gameSystemID))
   7.208  				{
   7.209  					logger.Debug("Attempting to load current game system from properties");
   7.210  					GameSystem sys = WarFoundryLoader.GetDefault().GetGameSystem(gameSystemID);
   7.211  
   7.212 -					if (sys!=null)
   7.213 +					if (sys != null)
   7.214  					{
   7.215  						WarFoundryCore.CurrentGameSystem = sys;
   7.216  						logger.InfoFormat("Loaded game system {0} from properties", gameSystemID);
   7.217 @@ -190,9 +219,28 @@
   7.218  			}
   7.219  		}
   7.220  
   7.221 -		private void FileLoadingFinished (List<FileLoadFailure> failures)
   7.222 +		protected override void Translate()
   7.223  		{
   7.224 -			foreach(FileLoadFailure failure in failures)
   7.225 +			base.Translate();
   7.226 +			SetAppTitle();
   7.227 +			treeUnits.GetColumn(0).Title = Translation.GetTranslation("armyCategoryColumnTitle", "categories");
   7.228 +			RebuildUndoRedoMenus();
   7.229 +		}
   7.230 +
   7.231 +		private void Retranslate()
   7.232 +		{
   7.233 +			Translate();
   7.234 +		}
   7.235 +
   7.236 +		public override void Dispose()
   7.237 +		{
   7.238 +			Translation.TranslationChanged -= Retranslate;
   7.239 +			base.Dispose();
   7.240 +		}
   7.241 +
   7.242 +		private void FileLoadingFinished(List<FileLoadFailure> failures)
   7.243 +		{
   7.244 +			foreach (FileLoadFailure failure in failures)
   7.245  			{
   7.246  				logger.Warn("Failed to load " + failure.FailedFile.FullName + ": " + failure.Message);
   7.247  			}
   7.248 @@ -218,11 +266,15 @@
   7.249  
   7.250  				(cell as CellRendererText).Text = name;
   7.251  			}
   7.252 -			else if (o is IBBoard.WarFoundry.API.Objects.Unit)
   7.253 +			else
   7.254  			{
   7.255 -				IBBoard.WarFoundry.API.Objects.Unit u = (IBBoard.WarFoundry.API.Objects.Unit)o;
   7.256 -				string name = Translation.GetTranslation("unitTreeCatName", "{0} - {1}pts", u.Name, u.Points);
   7.257 -				(cell as CellRendererText).Text = name;
   7.258 +				if (o is WFObjects.Unit)
   7.259 +				{
   7.260 +					WFObjects.Unit u = (WFObjects.Unit)o;
   7.261 +					string name = Translation.GetTranslation("unitTreeCatName", "{0} - {1}pts", u.Name, u.Points);
   7.262 +					(cell as CellRendererText).Text = name;
   7.263 +				}
   7.264 +
   7.265  			}
   7.266  		}
   7.267  
   7.268 @@ -234,24 +286,33 @@
   7.269  
   7.270  		private void OnUnitNameChanged(WarFoundryObject val, string oldValue, string newValue)
   7.271  		{
   7.272 -			IBBoard.WarFoundry.API.Objects.Unit unit = (IBBoard.WarFoundry.API.Objects.Unit)val;
   7.273 +			WFObjects.Unit unit = (WFObjects.Unit)val;
   7.274 +			logger.DebugFormat("Unit name changed for {0} - now called {1}", unit.ID, unit.Name);
   7.275  			UnitDisplayWidget widget;
   7.276  			unitToWidgetMap.TryGetValue(unit, out widget);
   7.277 -
   7.278 -			if (widget!=null)
   7.279 +			
   7.280 +			if (widget != null)
   7.281  			{
   7.282 -				unitsNotebook.SetTabLabel(widget, NotebookUtil.CreateNotebookTabLabelWithClose(unitsNotebook, widget, newValue));
   7.283 +				unitsNotebook.SetTabLabel(widget, NotebookUtil.CreateNotebookTabLabelWithClose(unitsNotebook, widget, unit.Name));
   7.284  			}
   7.285 +			
   7.286 +			treeUnits.QueueDraw();
   7.287  		}
   7.288  
   7.289  		private void OnUnitAdded(WarFoundryObject val)
   7.290  		{
   7.291 -			IBBoard.WarFoundry.API.Objects.Unit unit = (IBBoard.WarFoundry.API.Objects.Unit)val;
   7.292 -			unit.NameChanged+= UnitNameChangedMethod;
   7.293 +			WFObjects.Unit unit = (WFObjects.Unit)val;
   7.294 +			unit.NameChanged += UnitNameChangedMethod;
   7.295 +			unit.PointsValueChanged += HandleUnitPointsValueChanged;
   7.296  			AddUnitToTree(unit);
   7.297  		}
   7.298  
   7.299 -		private void AddUnitToTree(IBBoard.WarFoundry.API.Objects.Unit unit)
   7.300 +		private void HandleUnitPointsValueChanged(WarFoundryObject obj, double oldValue, double newValue)
   7.301 +		{			
   7.302 +			treeUnits.QueueDraw();
   7.303 +		}
   7.304 +
   7.305 +		private void AddUnitToTree(WFObjects.Unit unit)
   7.306  		{
   7.307  			TreeStore model = (TreeStore)treeUnits.Model;
   7.308  			TreeIter iter;
   7.309 @@ -278,14 +339,13 @@
   7.310  
   7.311  		private void OnUnitRemoved(WarFoundryObject obj)
   7.312  		{
   7.313 -			IBBoard.WarFoundry.API.Objects.Unit unit = (IBBoard.WarFoundry.API.Objects.Unit)obj;
   7.314 -			unit.NameChanged-= UnitNameChangedMethod;
   7.315 +			WFObjects.Unit unit = (WFObjects.Unit)obj;
   7.316 +			unit.NameChanged -= UnitNameChangedMethod;
   7.317  			RemoveUnitFromTree(unit);
   7.318 -
   7.319 -			//See if unit has a tab open and close it if it does
   7.320 +			RemoveUnitTab(unit);
   7.321  		}
   7.322  
   7.323 -		private void RemoveUnitFromTree(IBBoard.WarFoundry.API.Objects.Unit unit)
   7.324 +		private void RemoveUnitFromTree(WFObjects.Unit unit)
   7.325  		{
   7.326  			TreeStore model = (TreeStore)treeUnits.Model;
   7.327  			TreeIter iter;
   7.328 @@ -328,9 +388,19 @@
   7.329  			while (model.IterNext(ref iter));
   7.330  		}
   7.331  
   7.332 +		private void RemoveUnitTab(WFObjects.Unit unit)
   7.333 +		{
   7.334 +			UnitDisplayWidget widget = DictionaryUtils.GetValue(unitToWidgetMap, unit);
   7.335 +			
   7.336 +			if (widget != null)
   7.337 +			{
   7.338 +				unitsNotebook.Remove(widget);
   7.339 +			}
   7.340 +		}
   7.341 +
   7.342  		private void OnPointsValueChanged(WarFoundryObject obj, double before, double after)
   7.343  		{
   7.344 -			//Set points in panel
   7.345 +			SetPointsPanelText();
   7.346  		}
   7.347  
   7.348  		private void OnFailedUnitRequirement(List<FailedUnitRequirement> failedRequirement)
   7.349 @@ -344,14 +414,9 @@
   7.350  			set { preferences = value; }
   7.351  		}
   7.352  
   7.353 -		/*public AbstractNativeWarFoundryFactory Factory
   7.354 +		protected void OnDeleteEvent(object sender, DeleteEventArgs a)
   7.355  		{
   7.356 -			get { return WarFoundryFactoryFactory.GetFactoryFactory().GetFactory(Constants.ExecutablePath, factoryType); }
   7.357 -		}*/
   7.358 -
   7.359 -		protected void OnDeleteEvent (object sender, DeleteEventArgs a)
   7.360 -		{
   7.361 -			Application.Quit ();
   7.362 +			Application.Quit();
   7.363  			a.RetVal = true;
   7.364  		}
   7.365  
   7.366 @@ -367,6 +432,7 @@
   7.367  
   7.368  		protected virtual void OnReloadFilesActivated(object sender, System.EventArgs e)
   7.369  		{
   7.370 +			WarFoundryLoader.GetDefault().LoadFiles();
   7.371  		}
   7.372  
   7.373  		protected virtual void OnSaveArmyAsActivated(object sender, System.EventArgs e)
   7.374 @@ -393,20 +459,21 @@
   7.375  		{
   7.376  			if (sender is ToolButton)
   7.377  			{
   7.378 -				Category cat = null;
   7.379 -				categoryMap.TryGetValue((ToolButton)sender, out cat);
   7.380 +				ToolButton toolButton = (ToolButton)sender;
   7.381 +				Category cat = (Category)toolButton.Data["Category"];
   7.382  
   7.383 -				if (cat!=null)
   7.384 +				if (cat != null)
   7.385  				{
   7.386  					logger.DebugFormat("Show FrmNewUnit for {0}", cat.Name);
   7.387  					FrmNewUnit newUnit = new FrmNewUnit(WarFoundryCore.CurrentArmy.Race, cat, WarFoundryCore.CurrentArmy);
   7.388  					ResponseType response = (ResponseType)newUnit.Run();
   7.389  					newUnit.Hide();
   7.390  
   7.391 -					if (response==ResponseType.Ok)
   7.392 +					if (response == ResponseType.Ok)
   7.393  					{
   7.394  						CreateAndAddUnitCommand cmd = new CreateAndAddUnitCommand(newUnit.SelectedUnit, WarFoundryCore.CurrentArmy.GetCategory(cat));
   7.395  						commandStack.Execute(cmd);
   7.396 +						ShowUnitWidget(cmd.Unit);
   7.397  					}
   7.398  
   7.399  					newUnit.Dispose();
   7.400 @@ -421,17 +488,21 @@
   7.401  
   7.402  		private void SetAppTitle()
   7.403  		{
   7.404 -			if (WarFoundryCore.CurrentArmy!=null)
   7.405 +			if (WarFoundryCore.CurrentArmy != null)
   7.406  			{
   7.407  				Title = AppTitle + " - " + WarFoundryCore.CurrentGameSystem.Name + " - " + WarFoundryCore.CurrentArmy.Name;
   7.408  			}
   7.409 -			else if (WarFoundryCore.CurrentGameSystem!=null)
   7.410 -			{
   7.411 -				Title = AppTitle + " - " + WarFoundryCore.CurrentGameSystem.Name;
   7.412 -			}
   7.413  			else
   7.414  			{
   7.415 -				Title = AppTitle;
   7.416 +				if (WarFoundryCore.CurrentGameSystem != null)
   7.417 +				{
   7.418 +					Title = AppTitle + " - " + WarFoundryCore.CurrentGameSystem.Name;
   7.419 +				}
   7.420 +				else
   7.421 +				{
   7.422 +					Title = AppTitle;
   7.423 +				}
   7.424 +
   7.425  			}
   7.426  		}
   7.427  
   7.428 @@ -441,7 +512,7 @@
   7.429  			SetAppTitle();
   7.430  			RemoveCategoryButtons();
   7.431  
   7.432 -			if (system!=null)
   7.433 +			if (system != null)
   7.434  			{
   7.435  				AddCategoryButtons(system.Categories);
   7.436  			}
   7.437 @@ -453,12 +524,12 @@
   7.438  			SetAppTitle();
   7.439  			SetArmyTree(newArmy);
   7.440  
   7.441 -			if (oldArmy!=null)
   7.442 +			if (oldArmy != null)
   7.443  			{
   7.444 -				oldArmy.UnitAdded-= UnitAddedMethod;
   7.445 -				oldArmy.UnitRemoved-= UnitRemovedMethod;
   7.446 -				oldArmy.PointsValueChanged-= PointsValueChangedMethod;
   7.447 -				oldArmy.FailedRequirement-=FailedUnitRequirementMethod;
   7.448 +				oldArmy.UnitAdded -= UnitAddedMethod;
   7.449 +				oldArmy.UnitRemoved -= UnitRemovedMethod;
   7.450 +				oldArmy.PointsValueChanged -= PointsValueChangedMethod;
   7.451 +				oldArmy.FailedRequirement -= FailedUnitRequirementMethod;
   7.452  			}
   7.453  
   7.454  			unitToWidgetMap.Clear();
   7.455 @@ -468,16 +539,16 @@
   7.456  				unitsNotebook.RemovePage(0);
   7.457  			}
   7.458  
   7.459 -			if (newArmy==null)
   7.460 +			if (newArmy == null)
   7.461  			{
   7.462  				DisableCategoryButtons();
   7.463  			}
   7.464  			else
   7.465  			{
   7.466 -				newArmy.UnitAdded+= UnitAddedMethod;
   7.467 -				newArmy.UnitRemoved+= UnitRemovedMethod;
   7.468 -				newArmy.PointsValueChanged+= PointsValueChangedMethod;
   7.469 -				newArmy.FailedRequirement+=FailedUnitRequirementMethod;
   7.470 +				newArmy.UnitAdded += UnitAddedMethod;
   7.471 +				newArmy.UnitRemoved += UnitRemovedMethod;
   7.472 +				newArmy.PointsValueChanged += PointsValueChangedMethod;
   7.473 +				newArmy.FailedRequirement += FailedUnitRequirementMethod;
   7.474  				//TODO: Clear all buttons
   7.475  				EnableCategoryButtons();
   7.476  
   7.477 @@ -488,13 +559,15 @@
   7.478  				}
   7.479  			}
   7.480  
   7.481 -			miCloseArmy.Sensitive = newArmy!=null;
   7.482 -			miSaveArmyAs.Sensitive = newArmy!=null;
   7.483 -			miExportArmy.Sensitive = newArmy!=null;
   7.484 +			bool nonNullNewArmy = (newArmy != null);
   7.485 +			miCloseArmy.Sensitive = nonNullNewArmy;
   7.486 +			miSaveArmyAs.Sensitive = nonNullNewArmy;
   7.487 +			miExportArmyAs.Sensitive = nonNullNewArmy;
   7.488 +			hpaned2.Visible = nonNullNewArmy;
   7.489  			loadedArmyPath = null;
   7.490  			//New army has no changes, so we can't save it
   7.491  			miSaveArmy.Sensitive = false;
   7.492 -			saveArmyButton.Sensitive = false;
   7.493 +			bttnSaveArmy.Sensitive = false;
   7.494  
   7.495  			CommandStack.Reset();
   7.496  			SetPointsPanelText();
   7.497 @@ -507,7 +580,7 @@
   7.498  			store.Clear();
   7.499  			TreeIter iter;
   7.500  
   7.501 -			if (army!=null)
   7.502 +			if (army != null)
   7.503  			{
   7.504  				logger.Debug("Loading in categories to tree");
   7.505  
   7.506 @@ -516,7 +589,7 @@
   7.507  					logger.DebugFormat("Append category {0}", cat.Name);
   7.508  					iter = store.AppendValues(cat);
   7.509  
   7.510 -					foreach (IBBoard.WarFoundry.API.Objects.Unit unit in cat.GetUnits())
   7.511 +					foreach (WFObjects.Unit unit in cat.GetUnits())
   7.512  					{
   7.513  						store.AppendValues(iter, unit);
   7.514  					}
   7.515 @@ -539,7 +612,7 @@
   7.516  		private void SetCategoryButtonsSensitive(bool state)
   7.517  		{
   7.518  			int toolbarButtonCount = toolbar.Children.Length - 1;
   7.519 -			logger.Debug("Last button index: "+toolbarButtonCount);
   7.520 +			logger.Debug("Last button index: " + toolbarButtonCount);
   7.521  
   7.522  			for (int i = toolbarButtonCount; i > CATEGORY_BUTTON_SEPARATOR_INDEX; i--)
   7.523  			{
   7.524 @@ -556,13 +629,11 @@
   7.525  			{
   7.526  				toolbar.Remove(toolbar.Children[i]);
   7.527  			}
   7.528 -
   7.529 -			categoryMap.Clear();
   7.530  		}
   7.531  
   7.532  		private void AddCategoryButtons(Category[] cats)
   7.533  		{
   7.534 -			if (cats!=null && cats.Length > 0)
   7.535 +			if (cats != null && cats.Length > 0)
   7.536  			{
   7.537  				logger.DebugFormat("Toolbar button count: {0}. Adding {1} categories.", toolbar.Children.Length, cats.Length);
   7.538  
   7.539 @@ -570,22 +641,28 @@
   7.540  				{
   7.541  					ToolButton button = new ToolButton("gtk-add");
   7.542  					button.Label = cat.Name;
   7.543 -					button.TooltipText = "Add unit from "+cat.Name;
   7.544 -					//TODO: See if we can associate data in some way, the same as we can with SWF. For now we just use the map.
   7.545 -					categoryMap.Add(button, cat);
   7.546 -					button.Clicked+= new System.EventHandler(OnAddUnitActivated);
   7.547 +					button.TooltipText = Translation.GetTranslation("bttnCreateFromCat", "{0}", cat.Name);
   7.548 +					button.Data["Category"] = cat;
   7.549 +					button.Clicked += new System.EventHandler(OnAddUnitActivated);
   7.550  					toolbar.Insert(button, -1);
   7.551  				}
   7.552  			}
   7.553  
   7.554 -			toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX].Visible = cats!=null && cats.Length>0;
   7.555 +			toolbar.Children[CATEGORY_BUTTON_SEPARATOR_INDEX].Visible = cats != null && cats.Length > 0;
   7.556  
   7.557  			toolbar.ShowAll();
   7.558  		}
   7.559  
   7.560  		private void SetPointsPanelText()
   7.561  		{
   7.562 -			//TODO: Set the points value in the status bar
   7.563 +			if (WarFoundryCore.CurrentArmy != null)
   7.564 +			{
   7.565 +				lblTotalPoints.Text = Translation.GetTranslation("statusPanelPoints", "{0}pts of {1} pts", WarFoundryCore.CurrentArmy.Points, WarFoundryCore.CurrentArmy.MaxPoints);
   7.566 +			}
   7.567 +			else
   7.568 +			{
   7.569 +				lblTotalPoints.Text = "";
   7.570 +			}
   7.571  		}
   7.572  
   7.573  		private void commandStack_CommandStackUpdated()
   7.574 @@ -594,85 +671,115 @@
   7.575  			miUndo.Sensitive = undoMenuButton.Sensitive;
   7.576  			redoMenuButton.Sensitive = commandStack.CanRedo();
   7.577  			miRedo.Sensitive = redoMenuButton.Sensitive;
   7.578 +
   7.579 +			RebuildUndoRedoMenus();
   7.580 +
   7.581 +			bttnSaveArmy.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null;
   7.582 +			miSaveArmy.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy != null;
   7.583 +		}
   7.584 +
   7.585 +		private void RebuildUndoRedoMenus()
   7.586 +		{
   7.587  			int redoLength = commandStack.RedoLength;
   7.588 -			//TODO: Build menus for undo/redo and find way of adding tooltips
   7.589 -			/*int maxRedo = Math.Min(10, redoLength);
   7.590 -			MenuItem[] menuItems = null;
   7.591 -
   7.592 +			int maxRedo = Math.Min(10, redoLength);
   7.593 +			
   7.594  			if (redoLength > 0)
   7.595  			{
   7.596 -				menuItems = new MenuItem[maxRedo];
   7.597 +				Menu menu = new Menu();
   7.598  				Command com;
   7.599  				MenuItem mi;
   7.600 -
   7.601 +			
   7.602  				for (int i = 0; i < maxRedo; i++)
   7.603  				{
   7.604 -					com = commandStack.PeekRedoCommand(i+1);
   7.605 -
   7.606 +					com = commandStack.PeekRedoCommand(i + 1);
   7.607 +			
   7.608  					if (com == null)
   7.609  					{
   7.610  						break;
   7.611  					}
   7.612 -
   7.613 +			
   7.614  					mi = new MenuItem(com.Description);
   7.615 -					mi.Click+=new EventHandler(redoMenu_Click);
   7.616 -					menuItems[i] = mi;
   7.617 +					mi.Activated += new EventHandler(RedoMenuActivated);
   7.618 +					menu.Append(mi);
   7.619  				}
   7.620 +				
   7.621 +				menu.ShowAll();
   7.622 +				redoMenuButton.Menu = menu;
   7.623  			}
   7.624 -
   7.625 -			redoMenu.MenuItems.Clear();
   7.626 -
   7.627 -			if (menuItems!=null && menuItems[0]!=null)
   7.628 +			else
   7.629  			{
   7.630 -				bttnRedo.ToolTipText = menuItems[0].Text;
   7.631 -				redoMenu.MenuItems.AddRange(menuItems);
   7.632 -			}*/
   7.633 -			//TODO: Put above code back when we have a dropdown version of the redo button
   7.634 -			if (redoLength > 0)
   7.635 -			{
   7.636 -				//redoMenuButton.Tooltip = CommandStack.PeekRedoCommand().Description;
   7.637 +				redoMenuButton.Menu = null;
   7.638  			}
   7.639 -
   7.640 +			
   7.641  			int undoLength = commandStack.UndoLength;
   7.642 -			/*int maxUndo = Math.Min(10, undoLength);
   7.643 -			MenuItem[] menuItemsUndo = null;
   7.644 -
   7.645 +			int maxUndo = Math.Min(10, undoLength);
   7.646 +			
   7.647  			if (undoLength > 0)
   7.648  			{
   7.649 -				menuItemsUndo = new MenuItem[maxUndo];
   7.650 +				Menu menu = new Menu();
   7.651  				Command com;
   7.652  				MenuItem mi;
   7.653 -
   7.654 +			
   7.655  				for (int i = 0; i < maxUndo; i++)
   7.656  				{
   7.657 -					com = commandStack.PeekUndoCommand(i+1);
   7.658 -
   7.659 +					com = commandStack.PeekUndoCommand(i + 1);
   7.660 +			
   7.661  					if (com == null)
   7.662  					{
   7.663  						break;
   7.664  					}
   7.665 +			
   7.666 +					mi = new MenuItem(com.UndoDescription);
   7.667 +					mi.Activated += new EventHandler(UndoMenuActivated);
   7.668 +					menu.Add(mi);
   7.669 +				}
   7.670 +				
   7.671 +				menu.ShowAll();
   7.672 +				undoMenuButton.Menu = menu;
   7.673 +			}
   7.674 +			else
   7.675 +			{
   7.676 +				undoMenuButton.Menu = null;
   7.677 +			}
   7.678 +		}
   7.679  
   7.680 -					mi = new MenuItem(com.UndoDescription);
   7.681 -					mi.Click+=new EventHandler(undoMenu_Click);
   7.682 -					menuItemsUndo[i] = mi;
   7.683 +		private void RedoMenuActivated(object sender, EventArgs e)
   7.684 +		{
   7.685 +			if (sender is MenuItem)
   7.686 +			{
   7.687 +				MenuItem item = (MenuItem)sender;
   7.688 +				//we know it's an redo menu item so find it's index and redo everything
   7.689 +				
   7.690 +				int max = Arrays.IndexOf(((Menu)redoMenuButton.Menu).Children, item);
   7.691 +				
   7.692 +				if (max >= 0)
   7.693 +				{
   7.694 +					for (int i = 0; i <= max; i++)
   7.695 +					{
   7.696 +						commandStack.Redo();
   7.697 +					}
   7.698  				}
   7.699  			}
   7.700 +		}
   7.701  
   7.702 -			undoMenu.MenuItems.Clear();
   7.703 -
   7.704 -			if (menuItemsUndo!=null && menuItemsUndo[0]!=null)
   7.705 +		private void UndoMenuActivated(object sender, EventArgs e)
   7.706 +		{
   7.707 +			if (sender is MenuItem)
   7.708  			{
   7.709 -				bttnUndo.ToolTipText = menuItemsUndo[0].Text;
   7.710 -				undoMenu.MenuItems.AddRange(menuItemsUndo);
   7.711 -			}*/
   7.712 -			//TODO: Put above code back when we have a dropdown version of the undo button
   7.713 -			if (undoLength > 0)
   7.714 -			{
   7.715 -				//undoMenuButton.Tooltip = CommandStack.PeekUndoCommand().UndoDescription;
   7.716 +				
   7.717 +				MenuItem item = (MenuItem)sender;
   7.718 +				//we know it's an undo menu item so find it's index and undo everything
   7.719 +				
   7.720 +				int max = Arrays.IndexOf(((Menu)undoMenuButton.Menu).Children, item);
   7.721 +				
   7.722 +				if (max >= 0)
   7.723 +				{
   7.724 +					for (int i = 0; i <= max; i++)
   7.725 +					{
   7.726 +						commandStack.Undo();
   7.727 +					}
   7.728 +				}
   7.729  			}
   7.730 -
   7.731 -			saveArmyButton.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy!=null;
   7.732 -			miSaveArmy.Sensitive = commandStack.IsDirty() && WarFoundryCore.CurrentArmy!=null;
   7.733  		}
   7.734  
   7.735  		private bool SaveCurrentArmyOrSaveAs()
   7.736 @@ -689,10 +796,13 @@
   7.737  
   7.738  		private bool OpenArmy()
   7.739  		{
   7.740 -			FileChooserDialog fileDialog = new FileChooserDialog("Open army", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept);
   7.741 +			string title = Translation.GetTranslation("openArmyDialog", "open army");
   7.742 +			string cancelText = Translation.GetTranslation("bttnCancel", "cancel");
   7.743 +			string openText = Translation.GetTranslation("bttnOpen", "open");
   7.744 +			FileChooserDialog fileDialog = new FileChooserDialog(title, this, FileChooserAction.Open, cancelText, ResponseType.Cancel, openText, ResponseType.Accept);
   7.745  			FileFilter filter = new FileFilter();
   7.746  			filter.AddPattern("*.army");
   7.747 -			filter.Name = "WarFoundry Army files (*.army)";
   7.748 +			filter.Name = Translation.GetTranslation("armyFileFilter", "WarFoundry .army files");
   7.749  			fileDialog.AddFilter(filter);
   7.750  			int response = fileDialog.Run();
   7.751  			string filePath = null;
   7.752 @@ -710,7 +820,16 @@
   7.753  			if (filePath != null)
   7.754  			{
   7.755  				FileInfo file = new FileInfo(filePath);
   7.756 -				Army army = WarFoundryLoader.GetDefault().LoadArmy(file);
   7.757 +				Army army = null;
   7.758 +
   7.759 +				try
   7.760 +				{
   7.761 +					army = WarFoundryLoader.GetDefault().LoadArmy(file);
   7.762 +				}
   7.763 +				catch (Exception ex)
   7.764 +				{
   7.765 +					logger.Error("Error while loading army file " + filePath, ex);
   7.766 +				}
   7.767  
   7.768  				if (army != null)
   7.769  				{
   7.770 @@ -722,9 +841,8 @@
   7.771  				}
   7.772  				else
   7.773  				{
   7.774 -					logger.ErrorFormat("Failed to load {0} as an army file", filePath);
   7.775 -					MessageDialog dialog = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, file.Name + " could not be loaded.\n\nIf the file is an army file then please check your file loaders.");
   7.776 -					dialog.Title = "Failed to open army";
   7.777 +					MessageDialog dialog = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, Translation.GetTranslation("OpenFailed", "File open failed. Please check log file"));
   7.778 +					dialog.Title = Translation.GetTranslation("OpenFailedTitle", "File open failed");
   7.779  					dialog.Run();
   7.780  					dialog.Hide();
   7.781  					dialog.Dispose();
   7.782 @@ -742,7 +860,7 @@
   7.783  		{
   7.784  			bool success = false;
   7.785  
   7.786 -			if (loadedArmyPath!=null)
   7.787 +			if (loadedArmyPath != null)
   7.788  			{
   7.789  				success = SaveArmyToPath(WarFoundryCore.CurrentArmy, loadedArmyPath);
   7.790  			}
   7.791 @@ -752,10 +870,13 @@
   7.792  
   7.793  		private bool SaveCurrentArmyAs()
   7.794  		{
   7.795 -			FileChooserDialog fileDialog = new FileChooserDialog("Save file as", this, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Save", ResponseType.Accept);
   7.796 +			string title = Translation.GetTranslation("saveArmyDialog", "save army");
   7.797 +			string cancelText = Translation.GetTranslation("bttnCancel", "cancel");
   7.798 +			string saveText = Translation.GetTranslation("bttnSave", "save");
   7.799 +			FileChooserDialog fileDialog = new FileChooserDialog(title, this, FileChooserAction.Save, cancelText, ResponseType.Cancel, saveText, ResponseType.Accept);
   7.800  			FileFilter filter = new FileFilter();
   7.801  			filter.AddPattern("*.army");
   7.802 -			filter.Name = "WarFoundry Army files (*.army)";
   7.803 +			filter.Name = Translation.GetTranslation("armyFileFilter", "WarFoundry .army files");
   7.804  			fileDialog.AddFilter(filter);
   7.805  			int response = fileDialog.Run();
   7.806  			string filePath = null;
   7.807 @@ -770,25 +891,36 @@
   7.808  			
   7.809  			return SaveArmyToPath(WarFoundryCore.CurrentArmy, filePath);
   7.810  		}
   7.811 -		
   7.812 +
   7.813  		private bool SaveArmyToPath(Army army, string filePath)
   7.814  		{
   7.815  			bool success = false;
   7.816  			
   7.817 -			if (filePath!=null)
   7.818 +			if (filePath != null)
   7.819  			{
   7.820 -				if (WarFoundrySaver.GetSaver().Save(WarFoundryCore.CurrentArmy, filePath))
   7.821 +				bool saveSuccess = false;
   7.822 +
   7.823 +				try
   7.824 +				{
   7.825 +					saveSuccess = WarFoundrySaver.GetSaver().Save(WarFoundryCore.CurrentArmy, filePath);
   7.826 +				}
   7.827 +				catch (Exception ex)
   7.828 +				{
   7.829 +					logger.Error("Error while saving army file to " + filePath, ex);
   7.830 +				}
   7.831 +
   7.832 +				if (saveSuccess)
   7.833  				{
   7.834  					miSaveArmy.Sensitive = false;
   7.835 -					saveArmyButton.Sensitive = false;
   7.836 +					bttnSaveArmy.Sensitive = false;
   7.837  					CommandStack.setCleanMark();
   7.838  					loadedArmyPath = filePath;
   7.839  					success = true;
   7.840  				}
   7.841  				else
   7.842  				{
   7.843 -					MessageDialog dialog = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, "Failed to save file to "+filePath);
   7.844 -					dialog.Title = "Army save failed";
   7.845 +					MessageDialog dialog = new MessageDialog(this, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok,  Translation.GetTranslation("SaveFailed", "File save failed. Please check log file"));
   7.846 +					dialog.Title = Translation.GetTranslation("SaveFailedTitle", "File save failed");
   7.847  					dialog.Run();
   7.848  					dialog.Hide();
   7.849  					dialog.Dispose();
   7.850 @@ -801,13 +933,20 @@
   7.851  
   7.852  		private bool CloseCurrentArmy()
   7.853  		{
   7.854 -			if (WarFoundryCore.CurrentArmy!=null)
   7.855 +			if (WarFoundryCore.CurrentArmy != null)
   7.856  			{
   7.857  				bool canClose = false;
   7.858  
   7.859  				if (CommandStack.IsDirty())
   7.860  				{
   7.861 -					MessageDialog dia  = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.YesNo, "The army \""+WarFoundryCore.CurrentArmy.Name+"\" has been modified.\r\nSave changes before closing army?");
   7.862 +					string message = Translation.GetTranslation("SaveChangesQuestion", "Save changes to army before closing?", WarFoundryCore.CurrentArmy.Name);
   7.863 +					MessageDialog dia = new MessageDialog(this, DialogFlags.DestroyWithParent, MessageType.Question, ButtonsType.None, message);
   7.864 +					dia.AddButton(Translation.GetTranslation("bttnDiscard", "lose changes"), ResponseType.No);
   7.865 +					Button button = (Button)dia.AddButton(Translation.GetTranslation("bttnCancel", "cancel"), ResponseType.Cancel);
   7.866 +					button.Image = new Image("gtk-cancel", IconSize.Button);
   7.867 +					button = (Button)dia.AddButton(Translation.GetTranslation("bttnSave", "save"), ResponseType.Yes);
   7.868 +					button.Image = new Image("gtk-save", IconSize.Button);
   7.869 +					dia.Title = Translation.GetTranslation("SaveChangesTitle", "Save changes?");
   7.870  					ResponseType dr = (ResponseType)dia.Run();
   7.871  					dia.Hide();
   7.872  					dia.Dispose();
   7.873 @@ -818,15 +957,19 @@
   7.874  						//If they cancel the save as then assume they don't want to close
   7.875  						canClose = SaveCurrentArmyOrSaveAs();
   7.876  					}
   7.877 -					else if (dr == ResponseType.No)
   7.878 -					{
   7.879 -						//They don't care about their changes
   7.880 -						canClose = true;
   7.881 -					}
   7.882  					else
   7.883  					{
   7.884 -						//Assume cancel or close with the X button
   7.885 -						canClose = false;
   7.886 +						if (dr == ResponseType.No)
   7.887 +						{
   7.888 +							//They don't care about their changes
   7.889 +							canClose = true;
   7.890 +						}
   7.891 +						else
   7.892 +						{
   7.893 +							//Assume cancel or close with the X button
   7.894 +							canClose = false;
   7.895 +						}
   7.896 +
   7.897  					}
   7.898  				}
   7.899  				else
   7.900 @@ -875,75 +1018,74 @@
   7.901  			newArmy.Destroy();
   7.902  		}
   7.903  
   7.904 -		protected virtual void undoTBButtonActivated (object sender, System.EventArgs e)
   7.905 +		protected virtual void undoTBButtonActivated(object sender, System.EventArgs e)
   7.906  		{
   7.907  			CommandStack.Undo();
   7.908  		}
   7.909  
   7.910 -		protected virtual void redoTBButtonActivated (object sender, System.EventArgs e)
   7.911 +		protected virtual void redoTBButtonActivated(object sender, System.EventArgs e)
   7.912  		{
   7.913  			CommandStack.Redo();
   7.914  		}
   7.915  
   7.916 -		protected virtual void saveTBButtonActivated (object sender, System.EventArgs e)
   7.917 +		protected virtual void saveTBButtonActivated(object sender, System.EventArgs e)
   7.918  		{
   7.919  			SaveCurrentArmyOrSaveAs();
   7.920  		}
   7.921  
   7.922 -		protected virtual void openTBButtonActivated (object sender, System.EventArgs e)
   7.923 +		protected virtual void openTBButtonActivated(object sender, System.EventArgs e)
   7.924  		{
   7.925  			OpenArmy();
   7.926  		}
   7.927  
   7.928 -		protected virtual void newTBButtonActivated (object sender, System.EventArgs e)
   7.929 +		protected virtual void newTBButtonActivated(object sender, System.EventArgs e)
   7.930  		{
   7.931  			CreateNewArmy();
   7.932  		}
   7.933  
   7.934 -		protected virtual void ArmyRowActivated (object o, Gtk.RowActivatedArgs args)
   7.935 +		protected virtual void ArmyRowActivated(object o, Gtk.RowActivatedArgs args)
   7.936  		{
   7.937  			object obj = TreeUtils.GetItemAtPath(treeUnits, args.Path);
   7.938  
   7.939 -			if (obj is IBBoard.WarFoundry.API.Objects.Unit)
   7.940 +			if (obj is WFObjects.Unit)
   7.941  			{
   7.942 -				IBBoard.WarFoundry.API.Objects.Unit unit = (IBBoard.WarFoundry.API.Objects.Unit)obj;
   7.943 -
   7.944 -				UnitDisplayWidget widget;
   7.945 -				unitToWidgetMap.TryGetValue(unit, out widget);
   7.946 -
   7.947 -				if (widget!=null)
   7.948 -				{
   7.949 -					logger.DebugFormat("Selecting existing page for "+unit.Name);
   7.950 -					unitsNotebook.Page = unitsNotebook.PageNum(widget);
   7.951 -				}
   7.952 -				else
   7.953 -				{
   7.954 -					widget = new UnitDisplayWidget(unit, CommandStack);
   7.955 -					logger.Debug("Adding page for "+unit.Name);
   7.956 -					unitToWidgetMap[unit] = widget;
   7.957 -					widget.Destroyed+= new EventHandler(UnitWidgetDestroyed);
   7.958 -					int pageNum = NotebookUtil.AddPageToNotebookWithCloseButton(unitsNotebook, widget, unit.Name);
   7.959 -					logger.Debug("Page added at index "+pageNum);
   7.960 -					unitsNotebook.ShowAll();
   7.961 -					unitsNotebook.Page = pageNum;
   7.962 -				}
   7.963 +				WFObjects.Unit unit = (WFObjects.Unit)obj;
   7.964 +				ShowUnitWidget(unit);
   7.965  			}
   7.966  		}
   7.967  
   7.968 -		private void UnitWidgetDestroyed(object sender, EventArgs e)
   7.969 +		private void ShowUnitWidget(WFObjects.Unit unit)
   7.970  		{
   7.971 -			if (sender is UnitDisplayWidget)
   7.972 +			UnitDisplayWidget widget;
   7.973 +			unitToWidgetMap.TryGetValue(unit, out widget);
   7.974 +
   7.975 +			if (widget != null)
   7.976  			{
   7.977 -				unitToWidgetMap.Remove(((UnitDisplayWidget)sender).Unit);
   7.978 +				logger.DebugFormat("Selecting existing page for " + unit.Name);
   7.979 +				unitsNotebook.Page = unitsNotebook.PageNum(widget);
   7.980 +			}
   7.981 +			else
   7.982 +			{
   7.983 +				widget = new UnitDisplayWidget(unit, CommandStack);
   7.984 +				logger.Debug("Adding page for " + unit.Name);
   7.985 +				unitToWidgetMap[unit] = widget;
   7.986 +				int pageNum = NotebookUtil.AddPageToNotebookWithCloseButton(unitsNotebook, widget, unit.Name);
   7.987 +				logger.Debug("Page added at index " + pageNum);
   7.988 +				unitsNotebook.ShowAll();
   7.989 +				unitsNotebook.CurrentPage = pageNum;
   7.990 +				unitsNotebook.SetTabReorderable(widget, true);
   7.991  			}
   7.992  		}
   7.993  
   7.994 -		protected virtual void OnMiExportAsBasicHtmlActivated (object sender, System.EventArgs e)
   7.995 +		protected virtual void OnMiExportAsBasicHtmlActivated(object sender, System.EventArgs e)
   7.996  		{
   7.997 -			FileChooserDialog fileDialog = new FileChooserDialog("Export army", this, FileChooserAction.Save, "Cancel", ResponseType.Cancel, "Export", ResponseType.Accept);
   7.998 +			string exportArmyTitle = Translation.GetTranslation("exportBasicHtmlDialogTitle", "export army");
   7.999 +			string cancelText = Translation.GetTranslation("exportBasicHtmlCancel", "cancel");
  7.1000 +			string exportText = Translation.GetTranslation("exportBasicHtmlExport", "export");
  7.1001 +			FileChooserDialog fileDialog = new FileChooserDialog(exportArmyTitle, this, FileChooserAction.Save, cancelText, ResponseType.Cancel, exportText, ResponseType.Accept);
  7.1002  			FileFilter filter = new FileFilter();
  7.1003  			filter.AddPattern("*.html");
  7.1004 -			filter.Name = "HTML pages (*.html)";
  7.1005 +			filter.Name = Translation.GetTranslation("exportBasicHtmlHtmlFilter", "HTML pages (*.html)");
  7.1006  			fileDialog.AddFilter(filter);
  7.1007  			int response = fileDialog.Run();
  7.1008  			string filePath = null;
  7.1009 @@ -964,16 +1106,16 @@
  7.1010  			}
  7.1011  		}
  7.1012  
  7.1013 -		protected virtual void OnTreeUnitsPopupMenu (object o, Gtk.PopupMenuArgs args)
  7.1014 +		protected virtual void OnTreeUnitsPopupMenu(object o, Gtk.PopupMenuArgs args)
  7.1015  		{
  7.1016  			object selectedItem = TreeUtils.GetSelectedItem(treeUnits);
  7.1017  
  7.1018 -			if (selectedItem is IBBoard.WarFoundry.API.Objects.Unit)
  7.1019 +			if (selectedItem is WFObjects.Unit)
  7.1020  			{
  7.1021  				Menu menu = new Menu();
  7.1022 -				ImageMenuItem delete = new ImageMenuItem("Remove unit");
  7.1023 +				ImageMenuItem delete = new ImageMenuItem(Translation.GetTranslation("menuRemoveUnit", "remove unit"));
  7.1024  				delete.Image = new Gtk.Image(Stock.Delete, IconSize.Menu);
  7.1025 -				delete.Activated+= new EventHandler(OnUnitDelete);
  7.1026 +				delete.Activated += new EventHandler(OnUnitDelete);
  7.1027  				delete.Data["unit"] = selectedItem;
  7.1028  				menu.Append(delete);
  7.1029  				menu.ShowAll();
  7.1030 @@ -983,17 +1125,65 @@
  7.1031  
  7.1032  		private void OnUnitDelete(object o, EventArgs args)
  7.1033  		{
  7.1034 -			RemoveUnitCommand command = new RemoveUnitCommand((IBBoard.WarFoundry.API.Objects.Unit)((ImageMenuItem)o).Data["unit"]);
  7.1035 +			RemoveUnitCommand command = new RemoveUnitCommand((WFObjects.Unit)((ImageMenuItem)o).Data["unit"]);
  7.1036  			commandStack.Execute(command);
  7.1037  		}
  7.1038  
  7.1039  		[GLib.ConnectBefore]
  7.1040 -		protected virtual void UnitTreeButtonPressed (object o, Gtk.ButtonPressEventArgs args)
  7.1041 +
  7.1042 +		protected virtual void UnitTreeButtonPressed(object o, Gtk.ButtonPressEventArgs args)
  7.1043  		{
  7.1044 +			TreePath path;
  7.1045 +			treeUnits.GetPathAtPos((int)args.Event.X, (int)args.Event.Y, out path);
  7.1046 +			
  7.1047 +			if (!treeUnits.Selection.PathIsSelected(path))
  7.1048 +			{
  7.1049 +				treeUnits.Selection.SelectPath(path);
  7.1050 +			}
  7.1051 +			
  7.1052  			if (args.Event.Type == Gdk.EventType.ButtonPress && args.Event.Button == 3)
  7.1053  			{
  7.1054  				OnTreeUnitsPopupMenu(o, null);
  7.1055  			}
  7.1056  		}
  7.1057 +
  7.1058 +		protected virtual void NotebookPageRemoved(object o, Gtk.RemovedArgs args)
  7.1059 +		{
  7.1060 +			Widget widget = args.Widget;
  7.1061 +			
  7.1062 +			if (widget is UnitDisplayWidget)
  7.1063 +			{
  7.1064 +				unitToWidgetMap.Remove(((UnitDisplayWidget)widget).Unit);
  7.1065 +			}
  7.1066 +		}
  7.1067 +
  7.1068 +		protected virtual void HelpAboutActivated(object sender, System.EventArgs e)
  7.1069 +		{
  7.1070 +			FrmAbout form = FrmAbout.GetForm();
  7.1071 +			form.Run();
  7.1072 +			form.Hide();
  7.1073 +		}
  7.1074 +
  7.1075 +		protected virtual void miPreferencesClicked(object sender, System.EventArgs e)
  7.1076 +		{
  7.1077 +			FrmPreferences form = new FrmPreferences(Preferences);
  7.1078 +			form.Run();
  7.1079 +			form.Hide();
  7.1080 +		}
  7.1081 +
  7.1082 +		public override ICollection<Action> Actions
  7.1083 +		{
  7.1084 +			get
  7.1085 +			{
  7.1086 +				List<Action> actions = new List<Action>();
  7.1087 +
  7.1088 +				foreach (ActionGroup actionGroup in this.UIManager.ActionGroups)
  7.1089 +				{
  7.1090 +					actions.AddRange(actionGroup.ListActions());
  7.1091 +				}
  7.1092 +
  7.1093 +				return actions;
  7.1094 +			}
  7.1095 +		}
  7.1096  	}
  7.1097  }
     8.1 --- a/FrmNewArmy.cs	Sun Jan 31 20:46:06 2010 +0000
     8.2 +++ b/FrmNewArmy.cs	Mon Jan 17 19:43:47 2011 +0000
     8.3 @@ -9,16 +9,18 @@
     8.4  using IBBoard.WarFoundry.API.Objects;
     8.5  using IBBoard.GtkSharp;
     8.6  using log4net;
     8.7 +using IBBoard.WarFoundry.GUI.GTK.Util;
     8.8 +using IBBoard.GtkSharp.Translatable;
     8.9  
    8.10 -namespace IBBoard.WarFoundry.GTK
    8.11 +namespace IBBoard.WarFoundry.GUI.GTK
    8.12  {	
    8.13 -	public partial class FrmNewArmy : Dialog, ITranslatable
    8.14 +	public partial class FrmNewArmy : TranslatableDialog, ITranslatable
    8.15  	{
    8.16  		private ILog logger = LogManager.GetLogger(typeof(FrmNewArmy));
    8.17  		private Race race;
    8.18  		private string armyName;
    8.19  		private int pointsValue;
    8.20 -		
    8.21 +
    8.22  		public FrmNewArmy(GameSystem gameSystem)
    8.23  		{
    8.24  			this.Build();
    8.25 @@ -26,6 +28,15 @@
    8.26  			GameSystem[] gameSystems = WarFoundryLoader.GetDefault().GetGameSystems();
    8.27  			ComboBoxUtils.FillCombo(systemCombo, gameSystems, delegate(GameSystem sys){return sys.Name;});
    8.28  			
    8.29 +			lstRaces.Selection.Changed += new EventHandler(OnSelectionChanged);
    8.30 +			
    8.31 +			TreeViewColumn raceColumn = new TreeViewColumn();
    8.32 +			raceColumn.Title = Translation.GetTranslation("frmNewArmyRaceColumn", "race");
    8.33 +			CellRendererText raceCell = new CellRendererText();
    8.34 +			raceColumn.PackStart(raceCell, true);
    8.35 +			lstRaces.AppendColumn(raceColumn);
    8.36 +			raceColumn.SetCellDataFunc(raceCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);
    8.37 +			
    8.38  			if (gameSystem != null)
    8.39  			{
    8.40  				ComboBoxUtils.SelectItem(systemCombo, gameSystem);
    8.41 @@ -35,32 +46,25 @@
    8.42  				ComboBoxUtils.SelectIndex(systemCombo, 0);
    8.43  			}
    8.44  			
    8.45 -			lstRaces.Selection.Changed+= new EventHandler(OnSelectionChanged);
    8.46 -			
    8.47 -			TreeViewColumn raceColumn = new TreeViewColumn ();
    8.48 -			raceColumn.Title = "Race";
    8.49 -			CellRendererText raceCell = new CellRendererText ();
    8.50 -			raceColumn.PackStart (raceCell, true);
    8.51 -			lstRaces.AppendColumn(raceColumn);
    8.52 -			raceColumn.SetCellDataFunc(raceCell, new TreeCellDataFunc(RenderRaceName));
    8.53 +			Translation.TranslationChanged += Retranslate;
    8.54 +			Translate();
    8.55 +		}
    8.56  
    8.57 -			
    8.58 -			if (gameSystem!=null)
    8.59 -			{
    8.60 -				SetRaces(gameSystem);
    8.61 -			}
    8.62 +		private void Retranslate()
    8.63 +		{
    8.64 +			Translate();
    8.65  		}
    8.66 -		
    8.67 -		public string Text
    8.68 +
    8.69 +		public override void Dispose()
    8.70  		{
    8.71 -			get { return Title; }
    8.72 -			set { Title = value; }
    8.73 +			Translation.TranslationChanged -= Retranslate;
    8.74 +			base.Dispose();
    8.75  		}
    8.76 -		
    8.77 -		private void RenderRaceName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
    8.78 +
    8.79 +		protected override void Translate()
    8.80  		{
    8.81 -			Race r = (Race)model.GetValue(iter, 0);
    8.82 -			(cell as CellRendererText).Text = r.Name;
    8.83 +			base.Translate();
    8.84 +			ControlTranslator.TranslateButtons(bttnCreate, bttnCancel);
    8.85  		}
    8.86  
    8.87  		protected virtual void OnSelectionChanged(object o, EventArgs e)
    8.88 @@ -68,51 +72,60 @@
    8.89  			logger.Debug("Race selection changed");
    8.90  			SetOkayButtonState();
    8.91  		}
    8.92 -		
    8.93 +
    8.94  		private void SetOkayButtonState()
    8.95  		{
    8.96 -			bttnCreate.Sensitive = (lstRaces.Selection.CountSelectedRows() == 1 && txtArmyName.Text!="" && sbPointsValue.Value > 0);
    8.97 +			bttnCreate.Sensitive = (lstRaces.Selection.CountSelectedRows() == 1 && txtArmyName.Text != "" && sbPointsValue.Value > 0);
    8.98  		}
    8.99  
   8.100 -		protected virtual void OnCreateClicked (object sender, System.EventArgs e)
   8.101 +		protected virtual void OnCreateClicked(object sender, System.EventArgs e)
   8.102  		{
   8.103  			TreeModel model;
   8.104  			TreeIter iter;
   8.105 -			lstRaces.Selection.GetSelected (out model, out iter);
   8.106 -			race = (Race) model.GetValue(iter, 0);
   8.107 +			lstRaces.Selection.GetSelected(out model, out iter);
   8.108 +			race = (Race)model.GetValue(iter, 0);
   8.109  			armyName = txtArmyName.Text;
   8.110  			pointsValue = (int)sbPointsValue.Value;
   8.111  			Respond(ResponseType.Ok);
   8.112  		}
   8.113  
   8.114 -		protected virtual void OnCancelClicked (object sender, System.EventArgs e)
   8.115 +		protected virtual void OnCancelClicked(object sender, System.EventArgs e)
   8.116  		{
   8.117  			Respond(ResponseType.Cancel);
   8.118  		}
   8.119  
   8.120 -		protected virtual void OnTextChanged (object sender, System.EventArgs e)
   8.121 +		protected virtual void OnTextChanged(object sender, System.EventArgs e)
   8.122  		{
   8.123  			SetOkayButtonState();
   8.124  		}
   8.125  
   8.126 -		protected virtual void OnSpinChangeValue (object o, Gtk.ChangeValueArgs args)
   8.127 +		protected virtual void OnSpinChangeValue(object o, Gtk.ChangeValueArgs args)
   8.128  		{
   8.129  			SetOkayButtonState();
   8.130  		}
   8.131  
   8.132 -		protected virtual void OnSpinValueChanged (object sender, System.EventArgs e)
   8.133 +		protected virtual void OnSpinValueChanged(object sender, System.EventArgs e)
   8.134  		{
   8.135  			SetOkayButtonState();
   8.136  		}
   8.137 -		
   8.138 -		protected virtual void OnSystemComboChanged (object sender, System.EventArgs e)
   8.139 +
   8.140 +		protected virtual void OnSystemComboChanged(object sender, System.EventArgs e)
   8.141  		{
   8.142  			GameSystem system = ComboBoxUtils.GetSelectedItem<GameSystem>(systemCombo);
   8.143  			SetRaces(system);
   8.144 +			ListStore model = (ListStore)lstRaces.Model;
   8.145 +
   8.146 +			if (model.IterNChildren() == 1)
   8.147 +			{
   8.148 +				TreeIter iter;
   8.149 +				model.GetIterFirst(out iter);
   8.150 +				lstRaces.Selection.SelectIter(iter);
   8.151 +			}
   8.152 +
   8.153  			logger.Debug("System selection changed: " + (system == null ? "null" : system.Name));
   8.154  			SetOkayButtonState();
   8.155  		}
   8.156 -		
   8.157 +
   8.158  		private void SetRaces(GameSystem system)
   8.159  		{	
   8.160  			ListStore store = new ListStore(typeof(Race));
   8.161 @@ -127,18 +140,18 @@
   8.162  			
   8.163  			lstRaces.Model = store;
   8.164  		}
   8.165 -		
   8.166 +
   8.167  		public Race SelectedRace
   8.168  		{
   8.169  			get { return race; }
   8.170  		}
   8.171 -		
   8.172 +
   8.173  		public string ArmyName
   8.174  		{
   8.175  			get { return armyName; }
   8.176  		}
   8.177 -		
   8.178 -		public int ArmySize 
   8.179 +
   8.180 +		public int ArmySize
   8.181  		{
   8.182  			get { return pointsValue; }
   8.183  		}
     9.1 --- a/FrmNewUnit.cs	Sun Jan 31 20:46:06 2010 +0000
     9.2 +++ b/FrmNewUnit.cs	Mon Jan 17 19:43:47 2011 +0000
     9.3 @@ -4,31 +4,33 @@
     9.4  
     9.5  using System;
     9.6  using System.Collections.Generic;
     9.7 +using Gtk;
     9.8 +using IBBoard.GtkSharp.Translatable;
     9.9  using IBBoard.WarFoundry.API.Objects;
    9.10  using IBBoard.WarFoundry.API.Requirements;
    9.11 -using Gtk;
    9.12  using log4net;
    9.13 +using IBBoard.Lang;
    9.14  
    9.15 -namespace IBBoard.WarFoundry.GTK
    9.16 +namespace IBBoard.WarFoundry.GUI.GTK
    9.17  {
    9.18 -	public partial class FrmNewUnit : Gtk.Dialog
    9.19 +	public partial class FrmNewUnit : TranslatableDialog
    9.20  	{
    9.21  		private ILog logger = LogManager.GetLogger(typeof(FrmNewUnit));
    9.22 -		
    9.23  		private UnitType unitType;
    9.24  		private Army unitArmy;
    9.25 -		
    9.26 -		public FrmNewUnit(Race race, Category cat, Army army)
    9.27 +		private Category cat;
    9.28 +
    9.29 +		public FrmNewUnit(Race race, Category category, Army army)
    9.30  		{
    9.31  			this.Build();
    9.32  			unitArmy = army;
    9.33 +			cat = category;
    9.34  			
    9.35 -			TreeViewColumn unitTypeColumn = new TreeViewColumn ();
    9.36 -			unitTypeColumn.Title = "Unit Type";
    9.37 -			CellRendererText unitTypeCell = new CellRendererText ();
    9.38 +			TreeViewColumn unitTypeColumn = new TreeViewColumn();
    9.39 +			CellRendererText unitTypeCell = new CellRendererText();
    9.40  			unitTypeColumn.PackStart(unitTypeCell, true);
    9.41  			lstUnitTypes.AppendColumn(unitTypeColumn);
    9.42 -			unitTypeColumn.SetCellDataFunc (unitTypeCell, new TreeCellDataFunc(RenderUnitTypeName));
    9.43 +			unitTypeColumn.SetCellDataFunc(unitTypeCell, new TreeCellDataFunc(RenderUnitTypeName));
    9.44  			ListStore store = new ListStore(typeof(UnitType));
    9.45  			UnitType[] types = race.GetUnitTypes(cat);
    9.46  			logger.DebugFormat("Listing {0} unit types in {1}", types.Length, cat.Name);
    9.47 @@ -40,47 +42,68 @@
    9.48  			}
    9.49  			
    9.50  			lstUnitTypes.Model = store;
    9.51 -			lstUnitTypes.Selection.Changed+= new EventHandler(OnSelectionChanged);
    9.52 +			lstUnitTypes.Selection.Changed += new EventHandler(OnSelectionChanged);
    9.53 +
    9.54 +			Translation.TranslationChanged += Retranslate;
    9.55 +			Translate();
    9.56  		}
    9.57 -		
    9.58 +
    9.59 +		private void Retranslate()
    9.60 +		{
    9.61 +			Translate();
    9.62 +		}
    9.63 +
    9.64 +		public override void Dispose()
    9.65 +		{
    9.66 +			Translation.TranslationChanged -= Retranslate;
    9.67 +			base.Dispose();
    9.68 +		}
    9.69 +
    9.70 +		protected override void Translate()
    9.71 +		{
    9.72 +			base.Translate();
    9.73 +			lstUnitTypes.Columns[0].Title = Translation.GetTranslation("frmNewUnitNewUnitColumn", "unit type");
    9.74 +			Title = Translation.GetTranslation(Name, "Create new unit", cat.Name);
    9.75 +		}
    9.76 +
    9.77  		private void RenderUnitTypeName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
    9.78  		{
    9.79  			UnitType type = (UnitType)model.GetValue(iter, 0);
    9.80  			(cell as CellRendererText).Text = type.Name;
    9.81  		}
    9.82 -		
    9.83 +
    9.84  		protected virtual void OnSelectionChanged(object o, EventArgs e)
    9.85  		{
    9.86  			SetSelectUnitEnabledVal();
    9.87  		}
    9.88 -		
    9.89 +
    9.90  		public UnitType SelectedUnit
    9.91  		{
    9.92  			get { return unitType; }
    9.93  		}
    9.94 -		
    9.95 +
    9.96  		private UnitType GetSelectedUnitType()
    9.97  		{		
    9.98  			TreeModel model;
    9.99  			TreeIter iter;
   9.100 -			lstUnitTypes.Selection.GetSelected (out model, out iter);
   9.101 +			lstUnitTypes.Selection.GetSelected(out model, out iter);
   9.102  			UnitType toReturn = null;
   9.103  			
   9.104 -			if (model!=null)
   9.105 +			if (model != null)
   9.106  			{
   9.107 -				toReturn = (UnitType) model.GetValue(iter, 0);
   9.108 +				toReturn = (UnitType)model.GetValue(iter, 0);
   9.109  			}
   9.110  			
   9.111  			return toReturn;
   9.112  		}
   9.113 -		
   9.114 +
   9.115  		private void SetSelectUnitEnabledVal()
   9.116  		{
   9.117  			UnitType type = GetSelectedUnitType();
   9.118  			
   9.119 -			if (type!=null)
   9.120 +			if (type != null)
   9.121  			{
   9.122 -				buttonOk.Sensitive = true;
   9.123 +				bttnCreate.Sensitive = true;
   9.124  				List<FailedUnitRequirement> fails = unitArmy.CanAddUnitType(type);
   9.125  				lblNewUnitWarning.Visible = (fails != null);
   9.126  
   9.127 @@ -92,23 +115,23 @@
   9.128  			}
   9.129  			else
   9.130  			{
   9.131 -				buttonOk.Sensitive = false;
   9.132 +				bttnCreate.Sensitive = false;
   9.133  				lblNewUnitWarning.Visible = false;
   9.134  			}
   9.135  		}
   9.136  
   9.137 -		protected virtual void OnButtonCancelActivated (object sender, System.EventArgs e)
   9.138 +		protected virtual void OnButtonCancelActivated(object sender, System.EventArgs e)
   9.139  		{
   9.140  			Respond(ResponseType.Cancel);
   9.141  		}
   9.142  
   9.143 -		protected virtual void OnRowActivated (object o, Gtk.RowActivatedArgs args)
   9.144 +		protected virtual void OnRowActivated(object o, Gtk.RowActivatedArgs args)
   9.145  		{
   9.146  			unitType = GetSelectedUnitType();
   9.147  			Respond(ResponseType.Ok);
   9.148  		}
   9.149  
   9.150 -		protected virtual void OnButtonOkClicked (object sender, System.EventArgs e)
   9.151 +		protected virtual void OnButtonOkClicked(object sender, System.EventArgs e)
   9.152  		{
   9.153  			unitType = GetSelectedUnitType();
   9.154  			Respond(ResponseType.Ok);
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/FrmPreferences.cs	Mon Jan 17 19:43:47 2011 +0000
    10.3 @@ -0,0 +1,120 @@
    10.4 +//  This file (FrmPreferences.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2011 IBBoard
    10.5 +// 
    10.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.
    10.7 +
    10.8 +using System;
    10.9 +using IBBoard.GtkSharp.Translatable;
   10.10 +using IBBoard.Lang;
   10.11 +using Gtk;
   10.12 +using System.Collections.Generic;
   10.13 +using IBBoard.GtkSharp;
   10.14 +using System.Globalization;
   10.15 +using log4net;
   10.16 +
   10.17 +namespace IBBoard.WarFoundry.GUI.GTK
   10.18 +{
   10.19 +	public partial class FrmPreferences : TranslatableDialog
   10.20 +	{
   10.21 +		private ILog logger = LogManager.GetLogger(typeof(FrmPreferences));
   10.22 +		private Preferences prefs;
   10.23 +		private string initialLang;
   10.24 +
   10.25 +		public FrmPreferences(Preferences preferences)
   10.26 +		{
   10.27 +			prefs = preferences;
   10.28 +			initialLang = Translation.GetTranslationLanguage();
   10.29 +			this.Build();
   10.30 +			BuildPreferenceCategoryTree();
   10.31 +			BuildLanguageList();
   10.32 +
   10.33 +			Translation.TranslationChanged += Retranslate;
   10.34 +			Translate();
   10.35 +		}
   10.36 +
   10.37 +		private void Retranslate()
   10.38 +		{
   10.39 +			Translate();
   10.40 +		}
   10.41 +
   10.42 +		public override void Dispose()
   10.43 +		{
   10.44 +			Translation.TranslationChanged -= Retranslate;
   10.45 +			base.Dispose();
   10.46 +		}
   10.47 +
   10.48 +		protected override void Translate()
   10.49 +		{
   10.50 +			base.Translate();
   10.51 +			frameLabel.Text = Translation.GetTranslation("languagesGroup", "languages");
   10.52 +			TreeStore model = ((TreeStore)preferencesTree.Model);
   10.53 +			TreeIter iter;
   10.54 +			model.GetIterFirst(out iter);
   10.55 +			model.SetValue(iter, 0, Translation.GetTranslation("languagePrefSection", "Language"));
   10.56 +		}
   10.57 +
   10.58 +		private void RenderPreference(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
   10.59 +		{
   10.60 +			object obj = model.GetValue(iter, 0);
   10.61 +
   10.62 +			if (obj is string)
   10.63 +			{
   10.64 +				(cell as CellRendererText).Text = (string)obj;
   10.65 +			}
   10.66 +		}
   10.67 +
   10.68 +		private void BuildPreferenceCategoryTree()
   10.69 +		{
   10.70 +			TreeViewColumn mainColumn = new TreeViewColumn();
   10.71 +			CellRendererText mainCell = new CellRendererText();
   10.72 +			mainColumn.PackStart(mainCell, true);
   10.73 +			preferencesTree.AppendColumn(mainColumn);
   10.74 +			mainColumn.SetCellDataFunc(mainCell, new TreeCellDataFunc(RenderPreference));
   10.75 +			TreeStore model = new TreeStore(typeof(string));
   10.76 +			preferencesTree.Model = model;
   10.77 +			model.AppendValues(Translation.GetTranslation("languagePrefSection", "Language"));
   10.78 +		}
   10.79 +
   10.80 +		private void BuildLanguageList()
   10.81 +		{
   10.82 +			ICollection<TranslationLanguage> langs = Translation.GetLanguages();
   10.83 +			List<TranslationLanguage> sortedLangs = new List<TranslationLanguage>(langs);
   10.84 +			sortedLangs.Sort(CompareLanguages);
   10.85 +			ComboBoxUtils.FillCombo(languageList, sortedLangs, delegate(TranslationLanguage lang){return lang.Name;});
   10.86 +			ComboBoxUtils.SelectItem(languageList, Translation.GetTranslationSet(initialLang).Language);
   10.87 +		}
   10.88 +
   10.89 +		private int CompareLanguages(TranslationLanguage lang1, TranslationLanguage lang2)
   10.90 +		{
   10.91 +			CompareOptions options = CompareOptions.IgnoreCase | CompareOptions.IgnoreKanaType | CompareOptions.IgnoreWidth;
   10.92 +			return CultureInfo.CurrentCulture.CompareInfo.Compare(lang1.Name, lang2.Name, options);
   10.93 +		}
   10.94 +
   10.95 +		protected virtual void bttnOkayClicked(object sender, System.EventArgs e)
   10.96 +		{
   10.97 +			prefs["language"] = Translation.GetTranslationLanguage();
   10.98 +			prefs.Save();
   10.99 +			Respond(ResponseType.Ok);
  10.100 +		}
  10.101 +
  10.102 +		protected virtual void bttnCancelClicked(object sender, System.EventArgs e)
  10.103 +		{
  10.104 +			Translation.LoadTranslation(initialLang);
  10.105 +			Respond(ResponseType.Cancel);
  10.106 +		}
  10.107 +
  10.108 +		protected virtual void languageListChanged(object sender, System.EventArgs e)
  10.109 +		{
  10.110 +			TranslationLanguage selectedLang = ComboBoxUtils.GetSelectedItem<TranslationLanguage>(languageList);
  10.111 +			string code = selectedLang == null ? "" : selectedLang.Code;
  10.112 +			logger.Debug("New language: " + code);
  10.113 +			Translation.LoadTranslation(code);
  10.114 +			bttnOkay.Sensitive = !initialLang.Equals(code);
  10.115 +
  10.116 +		}
  10.117 +
  10.118 +
  10.119 +
  10.120 +
  10.121 +	}
  10.122 +}
  10.123 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/FrmReplaceEquipment.cs	Mon Jan 17 19:43:47 2011 +0000
    11.3 @@ -0,0 +1,269 @@
    11.4 +//  This file (FrmAddEquipment.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    11.5 +// 
    11.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.
    11.7 +
    11.8 +using System;
    11.9 +using Gtk;
   11.10 +using IBBoard.GtkSharp;
   11.11 +using IBBoard.GtkSharp.Translatable;
   11.12 +using IBBoard.Lang;
   11.13 +using IBBoard.WarFoundry.API.Objects;
   11.14 +using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
   11.15 +using IBBoard.WarFoundry.GUI.GTK.Util;
   11.16 +using log4net;
   11.17 +
   11.18 +namespace IBBoard.WarFoundry.GUI.GTK
   11.19 +{
   11.20 +	public partial class FrmReplaceEquipment : TranslatableDialog, IReplaceEquipmentUI
   11.21 +	{
   11.22 +		private static ILog log = LogManager.GetLogger(typeof(FrmReplaceEquipment));
   11.23 +
   11.24 +		public event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged;
   11.25 +		public event MethodInvoker UnitEquipmentAmountTypeChanged;
   11.26 +		public event MethodInvoker UnitEquipmentAmountChanged;
   11.27 +
   11.28 +		private bool isRatioLimited;
   11.29 +
   11.30 +		public FrmReplaceEquipment()
   11.31 +		{
   11.32 +			this.Build();
   11.33 +			lstEquipment.Selection.Changed += OnSelectionChanged;
   11.34 +			TreeViewColumn equipColumn = new TreeViewColumn();
   11.35 +			equipColumn.Title = "Equipment";
   11.36 +			CellRendererText equipCell = new CellRendererText();
   11.37 +			equipColumn.PackStart(equipCell, true);
   11.38 +			equipColumn.SetCellDataFunc(equipCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);
   11.39 +			lstEquipment.AppendColumn(equipColumn);			
   11.40 +
   11.41 +			Translation.TranslationChanged += Retranslate;
   11.42 +			Translate();
   11.43 +		}
   11.44 +
   11.45 +		private void Retranslate()
   11.46 +		{
   11.47 +			Translate();
   11.48 +		}
   11.49 +
   11.50 +		public override void Dispose()
   11.51 +		{
   11.52 +			Translation.TranslationChanged -= Retranslate;
   11.53 +			base.Dispose();
   11.54 +		}
   11.55 +
   11.56 +		public void ListenToWidgets()
   11.57 +		{
   11.58 +			rbEquipAll.Clicked += RadioButtonClicked;
   11.59 +			rbEquipNumeric.Clicked += RadioButtonClicked;
   11.60 +			rbEquipPercent.Clicked += RadioButtonClicked;
   11.61 +			numericAmount.ValueChanged += SpinButtonValueChanged;
   11.62 +			percentageAmount.ValueChanged += SpinButtonValueChanged;
   11.63 +			lstEquipment.Selection.Changed += OnSelectionChanged;
   11.64 +		}
   11.65 +
   11.66 +		public void IgnoreWidgets()
   11.67 +		{
   11.68 +			rbEquipAll.Clicked -= RadioButtonClicked;
   11.69 +			rbEquipNumeric.Clicked -= RadioButtonClicked;
   11.70 +			rbEquipPercent.Clicked -= RadioButtonClicked;
   11.71 +			numericAmount.ValueChanged -= SpinButtonValueChanged;
   11.72 +			percentageAmount.ValueChanged -= SpinButtonValueChanged;
   11.73 +			lstEquipment.Selection.Changed -= OnSelectionChanged;
   11.74 +		}
   11.75 +
   11.76 +		private void OnUnitEquipmentAmountChanged()
   11.77 +		{
   11.78 +			if (UnitEquipmentAmountChanged != null)
   11.79 +			{
   11.80 +				UnitEquipmentAmountChanged();
   11.81 +			}
   11.82 +		}
   11.83 +
   11.84 +		private void OnUnitEquipmentAmountTypeChanged()
   11.85 +		{
   11.86 +			if (UnitEquipmentAmountChanged != null)
   11.87 +			{
   11.88 +				UnitEquipmentAmountTypeChanged();
   11.89 +			}
   11.90 +		}
   11.91 +
   11.92 +		protected void OnSelectionChanged(object o, EventArgs e)
   11.93 +		{
   11.94 +			if (UnitEquipmentItemChoiceChanged != null)
   11.95 +			{
   11.96 +				UnitEquipmentItemChoiceChanged(SelectedUnitEquipmentItem);
   11.97 +			}
   11.98 +		}
   11.99 +
  11.100 +		public void SetUnitEquipmentItems(UnitEquipmentItem[] items)
  11.101 +		{
  11.102 +			ListStore store = new ListStore(typeof(UnitEquipmentItem));
  11.103 +			
  11.104 +			foreach (UnitEquipmentItem equipItem in items)
  11.105 +			{
  11.106 +				store.AppendValues(equipItem);
  11.107 +			}
  11.108 +			
  11.109 +			lstEquipment.Model = store;
  11.110 +		}
  11.111 +
  11.112 +		public void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber)
  11.113 +		{
  11.114 +			log.DebugFormat("IsRatio? {0}. Limits: {1}->{2}, {3}%->{4}%", isRatioLimit, minNumber, maxNumber, minPercent, maxPercent);
  11.115 +			numericAmount.SetRange(minNumber, maxNumber);
  11.116 +			percentageAmount.SetRange(minPercent, maxPercent);
  11.117 +			isRatioLimited = isRatioLimit;
  11.118 +			
  11.119 +			if (isRatioLimit)
  11.120 +			{
  11.121 +				if (minPercent == 100)
  11.122 +				{
  11.123 +					rbEquipAll.Active = true;
  11.124 +				}
  11.125 +				else
  11.126 +				{
  11.127 +					rbEquipPercent.Active = true;
  11.128 +				}
  11.129 +			}
  11.130 +			else
  11.131 +			{
  11.132 +				rbEquipNumeric.Active = true;
  11.133 +			}
  11.134 +		}
  11.135 +
  11.136 +		public void SetUnitEquipmentLimitsEnabled(bool isEnabled)
  11.137 +		{
  11.138 +			SetNumericAmountEnabledState(isEnabled);
  11.139 +			SetPercentageAmountEnabledState(isEnabled);
  11.140 +		}
  11.141 +
  11.142 +		public bool ShowControl()
  11.143 +		{
  11.144 +			int result = Run();
  11.145 +			bool okayClicked = (result == (int)ResponseType.Ok);
  11.146 +			this.Hide();
  11.147 +			return okayClicked;
  11.148 +		}
  11.149 +
  11.150 +		protected virtual void CancelButtonClicked(object sender, System.EventArgs e)
  11.151 +		{
  11.152 +			log.Debug("Cancel clicked");
  11.153 +			Respond(ResponseType.Cancel);
  11.154 +		}	
  11.155 +
  11.156 +		protected virtual void OkayButtonClicked(object sender, System.EventArgs e)
  11.157 +		{
  11.158 +			log.Debug("Okay clicked");
  11.159 +			Respond(ResponseType.Ok);
  11.160 +		}		
  11.161 +
  11.162 +		public void SetOkayEnabledState(bool enabled)
  11.163 +		{
  11.164 +			bttnOkay.Sensitive = enabled;
  11.165 +		}
  11.166 +
  11.167 +		protected virtual void SpinButtonValueChanged(object sender, System.EventArgs e)
  11.168 +		{
  11.169 +			OnUnitEquipmentAmountChanged();
  11.170 +		}		
  11.171 +
  11.172 +		protected virtual void RadioButtonClicked(object sender, System.EventArgs e)
  11.173 +		{
  11.174 +			OnUnitEquipmentAmountTypeChanged();
  11.175 +		}
  11.176 +
  11.177 +		public void SetNumericAmountEnabledState(bool enabled)
  11.178 +		{
  11.179 +			double minPercent = GetMinPercentage();
  11.180 +			rbEquipNumeric.Sensitive = enabled && !(isRatioLimited && minPercent == 100);
  11.181 +			numericAmount.Sensitive = rbEquipNumeric.Sensitive;
  11.182 +		}		
  11.183 +
  11.184 +		public void SetPercentageAmountEnabledState(bool enabled)
  11.185 +		{
  11.186 +			if (enabled)
  11.187 +			{
  11.188 +				double minPercentage = GetMinPercentage();
  11.189 +				rbEquipPercent.Sensitive = isRatioLimited && minPercentage != 100;
  11.190 +				percentageAmount.Sensitive = rbEquipPercent.Sensitive;
  11.191 +				double maxPercentage = GetMaxPercentage();				
  11.192 +				rbEquipAll.Sensitive = isRatioLimited && maxPercentage == 100;
  11.193 +				lblEquipAll.Sensitive = rbEquipAll.Sensitive;
  11.194 +			}
  11.195 +			else
  11.196 +			{
  11.197 +				rbEquipPercent.Sensitive = false;
  11.198 +				percentageAmount.Sensitive = false;
  11.199 +				rbEquipAll.Sensitive = false;
  11.200 +				lblEquipAll.Sensitive = false;
  11.201 +			}
  11.202 +		}
  11.203 +
  11.204 +		private double GetMaxPercentage()
  11.205 +		{
  11.206 +			double min, max;
  11.207 +			percentageAmount.GetRange(out min, out max);
  11.208 +			return max;
  11.209 +		}
  11.210 +
  11.211 +		private double GetMinPercentage()
  11.212 +		{
  11.213 +			double min, max;
  11.214 +			percentageAmount.GetRange(out min, out max);
  11.215 +			return min;
  11.216 +		}
  11.217 +
  11.218 +		public UnitEquipmentItem SelectedUnitEquipmentItem
  11.219 +		{
  11.220 +			get
  11.221 +			{
  11.222 +				return (UnitEquipmentItem)TreeUtils.GetSelectedItem(lstEquipment);
  11.223 +			}
  11.224 +		}
  11.225 +
  11.226 +		public bool IsRatioEquipmentAmount
  11.227 +		{
  11.228 +			get
  11.229 +			{
  11.230 +				return !rbEquipNumeric.Active;
  11.231 +			}
  11.232 +		}
  11.233 +
  11.234 +		public int EquipmentNumericAmount
  11.235 +		{
  11.236 +			get
  11.237 +			{
  11.238 +				return (int)numericAmount.Value;
  11.239 +			}
  11.240 +			
  11.241 +			set
  11.242 +			{
  11.243 +				numericAmount.Value = value;
  11.244 +			}
  11.245 +		}
  11.246 +
  11.247 +		public double EquipmentPercentageAmount
  11.248 +		{
  11.249 +			get
  11.250 +			{
  11.251 +				double percent;
  11.252 +				
  11.253 +				if (rbEquipAll.Active)
  11.254 +				{
  11.255 +					percent = 100;
  11.256 +				}
  11.257 +				else
  11.258 +				{
  11.259 +					percent = percentageAmount.Value;
  11.260 +				}
  11.261 +				
  11.262 +				return percent;
  11.263 +			}
  11.264 +			
  11.265 +			set
  11.266 +			{
  11.267 +				percentageAmount.Value = value;
  11.268 +			}
  11.269 +		}
  11.270 +	}
  11.271 +}
  11.272 +
    12.1 --- a/IBBoard.WarFoundry.GUI.GTK.csproj	Sun Jan 31 20:46:06 2010 +0000
    12.2 +++ b/IBBoard.WarFoundry.GUI.GTK.csproj	Mon Jan 17 19:43:47 2011 +0000
    12.3 @@ -9,8 +9,9 @@
    12.4      <OutputType>WinExe</OutputType>
    12.5      <AppDesignerFolder>Properties</AppDesignerFolder>
    12.6      <RootNamespace>IBBoard.WarFoundry.GUI.GTK</RootNamespace>
    12.7 -    <StartupObject>IBBoard.WarFoundry.GTK.FrmMainWindow</StartupObject>
    12.8 +    <StartupObject>IBBoard.WarFoundry.GUI.GTK.FrmMainWindow</StartupObject>
    12.9      <ApplicationIcon>App.ico</ApplicationIcon>
   12.10 +    <AssemblyName>WarFoundry-GTK</AssemblyName>
   12.11    </PropertyGroup>
   12.12    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
   12.13      <DebugSymbols>true</DebugSymbols>
   12.14 @@ -20,7 +21,6 @@
   12.15      <DefineConstants>DEBUG;TRACE</DefineConstants>
   12.16      <ErrorReport>prompt</ErrorReport>
   12.17      <WarningLevel>4</WarningLevel>
   12.18 -    <AssemblyName>WarFoundryGTK</AssemblyName>
   12.19    </PropertyGroup>
   12.20    <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
   12.21      <DebugType>pdbonly</DebugType>
   12.22 @@ -29,7 +29,6 @@
   12.23      <DefineConstants>TRACE</DefineConstants>
   12.24      <ErrorReport>prompt</ErrorReport>
   12.25      <WarningLevel>4</WarningLevel>
   12.26 -    <AssemblyName>IBBoard.WarFoundry.GUI.GTK</AssemblyName>
   12.27    </PropertyGroup>
   12.28    <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
   12.29    <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
   12.30 @@ -46,10 +45,32 @@
   12.31      <Compile Include="FrmNewUnit.cs" />
   12.32      <Compile Include="Widgets\UnitDisplayWidget.cs" />
   12.33      <Compile Include="gtk-gui\generated.cs" />
   12.34 -    <Compile Include="gtk-gui\IBBoard.WarFoundry.GTK.FrmMainWindow.cs" />
   12.35 -    <Compile Include="gtk-gui\IBBoard.WarFoundry.GTK.FrmNewArmy.cs" />
   12.36 -    <Compile Include="gtk-gui\IBBoard.WarFoundry.GTK.FrmNewUnit.cs" />
   12.37 -    <Compile Include="gtk-gui\IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget.cs" />
   12.38 +    <Compile Include="UIControl\AddEquipmentUIControl.cs" />
   12.39 +    <Compile Include="UIControl\Interfaces\IAddEquipmentUI.cs" />
   12.40 +    <Compile Include="FrmAddEquipment.cs" />
   12.41 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs" />
   12.42 +    <Compile Include="Util\GtkWarFoundryUtil.cs" />
   12.43 +    <Compile Include="UIControl\EditEquipmentUIControl.cs" />
   12.44 +    <Compile Include="UIControl\Interfaces\IEditEquipmentUI.cs" />
   12.45 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment.cs" />
   12.46 +    <Compile Include="FrmEditEquipment.cs" />
   12.47 +    <Compile Include="UIControl\AbstractBaseEquipmentUIControl.cs" />
   12.48 +    <Compile Include="UIControl\Interfaces\IBaseEquipmentUI.cs" />
   12.49 +    <Compile Include="UIControl\Interfaces\ISelectableItemEquipmentUI.cs" />
   12.50 +    <Compile Include="UIControl\Interfaces\IReplaceEquipmentUI.cs" />
   12.51 +    <Compile Include="FrmReplaceEquipment.cs" />
   12.52 +    <Compile Include="UIControl\ReplaceEquipmentUIControl.cs" />
   12.53 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment.cs" />
   12.54 +    <Compile Include="FrmAbout.cs" />
   12.55 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmAbout.cs" />
   12.56 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs" />
   12.57 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs" />
   12.58 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs" />
   12.59 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget.cs" />
   12.60 +    <Compile Include="FrmAboutCredits.cs" />
   12.61 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmAboutCredits.cs" />
   12.62 +    <Compile Include="FrmPreferences.cs" />
   12.63 +    <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmPreferences.cs" />
   12.64    </ItemGroup>
   12.65    <ItemGroup>
   12.66      <Content Include="App.png" />
   12.67 @@ -59,13 +80,16 @@
   12.68      <None Include="translations\en.translation">
   12.69        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
   12.70      </None>
   12.71 -    <None Include="WarFoundryGTK.exe.log4net">
   12.72 -      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
   12.73 -    </None>
   12.74      <None Include="gtk-gui\gui.stetic" />
   12.75      <None Include="gtk-gui\objects.xml" />
   12.76      <None Include="COPYING" />
   12.77 -    <None Include="WarFoundryGTKPref.xml">
   12.78 +    <None Include="WarFoundry-GTK.exe.log4net">
   12.79 +      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
   12.80 +    </None>
   12.81 +    <None Include="WarFoundry-GTKPref.xml">
   12.82 +      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
   12.83 +    </None>
   12.84 +    <None Include="translations\fr.translation">
   12.85        <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
   12.86      </None>
   12.87    </ItemGroup>
   12.88 @@ -102,5 +126,11 @@
   12.89      <EmbeddedResource Include="App.ico">
   12.90        <LogicalName>App.ico</LogicalName>
   12.91      </EmbeddedResource>
   12.92 +    <EmbeddedResource Include="App-lrg.png" />
   12.93 +  </ItemGroup>
   12.94 +  <ItemGroup>
   12.95 +    <Folder Include="UIControl\" />
   12.96 +    <Folder Include="UIControl\Interfaces\" />
   12.97 +    <Folder Include="Util\" />
   12.98    </ItemGroup>
   12.99  </Project>
  12.100 \ No newline at end of file
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/IBBoard.WarFoundry.GUI.GTK.sln	Mon Jan 17 19:43:47 2011 +0000
    13.3 @@ -0,0 +1,86 @@
    13.4 +
    13.5 +Microsoft Visual Studio Solution File, Format Version 9.00
    13.6 +# Visual Studio 2005
    13.7 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.WarFoundry.GUI.GTK", "IBBoard.WarFoundry.GUI.GTK.csproj", "{4B435E40-7FA2-41C5-96F6-5735396D2D5F}"
    13.8 +EndProject
    13.9 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard", "..\IBBoard\IBBoard.csproj", "{5DFD64F6-FC2B-4B4F-B92E-483BAC468105}"
   13.10 +EndProject
   13.11 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.WarFoundry.API", "..\IBBoard.WarFoundry.API\IBBoard.WarFoundry.API.csproj", "{951E6C7A-7FBA-4F68-9D9E-F48618BB9626}"
   13.12 +EndProject
   13.13 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.GtkSharp", "..\IBBoard.GtkSharp\IBBoard.GtkSharp.csproj", "{06605A63-E433-42FE-93CF-0DA6630A7DF5}"
   13.14 +EndProject
   13.15 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.WarFoundry.Plugin.Rollcall", "..\IBBoard.WarFoundry.Plugin.Rollcall\IBBoard.WarFoundry.Plugin.Rollcall.csproj", "{182E4A7C-7CFB-4337-A9AD-AB2DCA054A53}"
   13.16 +EndProject
   13.17 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.Ini", "..\IBBoard.Ini\IBBoard.Ini.csproj", "{3BBDF326-7128-406C-85DF-EF049633E602}"
   13.18 +EndProject
   13.19 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.Ini.Tests", "..\IBBoard.Ini.Tests\IBBoard.Ini.Tests.csproj", "{47FA6D87-4A97-4019-880B-CD713B8D4C15}"
   13.20 +EndProject
   13.21 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.WarFoundry.API.Tests", "..\IBBoard.WarFoundry.API.Tests\IBBoard.WarFoundry.API.Tests.csproj", "{B20E808D-878E-4F6D-B1E3-84A9A49905CB}"
   13.22 +EndProject
   13.23 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.Tests", "..\IBBoard.Tests\IBBoard.Tests.csproj", "{4160F7B6-4CFA-41FC-B5D7-5C9AE06FEBA7}"
   13.24 +EndProject
   13.25 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.NUnit", "..\IBBoard.NUnit\IBBoard.NUnit.csproj", "{C52AFD32-B869-4E14-AACE-2846AD2CC742}"
   13.26 +EndProject
   13.27 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "IBBoard.NUnit.Tests", "..\IBBoard.NUnit.Tests\IBBoard.NUnit.Tests.csproj", "{2025A316-8377-4454-807C-3C4ED02DF4D5}"
   13.28 +EndProject
   13.29 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ICSharpCode.SharpZLib", "..\SharpZipLib\ICSharpCode.SharpZLib.csproj", "{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}"
   13.30 +EndProject
   13.31 +Global
   13.32 +	GlobalSection(SolutionConfigurationPlatforms) = preSolution
   13.33 +		Debug|x86 = Debug|x86
   13.34 +		Release|x86 = Release|x86
   13.35 +	EndGlobalSection
   13.36 +	GlobalSection(ProjectConfigurationPlatforms) = postSolution
   13.37 +		{06605A63-E433-42FE-93CF-0DA6630A7DF5}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.38 +		{06605A63-E433-42FE-93CF-0DA6630A7DF5}.Debug|x86.Build.0 = Debug|Any CPU
   13.39 +		{06605A63-E433-42FE-93CF-0DA6630A7DF5}.Release|x86.ActiveCfg = Release|Any CPU
   13.40 +		{06605A63-E433-42FE-93CF-0DA6630A7DF5}.Release|x86.Build.0 = Release|Any CPU
   13.41 +		{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.42 +		{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Debug|x86.Build.0 = Debug|Any CPU
   13.43 +		{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|x86.ActiveCfg = Release|Any CPU
   13.44 +		{0E7413FF-EB9E-4714-ACF2-BE3A6A7B2FFD}.Release|x86.Build.0 = Release|Any CPU
   13.45 +		{182E4A7C-7CFB-4337-A9AD-AB2DCA054A53}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.46 +		{182E4A7C-7CFB-4337-A9AD-AB2DCA054A53}.Debug|x86.Build.0 = Debug|Any CPU
   13.47 +		{182E4A7C-7CFB-4337-A9AD-AB2DCA054A53}.Release|x86.ActiveCfg = Release|Any CPU
   13.48 +		{182E4A7C-7CFB-4337-A9AD-AB2DCA054A53}.Release|x86.Build.0 = Release|Any CPU
   13.49 +		{2025A316-8377-4454-807C-3C4ED02DF4D5}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.50 +		{2025A316-8377-4454-807C-3C4ED02DF4D5}.Debug|x86.Build.0 = Debug|Any CPU
   13.51 +		{2025A316-8377-4454-807C-3C4ED02DF4D5}.Release|x86.ActiveCfg = Release|Any CPU
   13.52 +		{2025A316-8377-4454-807C-3C4ED02DF4D5}.Release|x86.Build.0 = Release|Any CPU
   13.53 +		{3BBDF326-7128-406C-85DF-EF049633E602}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.54 +		{3BBDF326-7128-406C-85DF-EF049633E602}.Debug|x86.Build.0 = Debug|Any CPU
   13.55 +		{3BBDF326-7128-406C-85DF-EF049633E602}.Release|x86.ActiveCfg = Release|Any CPU
   13.56 +		{3BBDF326-7128-406C-85DF-EF049633E602}.Release|x86.Build.0 = Release|Any CPU
   13.57 +		{4160F7B6-4CFA-41FC-B5D7-5C9AE06FEBA7}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.58 +		{4160F7B6-4CFA-41FC-B5D7-5C9AE06FEBA7}.Debug|x86.Build.0 = Debug|Any CPU
   13.59 +		{4160F7B6-4CFA-41FC-B5D7-5C9AE06FEBA7}.Release|x86.ActiveCfg = Release|Any CPU
   13.60 +		{4160F7B6-4CFA-41FC-B5D7-5C9AE06FEBA7}.Release|x86.Build.0 = Release|Any CPU
   13.61 +		{47FA6D87-4A97-4019-880B-CD713B8D4C15}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.62 +		{47FA6D87-4A97-4019-880B-CD713B8D4C15}.Debug|x86.Build.0 = Debug|Any CPU
   13.63 +		{47FA6D87-4A97-4019-880B-CD713B8D4C15}.Release|x86.ActiveCfg = Release|Any CPU
   13.64 +		{47FA6D87-4A97-4019-880B-CD713B8D4C15}.Release|x86.Build.0 = Release|Any CPU
   13.65 +		{4B435E40-7FA2-41C5-96F6-5735396D2D5F}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.66 +		{4B435E40-7FA2-41C5-96F6-5735396D2D5F}.Debug|x86.Build.0 = Debug|Any CPU
   13.67 +		{4B435E40-7FA2-41C5-96F6-5735396D2D5F}.Release|x86.ActiveCfg = Release|Any CPU
   13.68 +		{4B435E40-7FA2-41C5-96F6-5735396D2D5F}.Release|x86.Build.0 = Release|Any CPU
   13.69 +		{5DFD64F6-FC2B-4B4F-B92E-483BAC468105}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.70 +		{5DFD64F6-FC2B-4B4F-B92E-483BAC468105}.Debug|x86.Build.0 = Debug|Any CPU
   13.71 +		{5DFD64F6-FC2B-4B4F-B92E-483BAC468105}.Release|x86.ActiveCfg = Release|Any CPU
   13.72 +		{5DFD64F6-FC2B-4B4F-B92E-483BAC468105}.Release|x86.Build.0 = Release|Any CPU
   13.73 +		{951E6C7A-7FBA-4F68-9D9E-F48618BB9626}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.74 +		{951E6C7A-7FBA-4F68-9D9E-F48618BB9626}.Debug|x86.Build.0 = Debug|Any CPU
   13.75 +		{951E6C7A-7FBA-4F68-9D9E-F48618BB9626}.Release|x86.ActiveCfg = Release|Any CPU
   13.76 +		{951E6C7A-7FBA-4F68-9D9E-F48618BB9626}.Release|x86.Build.0 = Release|Any CPU
   13.77 +		{B20E808D-878E-4F6D-B1E3-84A9A49905CB}.Debug|x86.ActiveCfg = Debug|Any CPU
   13.78 +		{B20E808D-878E-4F6D-B1E3-84A9A49905CB}.Debug|x86.Build.0 = Debug|Any CPU
   13.79 +		{B20E808D-878E-4F6D-B1E3-84A9A49905CB}.Release|x86.ActiveCfg = Release|Any CPU
   13.80 +		{B20E808D-878E-4F6D-B1E3-84A9A49905CB}.Release|x86.Build.0 = Release|Any CPU
   13.81 +		{C52AFD32-B869-4E14-AACE-2846AD2CC742}.Debug|x86.ActiveCfg = Debug|x86
   13.82 +		{C52AFD32-B869-4E14-AACE-2846AD2CC742}.Debug|x86.Build.0 = Debug|x86
   13.83 +		{C52AFD32-B869-4E14-AACE-2846AD2CC742}.Release|x86.ActiveCfg = Release|x86
   13.84 +		{C52AFD32-B869-4E14-AACE-2846AD2CC742}.Release|x86.Build.0 = Release|x86
   13.85 +	EndGlobalSection
   13.86 +	GlobalSection(MonoDevelopProperties) = preSolution
   13.87 +		StartupItem = IBBoard.WarFoundry.GUI.GTK.csproj
   13.88 +	EndGlobalSection
   13.89 +EndGlobal
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/UIControl/AbstractBaseEquipmentUIControl.cs	Mon Jan 17 19:43:47 2011 +0000
    14.3 @@ -0,0 +1,281 @@
    14.4 +//  This file (AbstractBaseEquipmentUIControl.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    14.5 +// 
    14.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.
    14.7 +
    14.8 +using System;
    14.9 +using IBBoard.Commands;
   14.10 +using IBBoard.WarFoundry.API.Objects;
   14.11 +using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
   14.12 +using IBBoard.Lang;
   14.13 +using IBBoard.WarFoundry.API.Util;
   14.14 +
   14.15 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl
   14.16 +{
   14.17 +	public abstract class AbstractBaseEquipmentUIControl<UI_TYPE> where UI_TYPE : IBaseEquipmentUI
   14.18 +	{
   14.19 +		protected CommandStack commandStack;
   14.20 +		protected Unit unit;
   14.21 +		protected UI_TYPE ui;
   14.22 +		protected UnitEquipmentItem equipItem;
   14.23 +		protected double minPercentage, maxPercentage;
   14.24 +		protected int minNumber, maxNumber;
   14.25 +		protected bool isRatioAmount;
   14.26 +		protected double equipmentAmount;
   14.27 +
   14.28 +		public AbstractBaseEquipmentUIControl(Unit unit, CommandStack commandStack)
   14.29 +		{
   14.30 +			this.unit = unit;
   14.31 +			this.commandStack = commandStack;
   14.32 +		}
   14.33 +
   14.34 +		private void SetupUI()
   14.35 +		{
   14.36 +			ui = CreateEquipmentUI();
   14.37 +			ui.SetUnitEquipmentLimitsEnabled(false);
   14.38 +			ui.SetOkayEnabledState(false);
   14.39 +			CompleteUISetup();
   14.40 +			ui.UnitEquipmentAmountChanged += HandleUnitEquipmentAmountChanged;
   14.41 +			ui.UnitEquipmentAmountTypeChanged += HandleUnitEquipmentAmountChanged;
   14.42 +			ui.ListenToWidgets();
   14.43 +		}
   14.44 +		
   14.45 +		/// <summary>
   14.46 +		/// Creates the UI component that will be displayed to the user and returns it
   14.47 +		/// </summary>
   14.48 +		/// <returns>
   14.49 +		/// the UI component to display to the user
   14.50 +		/// </returns>
   14.51 +
   14.52 +		protected abstract UI_TYPE CreateEquipmentUI();
   14.53 +		
   14.54 +		/// <summary>
   14.55 +		/// Completes any additional user interface setup.
   14.56 +		/// </summary>
   14.57 +
   14.58 +		protected virtual void CompleteUISetup()
   14.59 +		{
   14.60 +			//Do nothing
   14.61 +		}
   14.62 +
   14.63 +		protected void HandleUnitEquipmentAmountChanged()
   14.64 +		{
   14.65 +			SetUnitEquipmentValuesFromUI();
   14.66 +		}
   14.67 +
   14.68 +		protected void SetUnitEquipmentLimits(UnitEquipmentItem equip)
   14.69 +		{			
   14.70 +			ui.IgnoreWidgets();
   14.71 +			
   14.72 +			if (equip != null)
   14.73 +			{
   14.74 +				bool equipIsRatioLimit = UnitEquipmentUtil.IsEquipmentRatioLimited(unit, equip);
   14.75 +				maxPercentage = GetMaxPercentageLimit(equip);
   14.76 +				minPercentage = GetMinPercentageLimit(equip);
   14.77 +				maxNumber = GetMaxNumericLimit(equip);
   14.78 +				minNumber = GetMinNumericLimit(equip);
   14.79 +			
   14.80 +				ui.SetUnitEquipmentLimits(equipIsRatioLimit, minPercentage, maxPercentage, minNumber, maxNumber);
   14.81 +				ui.SetUnitEquipmentLimitsEnabled(true);
   14.82 +				ui.SetOkayEnabledState(HasNonZeroEquipmentAmount());
   14.83 +				SetEquipmentAmountControlEnabledStates();
   14.84 +			}
   14.85 +			else
   14.86 +			{
   14.87 +				maxPercentage = minPercentage = 0;
   14.88 +				maxNumber = minNumber = 0;
   14.89 +				ui.SetUnitEquipmentLimits(false, minPercentage, maxPercentage, minNumber, maxNumber);
   14.90 +				ui.SetUnitEquipmentLimitsEnabled(false);
   14.91 +				ui.SetOkayEnabledState(false);
   14.92 +			}
   14.93 +			
   14.94 +			ui.ListenToWidgets();
   14.95 +		}
   14.96 +
   14.97 +		protected void SetUnitEquipmentValuesFromEquipment(UnitEquipmentItem equip)
   14.98 +		{			
   14.99 +			isRatioAmount = UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equip);
  14.100 +			equipmentAmount = UnitEquipmentUtil.GetEquipmentAmount(unit, equip);			
  14.101 +			SetUnitEquipmentValues();
  14.102 +			SetEquipmentAmountControlEnabledStates();
  14.103 +		}
  14.104 +
  14.105 +		/// <summary>
  14.106 +		/// Sets the unit equipment values on the UI
  14.107 +		/// </summary>
  14.108 +
  14.109 +		protected void SetUnitEquipmentValuesFromUI()
  14.110 +		{			
  14.111 +			isRatioAmount = ui.IsRatioEquipmentAmount;
  14.112 +			
  14.113 +			if (isRatioAmount)
  14.114 +			{
  14.115 +				equipmentAmount = ui.EquipmentPercentageAmount;
  14.116 +			}
  14.117 +			else
  14.118 +			{
  14.119 +				int equipmentIntAmount = ui.EquipmentNumericAmount;
  14.120 +				equipmentAmount = equipmentIntAmount;
  14.121 +			}
  14.122 +			
  14.123 +			SetUnitEquipmentValues();
  14.124 +		}
  14.125 +
  14.126 +		private void SetUnitEquipmentValues()
  14.127 +		{			
  14.128 +			ui.IgnoreWidgets();
  14.129 +			
  14.130 +			if (isRatioAmount)
  14.131 +			{
  14.132 +				SetEquipmentAmountsFromPercentage(equipmentAmount);
  14.133 +			}
  14.134 +			else
  14.135 +			{
  14.136 +				int equipmentIntAmount = (int)equipmentAmount;
  14.137 +				SetEquipmentAmountsFromNumber(equipmentIntAmount);
  14.138 +			}
  14.139 +			
  14.140 +			ui.SetOkayEnabledState(equipmentAmount != 0);
  14.141 +			ui.ListenToWidgets();
  14.142 +		}
  14.143 +
  14.144 +		private void SetEquipmentAmountsFromPercentage(double equipAmount)
  14.145 +		{
  14.146 +			if (equipAmount > maxPercentage)
  14.147 +			{
  14.148 +				string percentageTooLarge = Translation.GetTranslation("equipPercentageTooLarge", "the current percentage ({0}%) was larger than the maximum for the equipment item ({1}%) - the maximum value will be used instead", equipAmount, maxPercentage);
  14.149 +				string percentageTooLargeTitle = Translation.GetTranslation("equipPercentageTooLargeTitle", "equipment percentage too large");
  14.150 +				ShowMessage(percentageTooLarge, percentageTooLargeTitle);
  14.151 +				equipAmount = maxPercentage;
  14.152 +			}
  14.153 +			else
  14.154 +			{
  14.155 +				if (equipAmount < minPercentage)
  14.156 +				{
  14.157 +					string percentageTooSmall = Translation.GetTranslation("equipPercentageTooSmall", "the current percentage ({0}%) was smaller than the minimum for the equipment item ({1}%) - the minimum value will be used instead", equipAmount, minPercentage);
  14.158 +					string percentageTooSmallTitle = Translation.GetTranslation("equipPercentageTooSmallTitle", "equipment percentage too small");
  14.159 +					ShowMessage(percentageTooSmall, percentageTooSmallTitle);
  14.160 +					equipAmount = minPercentage;
  14.161 +				}
  14.162 +
  14.163 +			}			
  14.164 +			ui.EquipmentNumericAmount = CalculateNumericValueFromPercentage(equipAmount);
  14.165 +			ui.EquipmentPercentageAmount = equipAmount;
  14.166 +		}
  14.167 +
  14.168 +		private int CalculateNumericValueFromPercentage(double percent)
  14.169 +		{
  14.170 +			int calcedAmount = (int)CustomMath.IBBMath.Round((unit.Size * (percent / 100.0)), equipItem.RoundNumberUp);
  14.171 +			return Math.Min(Math.Max(calcedAmount, minNumber), maxNumber);
  14.172 +		}
  14.173 +
  14.174 +		private void ShowMessage(string message, string title)
  14.175 +		{
  14.176 +			Gtk.MessageDialog dialog = new Gtk.MessageDialog(null, Gtk.DialogFlags.Modal, Gtk.MessageType.Warning, Gtk.ButtonsType.Ok, false, message);
  14.177 +			dialog.Title = title;
  14.178 +			dialog.Run();
  14.179 +			dialog.Hide();
  14.180 +			dialog.Dispose();
  14.181 +		}
  14.182 +
  14.183 +		private void SetEquipmentAmountsFromNumber(int equipAmount)
  14.184 +		{
  14.185 +			if (equipAmount > maxNumber)
  14.186 +			{
  14.187 +				string amountTooLarge = Translation.GetTranslation("equipNumberTooLarge", "the current amount ({0}) was larger than the maximum for the equipment item ({1}) - the maximum value will be used instead", equipAmount, maxNumber);
  14.188 +				string amountTooLargeTitle = Translation.GetTranslation("equipNumberTooLargeTitle", "equipment amount too large");
  14.189 +				ShowMessage(amountTooLarge, amountTooLargeTitle);
  14.190 +				equipAmount = maxNumber;
  14.191 +			}
  14.192 +			else
  14.193 +			{
  14.194 +				if (equipAmount < minNumber)
  14.195 +				{
  14.196 +					string amountTooSmall = Translation.GetTranslation("equipNumberTooSmall", "the current amount ({0}) was smaller than the minimum for the equipment item ({1}) - the minimum value will be used instead", equipAmount, minNumber);
  14.197 +					string amountTooSmallTitle = Translation.GetTranslation("equipNumberTooSmallTitle", "equipment amount too small");
  14.198 +					ShowMessage(amountTooSmall, amountTooSmallTitle);
  14.199 +					equipAmount = minNumber;
  14.200 +				}
  14.201 +
  14.202 +			}			
  14.203 +			ui.EquipmentPercentageAmount = CalcualtePercentageValueFromNumber(equipAmount);
  14.204 +			ui.EquipmentNumericAmount = equipAmount;
  14.205 +		}
  14.206 +
  14.207 +		private double CalcualtePercentageValueFromNumber(int number)
  14.208 +		{
  14.209 +			double calcedAmount = RoundPercentage(CustomMath.IBBMath.Percentage(number, unit.Size));
  14.210 +			return Math.Min(Math.Max(calcedAmount, minPercentage), maxPercentage);
  14.211 +		}
  14.212 +
  14.213 +		protected void SetEquipmentAmountControlEnabledStates()
  14.214 +		{
  14.215 +			ui.SetNumericAmountEnabledState(!isRatioAmount);
  14.216 +			ui.SetPercentageAmountEnabledState(true);
  14.217 +		}
  14.218 +
  14.219 +		protected double GetMaxPercentageLimit(UnitEquipmentItem equip)
  14.220 +		{
  14.221 +			double maxPercent = RoundPercentage(UnitEquipmentUtil.GetMaxEquipmentPercentage(unit, equip));
  14.222 +			return Math.Max(0, maxPercent);
  14.223 +		}
  14.224 +
  14.225 +		protected double GetMinPercentageLimit(UnitEquipmentItem equip)
  14.226 +		{
  14.227 +			double minPercent = RoundPercentage(UnitEquipmentUtil.GetMinEquipmentPercentage(unit, equip));
  14.228 +			return Math.Max(0, minPercent);
  14.229 +		}
  14.230 +
  14.231 +		protected int GetMaxNumericLimit(UnitEquipmentItem equip)
  14.232 +		{
  14.233 +			int maxNumber = UnitEquipmentUtil.GetMaxEquipmentCount(unit, equip);
  14.234 +			return Math.Max(0, maxNumber);
  14.235 +		}
  14.236 +
  14.237 +		protected int GetMinNumericLimit(UnitEquipmentItem equip)
  14.238 +		{
  14.239 +			int minNumber = UnitEquipmentUtil.GetMinEquipmentCount(unit, equip);
  14.240 +			return Math.Max(0, minNumber);
  14.241 +		}
  14.242 +
  14.243 +		protected bool HasNonZeroEquipmentAmount()
  14.244 +		{
  14.245 +			bool nonZero;
  14.246 +			
  14.247 +			if (isRatioAmount)
  14.248 +			{
  14.249 +				nonZero = (ui.EquipmentPercentageAmount > 0);
  14.250 +			}
  14.251 +			else
  14.252 +			{
  14.253 +				nonZero = (ui.EquipmentNumericAmount > 0);
  14.254 +			}
  14.255 +			
  14.256 +			return nonZero;
  14.257 +		}
  14.258 +
  14.259 +		private double RoundPercentage(double percent)
  14.260 +		{
  14.261 +			return Math.Round(percent, 1);
  14.262 +		}
  14.263 +
  14.264 +		public void Show()
  14.265 +		{			
  14.266 +			SetupUI();
  14.267 +			bool okayed = ui.ShowControl();
  14.268 +			
  14.269 +			if (okayed)
  14.270 +			{
  14.271 +				DoProcessing();
  14.272 +			}
  14.273 +			
  14.274 +			ui.Dispose();
  14.275 +		}	
  14.276 +		
  14.277 +		/// <summary>
  14.278 +		/// Does the processing required for the control when the "OK" button was clicked
  14.279 +		/// </summary>
  14.280 +
  14.281 +		protected abstract void DoProcessing();
  14.282 +	}
  14.283 +}
  14.284 +
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/UIControl/AddEquipmentUIControl.cs	Mon Jan 17 19:43:47 2011 +0000
    15.3 @@ -0,0 +1,63 @@
    15.4 +//  This file (AddEquipmentUIControl.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    15.5 +// 
    15.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.
    15.7 +
    15.8 +using IBBoard.Commands;
    15.9 +using IBBoard.WarFoundry.API.Commands;
   15.10 +using IBBoard.WarFoundry.API.Objects;
   15.11 +using IBBoard.WarFoundry.API.Util;
   15.12 +using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
   15.13 +using CustomMath = IBBoard.CustomMath;
   15.14 +
   15.15 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl
   15.16 +{
   15.17 +	public class AddEquipmentUIControl : AbstractBaseEquipmentUIControl<IAddEquipmentUI>
   15.18 +	{		
   15.19 +		public AddEquipmentUIControl(Unit unit, CommandStack commandStack) : base(unit, commandStack)
   15.20 +		{
   15.21 +			//Do nothing extra
   15.22 +		}
   15.23 +
   15.24 +		//TODO Make abstract
   15.25 +
   15.26 +		protected override IAddEquipmentUI CreateEquipmentUI()
   15.27 +		{
   15.28 +			return new FrmAddEquipment();
   15.29 +		}
   15.30 +
   15.31 +		protected override void CompleteUISetup()
   15.32 +		{
   15.33 +			ui.SetUnitEquipmentItems(GetEquipmentItems(unit));
   15.34 +			ui.UnitEquipmentItemChoiceChanged += HandleUiUnitEquipmentItemChoiceChanged;
   15.35 +		}
   15.36 +
   15.37 +		public static UnitEquipmentItem[] GetEquipmentItems(Unit unit)
   15.38 +		{
   15.39 +			return Arrays.Subtract(UnitEquipmentUtil.GetAllowedEquipmentItems(unit), unit.GetEquipment());
   15.40 +		}
   15.41 +
   15.42 +		public static bool HasEquipmentToAdd(Unit unit)
   15.43 +		{
   15.44 +			return GetEquipmentItems(unit).Length > 0;
   15.45 +		}
   15.46 +
   15.47 +		private void HandleUiUnitEquipmentItemChoiceChanged(UnitEquipmentItem equip)
   15.48 +		{
   15.49 +			equipItem = equip;
   15.50 +			SetUnitEquipmentLimits(equip);
   15.51 +		}
   15.52 +
   15.53 +		protected override void DoProcessing()
   15.54 +		{
   15.55 +			if (isRatioAmount)
   15.56 +			{
   15.57 +				commandStack.Execute(new SetUnitEquipmentRatioAmountCommand(unit, equipItem, equipmentAmount));
   15.58 +			}
   15.59 +			else
   15.60 +			{
   15.61 +				commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, (int)equipmentAmount));
   15.62 +			}
   15.63 +		}
   15.64 +	}
   15.65 +}
   15.66 +
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/UIControl/EditEquipmentUIControl.cs	Mon Jan 17 19:43:47 2011 +0000
    16.3 @@ -0,0 +1,51 @@
    16.4 +//  This file (EditEquipmentUIControl.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    16.5 +// 
    16.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.
    16.7 +
    16.8 +using System;
    16.9 +using IBBoard.Commands;
   16.10 +using IBBoard.WarFoundry.API.Objects;
   16.11 +using IBBoard.WarFoundry.API.Util;
   16.12 +using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
   16.13 +using IBBoard.WarFoundry.API.Commands;
   16.14 +using CustomMath = IBBoard.CustomMath;
   16.15 +using IBBoard.Lang;
   16.16 +using IBBoard.WarFoundry.GUI.GTK;
   16.17 +
   16.18 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl
   16.19 +{
   16.20 +	public class EditEquipmentUIControl : AbstractBaseEquipmentUIControl<IEditEquipmentUI>
   16.21 +	{		
   16.22 +		public EditEquipmentUIControl(Unit unit, UnitEquipmentItem item, CommandStack commandStack) : base(unit, commandStack)
   16.23 +		{
   16.24 +			this.equipItem = item;
   16.25 +		}
   16.26 +
   16.27 +		//TODO Make abstract
   16.28 +
   16.29 +		protected override IEditEquipmentUI CreateEquipmentUI()
   16.30 +		{
   16.31 +			return new FrmEditEquipment();
   16.32 +		}
   16.33 +		
   16.34 +		protected override void CompleteUISetup()
   16.35 +		{
   16.36 +			SetUnitEquipmentLimits(equipItem);
   16.37 +			SetUnitEquipmentValuesFromEquipment(equipItem);
   16.38 +			ui.SetEquipmentAmountType(UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, equipItem));
   16.39 +		}
   16.40 +
   16.41 +		protected override void DoProcessing()
   16.42 +		{
   16.43 +			if (isRatioAmount)
   16.44 +			{
   16.45 +				commandStack.Execute(new SetUnitEquipmentRatioAmountCommand(unit, equipItem, equipmentAmount));
   16.46 +			}
   16.47 +			else
   16.48 +			{
   16.49 +				commandStack.Execute(new SetUnitEquipmentNumericAmountCommand(unit, equipItem, (int)equipmentAmount));
   16.50 +			}
   16.51 +		}
   16.52 +	}
   16.53 +}
   16.54 +
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/UIControl/Interfaces/IAddEquipmentUI.cs	Mon Jan 17 19:43:47 2011 +0000
    17.3 @@ -0,0 +1,16 @@
    17.4 +//  This file (IAddEquipmentUI.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    17.5 +// 
    17.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.
    17.7 +using System;
    17.8 +using IBBoard.WarFoundry.API.Objects;
    17.9 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces
   17.10 +{
   17.11 +	/// <summary>
   17.12 +	/// The interface that UI components should implement to represent "Add Equipment" dialogs or system equivalents (e.g. console areas or HTML fragments)
   17.13 +	/// </summary>
   17.14 +	public interface IAddEquipmentUI : ISelectableItemEquipmentUI
   17.15 +	{
   17.16 +		//Marker interface
   17.17 +	}
   17.18 +}
   17.19 +
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/UIControl/Interfaces/IBaseEquipmentUI.cs	Mon Jan 17 19:43:47 2011 +0000
    18.3 @@ -0,0 +1,144 @@
    18.4 +//  This file (IBaseEquipmentUI.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    18.5 +// 
    18.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.
    18.7 +
    18.8 +using System;
    18.9 +
   18.10 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces
   18.11 +{
   18.12 +	/// <summary>
   18.13 +	/// The base interface that all "UI control" controlled interfaces implement. It provides common definitions for all classes
   18.14 +	/// </summary>
   18.15 +	public interface IBaseEquipmentUI : IDisposable
   18.16 +	{
   18.17 +		/// <summary>
   18.18 +		/// Occurs when the unit equipment amount type changes (e.g. percentage to numeric)
   18.19 +		/// </summary>
   18.20 +		event MethodInvoker UnitEquipmentAmountTypeChanged;
   18.21 +
   18.22 +		/// <summary>
   18.23 +		/// Occurs when the unit equipment amount changes
   18.24 +		/// </summary>
   18.25 +
   18.26 +		event MethodInvoker UnitEquipmentAmountChanged;
   18.27 +		
   18.28 +		/// <summary>
   18.29 +		/// Causes the UI to listen to its widgets and fire events
   18.30 +		/// </summary>
   18.31 +
   18.32 +		void ListenToWidgets();
   18.33 +		
   18.34 +		/// <summary>
   18.35 +		/// Causes the UI to ignore the widgets so that changes do not fire events
   18.36 +		/// </summary>
   18.37 +
   18.38 +		void IgnoreWidgets();
   18.39 +
   18.40 +		/// <summary>
   18.41 +		/// Sets the limits for the currently selected equipment item
   18.42 +		/// </summary>
   18.43 +		/// <param name='isRatioLimit'>
   18.44 +		/// <code>True</code> if the current limit is a ratio limit, else <code>false</code> for absolute limits
   18.45 +		/// </param>
   18.46 +		/// <param name='minPercent'>
   18.47 +		/// The minimum limit as a percentage
   18.48 +		/// </param>
   18.49 +		/// <param name='maxPercent'>
   18.50 +		/// The maximum limit as a percentage
   18.51 +		/// </param>
   18.52 +		/// <param name='minNumber'>
   18.53 +		/// The minimum number as an absolute figure
   18.54 +		/// </param>
   18.55 +		/// <param name='maxNumber'>
   18.56 +		/// The maximum number as an absolute figure
   18.57 +		/// </param>
   18.58 +
   18.59 +		void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber);
   18.60 +
   18.61 +		/// <summary>
   18.62 +		/// Sets whether the unit equipment limit UI components should be enabled and able to accept input. This will 
   18.63 +		/// generally pass the values on to the <see cref="SetNumericAmountEnabledState(bool)"/> and
   18.64 +		/// <see cref="SetPercentageAmountEnabledState(bool)"/> methods and is included for convenience
   18.65 +		/// </summary>
   18.66 +		/// <param name='isEnabled'>
   18.67 +		/// <code>True</code> if the UI components should accept input, else <code>false</code>
   18.68 +		/// </param>
   18.69 +
   18.70 +		void SetUnitEquipmentLimitsEnabled(bool isEnabled);
   18.71 +
   18.72 +		/// <summary>
   18.73 +		/// Shows the control and awaits a user action (close or okay)
   18.74 +		/// </summary>
   18.75 +		/// <returns>
   18.76 +		/// <code>true</code> if the control was closed with "Okay", else <code>false</code>
   18.77 +		/// </returns>
   18.78 +
   18.79 +		bool ShowControl();
   18.80 +
   18.81 +		/// <summary>
   18.82 +		/// Gets a value indicating whether the equipment amount is a ratio or an absolute number.
   18.83 +		/// </summary>
   18.84 +		/// <value>
   18.85 +		/// <c>true</c> if the selected amount is a ratio type (percentage or "all"); otherwise, <c>false</c>.
   18.86 +		/// </value>
   18.87 +
   18.88 +		bool IsRatioEquipmentAmount
   18.89 +		{
   18.90 +			get;
   18.91 +		}
   18.92 +
   18.93 +		/// <summary>
   18.94 +		/// Gets and sets the numeric amount for the current equipment amount. This number is meaningless if <see cref="IsRatioEquipmentAmount"/> is <code>true</code>
   18.95 +		/// </summary>
   18.96 +		/// <value>
   18.97 +		/// The absolue number of items taken.
   18.98 +		/// </value>
   18.99 +
  18.100 +		int EquipmentNumericAmount
  18.101 +		{
  18.102 +			get;
  18.103 +			set;
  18.104 +		}
  18.105 +
  18.106 +		/// <summary>
  18.107 +		/// Gets and sets the percentage amount for the current equipment amount. This number is meaningless if <see cref="IsRatioEquipmentAmount"/> is <code>false</code>
  18.108 +		/// </summary>
  18.109 +		/// <value>
  18.110 +		/// The number of items taken as a percentage of the unit size.
  18.111 +		/// </value>
  18.112 +
  18.113 +		double EquipmentPercentageAmount
  18.114 +		{
  18.115 +			get;
  18.116 +			set;
  18.117 +		}
  18.118 +
  18.119 +		/// <summary>
  18.120 +		/// Sets the state of the Okay button.
  18.121 +		/// </summary>
  18.122 +		/// <param name='enabled'>
  18.123 +		/// <code>true</code> to enable the button, else <code>false</code>
  18.124 +		/// </param>
  18.125 +
  18.126 +		void SetOkayEnabledState(bool enabled);
  18.127 +
  18.128 +		/// <summary>
  18.129 +		/// Sets the state of the numeric equipment amount control.
  18.130 +		/// </summary>
  18.131 +		/// <param name='enabled'>
  18.132 +		/// <code>true</code> to enable the control, else <code>false</code>
  18.133 +		/// </param>
  18.134 +
  18.135 +		void SetNumericAmountEnabledState(bool enabled);
  18.136 +
  18.137 +		/// <summary>
  18.138 +		/// Sets the state of the percentage equipment amount control.
  18.139 +		/// </summary>
  18.140 +		/// <param name='enabled'>
  18.141 +		/// <code>true</code> to enable the control, else <code>false</code>
  18.142 +		/// </param>
  18.143 +
  18.144 +		void SetPercentageAmountEnabledState(bool enabled);
  18.145 +	}
  18.146 +}
  18.147 +
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/UIControl/Interfaces/IEditEquipmentUI.cs	Mon Jan 17 19:43:47 2011 +0000
    19.3 @@ -0,0 +1,24 @@
    19.4 +//  This file (IEditEquipmentUI.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    19.5 +// 
    19.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.
    19.7 +
    19.8 +using System;
    19.9 +using IBBoard.WarFoundry.API.Objects;
   19.10 +
   19.11 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces
   19.12 +{
   19.13 +	/// <summary>
   19.14 +	/// The interface that UI components should implement to represent "Edit Equipment" dialogs or system equivalents (e.g. console areas or HTML fragments)
   19.15 +	/// </summary>
   19.16 +	public interface IEditEquipmentUI : IBaseEquipmentUI
   19.17 +	{
   19.18 +		/// <summary>
   19.19 +		/// Sets the type of the equipment amount.
   19.20 +		/// </summary>
   19.21 +		/// <param name='isRatioLimit'>
   19.22 +		/// <code>True</code> for ratio selection amounts, else <code>false</code> for numeric amounts
   19.23 +		/// </param>
   19.24 +		void SetEquipmentAmountType(bool isRatioLimit);
   19.25 +	}
   19.26 +}
   19.27 +
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/UIControl/Interfaces/IReplaceEquipmentUI.cs	Mon Jan 17 19:43:47 2011 +0000
    20.3 @@ -0,0 +1,17 @@
    20.4 +//  This file (IReplaceEquipmentUI.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    20.5 +// 
    20.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.
    20.7 +
    20.8 +using System;
    20.9 +
   20.10 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces
   20.11 +{
   20.12 +	/// <summary>
   20.13 +	/// The interface that UI components should implement to represent "Replace Equipment" dialogs or system equivalents (e.g. console areas or HTML fragments)
   20.14 +	/// </summary>
   20.15 +	public interface IReplaceEquipmentUI : ISelectableItemEquipmentUI
   20.16 +	{
   20.17 +		//Marker interface
   20.18 +	}
   20.19 +}
   20.20 +
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/UIControl/Interfaces/ISelectableItemEquipmentUI.cs	Mon Jan 17 19:43:47 2011 +0000
    21.3 @@ -0,0 +1,38 @@
    21.4 +//  This file (ISelectableItemEquipmentUI.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    21.5 +// 
    21.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.
    21.7 +using System;
    21.8 +using IBBoard.WarFoundry.API.Objects;
    21.9 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces
   21.10 +{
   21.11 +	/// <summary>
   21.12 +	/// 
   21.13 +	/// </summary>
   21.14 +	public interface ISelectableItemEquipmentUI : IBaseEquipmentUI
   21.15 +	{
   21.16 +		/// <summary>
   21.17 +		/// Should be fired when unit equipment item choice changes.
   21.18 +		/// </summary>
   21.19 +		event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged;
   21.20 +
   21.21 +		/// <summary>
   21.22 +		/// Sets the equipment items that should be displayed on the form
   21.23 +		/// </summary>
   21.24 +		/// <param name='items'>
   21.25 +		/// The equipment items that should be displayed on the form
   21.26 +		/// </param>
   21.27 +		void SetUnitEquipmentItems(UnitEquipmentItem[] items);
   21.28 +
   21.29 +		/// <summary>
   21.30 +		/// Gets the selected equipment item.
   21.31 +		/// </summary>
   21.32 +		/// <value>
   21.33 +		/// The selected equipment item.
   21.34 +		/// </value>
   21.35 +		UnitEquipmentItem SelectedUnitEquipmentItem
   21.36 +		{
   21.37 +			get;
   21.38 +		}
   21.39 +	}
   21.40 +}
   21.41 +
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/UIControl/ReplaceEquipmentUIControl.cs	Mon Jan 17 19:43:47 2011 +0000
    22.3 @@ -0,0 +1,60 @@
    22.4 +//  This file (AddEquipmentUIControl.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    22.5 +// 
    22.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.
    22.7 +
    22.8 +using IBBoard.Commands;
    22.9 +using IBBoard.WarFoundry.API.Commands;
   22.10 +using IBBoard.WarFoundry.API.Objects;
   22.11 +using IBBoard.WarFoundry.API.Util;
   22.12 +using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
   22.13 +using CustomMath = IBBoard.CustomMath;
   22.14 +
   22.15 +namespace IBBoard.WarFoundry.GUI.GTK.UIControl
   22.16 +{
   22.17 +	public class ReplaceEquipmentUIControl : AbstractBaseEquipmentUIControl<IReplaceEquipmentUI>
   22.18 +	{		
   22.19 +		private UnitEquipmentItem origItem;
   22.20 +		
   22.21 +		public ReplaceEquipmentUIControl(Unit unit, UnitEquipmentItem equipmentItem, CommandStack commandStack) : base(unit, commandStack)
   22.22 +		{
   22.23 +			origItem = equipmentItem;
   22.24 +		}
   22.25 +
   22.26 +		//TODO Make abstract
   22.27 +
   22.28 +		protected override IReplaceEquipmentUI CreateEquipmentUI()
   22.29 +		{
   22.30 +			return new FrmReplaceEquipment();
   22.31 +		}
   22.32 +
   22.33 +		protected override void CompleteUISetup()
   22.34 +		{			
   22.35 +			UnitType unitType = unit.UnitType;
   22.36 +			string[] mutexGroups = origItem.MutexGroups;
   22.37 +			UnitEquipmentItem[] mutexItems = unitType.GetEquipmentItemsByExclusionGroups(mutexGroups);
   22.38 +			UnitEquipmentItem[] currentEquipment = unit.GetEquipment();
   22.39 +			UnitEquipmentItem[] allowedItems = Arrays.Subtract(mutexItems, currentEquipment);
   22.40 +			ui.SetUnitEquipmentItems(allowedItems);
   22.41 +			ui.UnitEquipmentItemChoiceChanged += HandleUiUnitEquipmentItemChoiceChanged;
   22.42 +		}
   22.43 +
   22.44 +		private void HandleUiUnitEquipmentItemChoiceChanged(UnitEquipmentItem equip)
   22.45 +		{
   22.46 +			equipItem = equip;
   22.47 +			SetUnitEquipmentLimits(equip);
   22.48 +		}
   22.49 +
   22.50 +		protected override void DoProcessing()
   22.51 +		{
   22.52 +			if (isRatioAmount)
   22.53 +			{
   22.54 +				commandStack.Execute(new ReplaceUnitEquipmentWithRatioAmountItemCommand(unit, origItem, equipItem, equipmentAmount));
   22.55 +			}
   22.56 +			else
   22.57 +			{
   22.58 +				commandStack.Execute(new ReplaceUnitEquipmentWithRatioAmountItemCommand(unit, origItem, equipItem, (int)equipmentAmount));
   22.59 +			}
   22.60 +		}
   22.61 +	}
   22.62 +}
   22.63 +
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/Util/GtkWarFoundryUtil.cs	Mon Jan 17 19:43:47 2011 +0000
    23.3 @@ -0,0 +1,17 @@
    23.4 +//  This file (GtkWarFoundryUtil.cs) is a part of the IBBoard.WarFoundry.GUI.GTK project and is copyright 2010 IBBoard
    23.5 +// 
    23.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.
    23.7 +using System;
    23.8 +using IBBoard.WarFoundry.API.Objects;
    23.9 +using Gtk;
   23.10 +namespace IBBoard.WarFoundry.GUI.GTK.Util
   23.11 +{
   23.12 +	public class GtkWarFoundryUtil
   23.13 +	{
   23.14 +		public static void RenderWarFoundryObjectName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
   23.15 +		{
   23.16 +			WarFoundryObject equip = (WarFoundryObject)model.GetValue(iter, 0);
   23.17 +			(cell as CellRendererText).Text = equip.Name;
   23.18 +		}
   23.19 +	}
   23.20 +}
   23.21 \ No newline at end of file
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/WarFoundry-GTK.exe.log4net	Mon Jan 17 19:43:47 2011 +0000
    24.3 @@ -0,0 +1,23 @@
    24.4 +<?xml version="1.0" encoding="utf-8" ?>
    24.5 +<log4net>
    24.6 +	<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
    24.7 +		<layout type="log4net.Layout.PatternLayout">
    24.8 +			<conversionPattern value="%-5p [%d{HH:MM:ss}]: %C{1}.%M() - Line: %L - %m%n" />
    24.9 +		</layout>
   24.10 +	</appender>
   24.11 +	<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
   24.12 +		<file value="logs/WarFoundry.log" />
   24.13 +		<appendToFile value="false" />
   24.14 +		<rollingStyle value="Size" />
   24.15 +		<maxSizeRollBackups value="-1" />
   24.16 +		<maximumFileSize value="100MB" />
   24.17 +		<layout type="log4net.Layout.PatternLayout">
   24.18 +			<conversionPattern value="%-5p [%d{HH:MM:ss}]: %C{1}.%M() - Line: %L - %m%n" />
   24.19 +		</layout>
   24.20 +	</appender>
   24.21 +	<root>
   24.22 +		<level value="DEBUG" />
   24.23 +		<appender-ref ref="ConsoleAppender" />
   24.24 +		<appender-ref ref="RollingLogFileAppender" />
   24.25 +	</root>
   24.26 +</log4net>
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/WarFoundry-GTKPref.xml	Mon Jan 17 19:43:47 2011 +0000
    25.3 @@ -0,0 +1,13 @@
    25.4 +<?xml version="1.0" encoding="ISO-8859-1"?>
    25.5 +<!DOCTYPE preferences[
    25.6 +  <!ELEMENT preference (CDATA|preferenceArr+)> 
    25.7 +  <!ELEMENT preferenceArr (CDATA)>
    25.8 +  <!ATTLIST preference id ID #REQUIRED>
    25.9 +  <!ATTLIST preference type CDATA #REQUIRED>
   25.10 +  <!ATTLIST preferenceArr id ID #REQUIRED>
   25.11 +]>
   25.12 +<preferences>
   25.13 +<preference id="language" type="System.String">en</preference>
   25.14 +<preference id="currSystem" type="System.String"></preference>
   25.15 +<preference id="logLevel" type="System.String">Info</preference>
   25.16 +</preferences>
    26.1 --- a/WarFoundryGTK.exe.log4net	Sun Jan 31 20:46:06 2010 +0000
    26.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.3 @@ -1,23 +0,0 @@
    26.4 -<?xml version="1.0" encoding="utf-8" ?>
    26.5 -<log4net>
    26.6 -	<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender" >
    26.7 -		<layout type="log4net.Layout.PatternLayout">
    26.8 -			<conversionPattern value="%-5p [%d{HH:MM:ss}]: %C{1}.%M() - Line: %L - %m%n" />
    26.9 -		</layout>
   26.10 -	</appender>
   26.11 -	<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
   26.12 -		<file value="logs/WarFoundry.log" />
   26.13 -		<appendToFile value="false" />
   26.14 -		<rollingStyle value="Size" />
   26.15 -		<maxSizeRollBackups value="-1" />
   26.16 -		<maximumFileSize value="100MB" />
   26.17 -		<layout type="log4net.Layout.PatternLayout">
   26.18 -			<conversionPattern value="%-5p [%d{HH:MM:ss}]: %C{1}.%M() - Line: %L - %m%n" />
   26.19 -		</layout>
   26.20 -	</appender>
   26.21 -	<root>
   26.22 -		<level value="DEBUG" />
   26.23 -		<appender-ref ref="ConsoleAppender" />
   26.24 -		<appender-ref ref="RollingLogFileAppender" />
   26.25 -	</root>
   26.26 -</log4net>
    27.1 --- a/WarFoundryGTKPref.xml	Sun Jan 31 20:46:06 2010 +0000
    27.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.3 @@ -1,13 +0,0 @@
    27.4 -<?xml version="1.0" encoding="ISO-8859-1"?>
    27.5 -<!DOCTYPE preferences[
    27.6 -  <!ELEMENT preference (CDATA|preferenceArr+)> 
    27.7 -  <!ELEMENT preferenceArr (CDATA)>
    27.8 -  <!ATTLIST preference id ID #REQUIRED>
    27.9 -  <!ATTLIST preference type CDATA #REQUIRED>
   27.10 -  <!ATTLIST preferenceArr id ID #REQUIRED>
   27.11 -]>
   27.12 -<preferences>
   27.13 -<preference id="language" type="System.String">en</preference>
   27.14 -<preference id="currSystem" type="System.String"></preference>
   27.15 -<preference id="logLevel" type="System.String">Info</preference>
   27.16 -</preferences>
    28.1 --- a/Widgets/UnitDisplayWidget.cs	Sun Jan 31 20:46:06 2010 +0000
    28.2 +++ b/Widgets/UnitDisplayWidget.cs	Mon Jan 17 19:43:47 2011 +0000
    28.3 @@ -5,143 +5,389 @@
    28.4  using System;
    28.5  using Gtk;
    28.6  using IBBoard.Commands;
    28.7 +using IBBoard.GtkSharp;
    28.8  using IBBoard.Lang;
    28.9  using IBBoard.WarFoundry.API;
   28.10 +using IBBoard.WarFoundry.API.Commands;
   28.11  using IBBoard.WarFoundry.API.Objects;
   28.12 -using IBBoard.WarFoundry.API.Commands;
   28.13 +using IBBoard.WarFoundry.API.Util;
   28.14 +using IBBoard.WarFoundry.GUI.GTK.UIControl;
   28.15 +using log4net;
   28.16 +using WFObjects = IBBoard.WarFoundry.API.Objects;
   28.17 +using System.Collections.Generic;
   28.18 +using IBBoard.GtkSharp.Translatable;
   28.19  
   28.20 -namespace IBBoard.WarFoundry.GTK.Widgets
   28.21 +namespace IBBoard.WarFoundry.GUI.GTK.Widgets
   28.22  {
   28.23  	[System.ComponentModel.Category("WarFoundry GTK# GUI")]
   28.24  	[System.ComponentModel.ToolboxItem(true)]
   28.25  	public partial class UnitDisplayWidget : Gtk.Bin
   28.26 -	{		
   28.27 -		private IBBoard.WarFoundry.API.Objects.Unit unit;
   28.28 +	{
   28.29 +		private static ILog log = LogManager.GetLogger(typeof(UnitDisplayWidget));
   28.30 +		private WFObjects.Unit unit;
   28.31  		private CommandStack stack;
   28.32 -		
   28.33 -		public UnitDisplayWidget(IBBoard.WarFoundry.API.Objects.Unit sourceUnit, CommandStack commandStack)
   28.34 +		private Dictionary<string, NodeView> statsViews = new Dictionary<string, NodeView>();
   28.35 +
   28.36 +		public UnitDisplayWidget(WFObjects.Unit sourceUnit, CommandStack commandStack)
   28.37  		{
   28.38  			this.Build();
   28.39  			stack = commandStack;
   28.40  			unit = sourceUnit;
   28.41  			unitName.Text = unit.Name;
   28.42  			unitSize.Value = unit.Size;
   28.43 -			double max = unit.UnitType.MaxSize;
   28.44 +			int maxSize = (unit.UnitType.MaxSize == WarFoundryCore.INFINITY ? int.MaxValue : unit.UnitType.MaxSize);
   28.45 +			int minSize = unit.UnitType.MinSize;
   28.46 +			unitSize.SetRange(minSize, maxSize);
   28.47 +			unitSize.Sensitive = (maxSize != minSize);
   28.48 +			notesView.Buffer.Text = unit.UnitType.Notes;
   28.49 +			unit.NameChanged += UnitNameChanged;
   28.50 +			unit.UnitSizeChanged += UnitSizeChanged;
   28.51 +			unit.UnitEquipmentAmountChanged += HandleUnitUnitEquipmentAmountChanged;
   28.52 +			equipmentList.Selection.Changed += HandleEquipmentListSelectionChanged;
   28.53 +			SetAbilities();
   28.54 +			SetStats();
   28.55 +			SetWeapons();
   28.56 +			SetAddButtonEnabledState();
   28.57 +			ControlTranslator.TranslateWidget(this);
   28.58 +		}
   28.59 +
   28.60 +		private void HandleEquipmentListSelectionChanged(object sender, EventArgs e)
   28.61 +		{
   28.62 +			SetButtonsEnabledState();	
   28.63 +		}
   28.64 +
   28.65 +		private void SetButtonsEnabledState()
   28.66 +		{			
   28.67 +			UnitEquipmentItem equipItem = GetSelectedEquipmentItem();
   28.68 +			bttnReplaceWeapon.Sensitive = (equipItem != null && equipItem.HasAlternatives());
   28.69 +			bttnEditWeapon.Sensitive = (UnitEquipmentUtil.CanEditEquipmentAmount(unit, equipItem));
   28.70 +			bttnRemoveWeapon.Sensitive = (equipItem != null && !equipItem.IsRequired);
   28.71 +		}
   28.72 +
   28.73 +		private void SetAddButtonEnabledState()
   28.74 +		{
   28.75 +			bttnAddWeapon.Sensitive = AddEquipmentUIControl.HasEquipmentToAdd(unit);
   28.76 +		}
   28.77 +
   28.78 +		private UnitEquipmentItem GetSelectedEquipmentItem()
   28.79 +		{
   28.80 +			return (UnitEquipmentItem)TreeUtils.GetSelectedItem(equipmentList);
   28.81 +		}
   28.82 +
   28.83 +		private void SetAbilities()
   28.84 +		{
   28.85 +			CellRendererText renderer = new CellRendererText();
   28.86 +			abilitiesList.AppendColumn("", renderer, new TreeCellDataFunc(RenderAbility));
   28.87  			
   28.88 -			if (max == -1)
   28.89 +			ListStore model = new ListStore(typeof(Ability));
   28.90 +			
   28.91 +			foreach (Ability ability in unit.UnitType.GetRequiredAbilities())
   28.92  			{
   28.93 -				max = double.MaxValue;
   28.94 +				model.AppendValues(ability);
   28.95  			}
   28.96  			
   28.97 -			unitSize.SetRange(unit.UnitType.MinSize, max);
   28.98 -			unit.NameChanged+= new StringValChangedDelegate(UnitNameChanged);
   28.99 -			unit.UnitSizeChanged+= new IntValChangedDelegate(UnitSizeChanged);
  28.100 -			SetStats();
  28.101 +			abilitiesList.Model = model;
  28.102 +		}
  28.103 +
  28.104 +		public void RenderAbility(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
  28.105 +		{
  28.106 +			object o = model.GetValue(iter, 0);
  28.107 +			
  28.108 +			if (o is Ability)
  28.109 +			{
  28.110 +				Ability ability = (Ability)o;
  28.111 +				(cell as CellRendererText).Text = ability.Name;
  28.112 +			}			
  28.113 +						
  28.114  		}
  28.115  
  28.116  		private void SetStats()
  28.117  		{
  28.118 -            //GameSystem system = unit.Army.GameSystem;
  28.119 -            //SystemStats stats = system.StandardSystemStats;
  28.120 -            CellRendererText renderer = new CellRendererText();
  28.121 -            unitStats.AppendColumn(Translation.GetTranslation("UnitNameColumn", "Unit Type", null), renderer, new TreeCellDataFunc(RenderUnitName));
  28.122 -            
  28.123 -            TreeCellDataFunc statFunc = new TreeCellDataFunc(RenderUnitStat);
  28.124 -            Stat[] stats = unit.UnitStatsArray;
  28.125 -			
  28.126 -			int length = stats.Length;
  28.127 +			Stat[][] stats = unit.UnitStatsArraysWithName;
  28.128 +			string[] statsIDs = unit.UnitStatsArrayIDs;
  28.129 +			int statsCount = stats.Length;
  28.130 +			log.DebugFormat("Unit {0} has {1} stats arrays", unit.UnitType.Name, statsCount);
  28.131  
  28.132 -			for (int i = 0; i < length; i++)
  28.133 +			for (int i = 0; i < statsCount; i++)
  28.134  			{
  28.135 -	            unitStats.AppendColumn(stats[i].ParentSlotName, renderer, statFunc);
  28.136 +				NodeView statsGrid = GetStatsView(statsIDs[i]);
  28.137 +				TreeStore model = (TreeStore)statsGrid.Model;
  28.138 +				log.DebugFormat("Adding row to data table for {0}", statsIDs[i]);
  28.139 +				log.DebugFormat("TreeStore supports {0} columns", model.NColumns);
  28.140 +				model.AppendValues((object)stats[i]);
  28.141 +			}
  28.142 +		}
  28.143 +
  28.144 +		private NodeView GetStatsView(string statsID)
  28.145 +		{
  28.146 +			NodeView statsView;
  28.147 +
  28.148 +			if (statsViews.ContainsKey(statsID))
  28.149 +			{
  28.150 +				statsView = DictionaryUtils.GetValue(statsViews, statsID);
  28.151 +			}
  28.152 +			else
  28.153 +			{
  28.154 +				statsView = CreateStatsView(statsID);
  28.155 +				statsViews[statsID] = statsView;
  28.156  			}
  28.157  
  28.158 -			TreeStore model = new TreeStore(typeof(IBBoard.WarFoundry.API.Objects.Unit));
  28.159 -			model.AppendValues(unit);
  28.160 -			unitStats.Model = model;
  28.161 +			return statsView;
  28.162  		}
  28.163 -		
  28.164 -		private void RenderUnitName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
  28.165 +
  28.166 +		private NodeView CreateStatsView(string statsID)
  28.167  		{
  28.168 -			object o = model.GetValue(iter, 0);
  28.169 +			log.DebugFormat("Create NodeView for stats ID {0}", statsID);
  28.170 +			SystemStats sysStats = unit.Race.GameSystem.GetSystemStatsForID(statsID);
  28.171 +			StatSlot[] sysStatSlots = sysStats.StatSlots;
  28.172 +			int statsCount = sysStatSlots.Length;
  28.173 +			NodeView statsGrid = CreateNodeView();
  28.174 +			CellRendererText renderer = new CellRendererText();
  28.175 +			statsGrid.AppendColumn(Translation.GetTranslation("UnitNameColumn", "Unit Type", null), renderer, RenderUnitStat);
  28.176 +
  28.177 +			for (int i = 0; i < statsCount; i++)
  28.178 +			{
  28.179 +				StatSlot stat = sysStatSlots[i];
  28.180 +				string slotName = stat.Name;
  28.181 +				statsGrid.AppendColumn(slotName, renderer, RenderUnitStat);
  28.182 +			}
  28.183  			
  28.184 -			if (o is IBBoard.WarFoundry.API.Objects.Unit)
  28.185 -			{
  28.186 -				IBBoard.WarFoundry.API.Objects.Unit u = (IBBoard.WarFoundry.API.Objects.Unit)o;				
  28.187 -				(cell as CellRendererText).Text = u.UnitType.Name;
  28.188 -			}
  28.189 +			statsGrid.Model = new TreeStore(typeof(Stat[]));
  28.190 +			return statsGrid;
  28.191  		}
  28.192 -		
  28.193 +
  28.194 +		private NodeView CreateNodeView()
  28.195 +		{
  28.196 +			NodeView nodeView = new NodeView();
  28.197 +			statsRepeatBox.Add(nodeView);
  28.198 +			return nodeView;
  28.199 +		}
  28.200 +
  28.201  		private void RenderUnitStat(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
  28.202  		{
  28.203  			object o = model.GetValue(iter, 0);
  28.204  			
  28.205 -			if (o is IBBoard.WarFoundry.API.Objects.Unit)
  28.206 +			if (o is Stat[])
  28.207  			{
  28.208 -				IBBoard.WarFoundry.API.Objects.Unit u = (IBBoard.WarFoundry.API.Objects.Unit)o;
  28.209 -				(cell as CellRendererText).Text = u.GetStatValue(column.Title);
  28.210 +				Stat[] stats = (Stat[])o;
  28.211 +				(cell as CellRendererText).Text = stats[GetStatColumnIndex(column)].SlotValueString;
  28.212  			}
  28.213  		}
  28.214  
  28.215 -		public IBBoard.WarFoundry.API.Objects.Unit Unit
  28.216 +		private int GetStatColumnIndex(TreeViewColumn column)
  28.217 +		{
  28.218 +			int idx = -1;
  28.219 +			TreeViewColumn[] cols = ((TreeView)column.TreeView).Columns;
  28.220 +			int colCount = cols.Length;
  28.221 +			
  28.222 +			for (int i = 0; i < colCount; i++)
  28.223 +			{
  28.224 +				if (cols[i] == column)
  28.225 +				{
  28.226 +					idx = i;
  28.227 +					break;
  28.228 +				}
  28.229 +			}
  28.230 +			
  28.231 +			return idx;
  28.232 +		}
  28.233 +
  28.234 +		private void SetWeapons()
  28.235 +		{
  28.236 +			CellRendererText renderer = new CellRendererText();
  28.237 +			equipmentList.AppendColumn("", renderer, new TreeCellDataFunc(RenderEquipmentLine));
  28.238 +			
  28.239 +			ListStore model = new ListStore(typeof(UnitEquipmentItem));
  28.240 +			
  28.241 +			foreach (UnitEquipmentItem item in unit.GetEquipment())
  28.242 +			{
  28.243 +				model.AppendValues(item);
  28.244 +			}
  28.245 +			
  28.246 +			equipmentList.Model = model;
  28.247 +		}
  28.248 +
  28.249 +		public void RenderEquipmentLine(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
  28.250 +		{
  28.251 +			object o = model.GetValue(iter, 0);
  28.252 +			
  28.253 +			if (o is UnitEquipmentItem)
  28.254 +			{
  28.255 +				UnitEquipmentItem item = (UnitEquipmentItem)o;
  28.256 +				(cell as CellRendererText).Text = GetUnitEquipmentText(item);
  28.257 +			}			
  28.258 +						
  28.259 +		}
  28.260 +
  28.261 +		private string GetUnitEquipmentText(UnitEquipmentItem item)
  28.262 +		{
  28.263 +			string translation = "";
  28.264 +
  28.265 +			if (item.Cost == 0)
  28.266 +			{
  28.267 +				translation = Translation.GetTranslation("equipmentAmountWithZeroCost", "{0} ({1} - free)", item.Name, GetAmountString(item));
  28.268 +			}
  28.269 +			else
  28.270 +			{
  28.271 +				translation = Translation.GetTranslation("equipmentAmountWithCost", "{0} ({1} at {2}pts each)", item.Name, GetAmountString(item), item.Cost);
  28.272 +			}
  28.273 +
  28.274 +			return translation;
  28.275 +		}
  28.276 +
  28.277 +		private string GetAmountString(UnitEquipmentItem item)
  28.278 +		{
  28.279 +			double amount = UnitEquipmentUtil.GetEquipmentAmount(unit, item);
  28.280 +			string amountString = "";
  28.281 +			
  28.282 +			if (UnitEquipmentUtil.GetEquipmentAmountIsRatio(unit, item))
  28.283 +			{
  28.284 +				int number = UnitEquipmentUtil.GetEquipmentAmountTaken(unit, item);
  28.285 +				
  28.286 +				if (amount == 100)
  28.287 +				{
  28.288 +					amountString = Translation.GetTranslation("equipmentChoiceAmountAll", "all ({1})", amount, number);
  28.289 +				}
  28.290 +				else
  28.291 +				{
  28.292 +					amountString = Translation.GetTranslation("equipmentChoiceAmountPercentage", "{0}% ({1})", amount, number);
  28.293 +				}
  28.294 +			}
  28.295 +			else
  28.296 +			{
  28.297 +				amountString = Translation.GetTranslation("equipmentChoiceAmountNumber", "{0}", amount);
  28.298 +			}
  28.299 +			
  28.300 +			return amountString;
  28.301 +		}
  28.302 +
  28.303 +		public WFObjects.Unit Unit
  28.304  		{
  28.305  			get { return unit; }
  28.306  		}
  28.307 -		
  28.308 +
  28.309  		private void UnitNameChanged(WarFoundryObject obj, string oldValue, string newValue)
  28.310  		{
  28.311  			unitName.Text = newValue;
  28.312  		}
  28.313 -		
  28.314 +
  28.315  		private void UnitSizeChanged(WarFoundryObject obj, int oldValue, int newValue)
  28.316  		{
  28.317  			unitSize.Value = newValue;
  28.318  		}
  28.319  
  28.320 -		protected virtual void OnUnitSizeFocusOut (object o, Gtk.FocusOutEventArgs args)
  28.321 +		private void HandleUnitUnitEquipmentAmountChanged(WarFoundryObject obj, double oldValue, double newValue)
  28.322 +		{
  28.323 +			if (oldValue == 0)
  28.324 +			{
  28.325 +				((ListStore)equipmentList.Model).AppendValues(obj);
  28.326 +			}
  28.327 +			else
  28.328 +			{
  28.329 +				if (newValue == 0)
  28.330 +				{
  28.331 +					TreeIter treeIter = TreeUtils.GetItemIter(equipmentList, obj);
  28.332 +					((ListStore)equipmentList.Model).Remove(ref treeIter);
  28.333 +				}
  28.334 +			}
  28.335 +
  28.336 +			SetAddButtonEnabledState();
  28.337 +			equipmentList.QueueDraw();
  28.338 +		}
  28.339 +
  28.340 +		protected virtual void OnUnitSizeFocusOut(object o, Gtk.FocusOutEventArgs args)
  28.341  		{
  28.342  			SetNewUnitSize();
  28.343  		}
  28.344  
  28.345  		[GLib.ConnectBefore ()]
  28.346 -		protected virtual void OnUnitSizeKeyPress (object o, Gtk.KeyPressEventArgs args)
  28.347 +
  28.348 +		protected virtual void OnUnitSizeKeyPress(object o, Gtk.KeyPressEventArgs args)
  28.349  		{
  28.350 -			if (args.Event.Key == Gdk.Key.Return)
  28.351 +			if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter)
  28.352  			{
  28.353  				SetNewUnitSize();
  28.354  			}
  28.355  		}
  28.356 -		
  28.357 +
  28.358  		private void SetNewUnitSize()
  28.359  		{
  28.360 -			if (unitSize.Value!=unit.Size)
  28.361 +			if (unitSize.Value != unit.Size)
  28.362  			{
  28.363  				SetUnitSizeCommand cmd = new SetUnitSizeCommand(unit, (int)Math.Round(unitSize.Value));
  28.364  				stack.Execute(cmd);
  28.365  			}
  28.366  		}
  28.367  
  28.368 -		protected virtual void OnUnitNameFocusOut (object o, Gtk.FocusOutEventArgs args)
  28.369 +		protected virtual void OnUnitNameFocusOut(object o, Gtk.FocusOutEventArgs args)
  28.370  		{
  28.371  			SetNewUnitName();
  28.372  		}
  28.373  
  28.374  		[GLib.ConnectBefore ()]
  28.375 -		protected virtual void OnUnitNameKeyPress (object o, Gtk.KeyPressEventArgs args)
  28.376 +
  28.377 +		protected virtual void OnUnitNameKeyPress(object o, Gtk.KeyPressEventArgs args)
  28.378  		{
  28.379 -			if (args.Event.Key == Gdk.Key.Return)
  28.380 +			if (args.Event.Key == Gdk.Key.Return || args.Event.Key == Gdk.Key.KP_Enter)
  28.381  			{
  28.382  				SetNewUnitName();
  28.383  			}
  28.384  		}
  28.385 -		
  28.386 +
  28.387  		private void SetNewUnitName()
  28.388  		{
  28.389 -			if (unitName.Text!=unit.Name)
  28.390 +			if (unitName.Text != unit.Name)
  28.391  			{
  28.392  				SetNameCommand cmd = new SetNameCommand(unit, unitName.Text);
  28.393  				stack.Execute(cmd);
  28.394  			}
  28.395  		}
  28.396 +
  28.397 +		private void OnBttnAddEquipmentClicked(object sender, System.EventArgs e)
  28.398 +		{
  28.399 +			AddEquipment();
  28.400 +		}
  28.401 +
  28.402 +		private void AddEquipment()
  28.403 +		{
  28.404 +			AddEquipmentUIControl addEquipment = new AddEquipmentUIControl(unit, stack);
  28.405 +			addEquipment.Show();
  28.406 +		}
  28.407 +
  28.408 +		protected virtual void HandleRemoveButtonActivated(object sender, System.EventArgs e)
  28.409 +		{
  28.410 +			UnitEquipmentItem item = GetSelectedEquipmentItem();
  28.411 +			log.Debug("Remove " + item);
  28.412 +				
  28.413 +			if (item != null)
  28.414 +			{
  28.415 +				SetUnitEquipmentNumericAmountCommand cmd = new SetUnitEquipmentNumericAmountCommand(unit, item, 0);
  28.416 +				stack.Execute(cmd);
  28.417 +			}
  28.418 +		}		
  28.419 +
  28.420 +		protected virtual void HandleEditButtonClicked(object sender, System.EventArgs e)
  28.421 +		{
  28.422 +			UnitEquipmentItem item = GetSelectedEquipmentItem();
  28.423 +			log.Debug("Edit " + item);
  28.424 +			
  28.425 +			if (item != null)
  28.426 +			{
  28.427 +				EditEquipmentUIControl editEquipment = new EditEquipmentUIControl(unit, item, stack);
  28.428 +				editEquipment.Show();
  28.429 +			}
  28.430 +		}
  28.431 +
  28.432 +		protected virtual void HandleReplaceButtonClicked(object sender, System.EventArgs e)
  28.433 +		{
  28.434 +			UnitEquipmentItem item = GetSelectedEquipmentItem();
  28.435 +			log.Debug("Replace " + item);
  28.436 +				
  28.437 +			if (item != null)
  28.438 +			{
  28.439 +				ReplaceEquipmentUIControl addEquipment = new ReplaceEquipmentUIControl(unit, item, stack);
  28.440 +				addEquipment.Show();
  28.441 +			}
  28.442 +		}		
  28.443  	}
  28.444 -}
  28.445 +}
  28.446 \ No newline at end of file
    29.1 --- a/gtk-gui/IBBoard.WarFoundry.GTK.FrmMainWindow.cs	Sun Jan 31 20:46:06 2010 +0000
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,240 +0,0 @@
    29.4 -// ------------------------------------------------------------------------------
    29.5 -//  <autogenerated>
    29.6 -//      This code was generated by a tool.
    29.7 -//      
    29.8 -// 
    29.9 -//      Changes to this file may cause incorrect behavior and will be lost if 
   29.10 -//      the code is regenerated.
   29.11 -//  </autogenerated>
   29.12 -// ------------------------------------------------------------------------------
   29.13 -
   29.14 -namespace IBBoard.WarFoundry.GTK {
   29.15 -    
   29.16 -    
   29.17 -    public partial class FrmMainWindow {
   29.18 -        
   29.19 -        private Gtk.UIManager UIManager;
   29.20 -        
   29.21 -        private Gtk.Action menuFile;
   29.22 -        
   29.23 -        private Gtk.Action miCreateArmy;
   29.24 -        
   29.25 -        private Gtk.Action miOpenArmy;
   29.26 -        
   29.27 -        private Gtk.Action miSaveArmy;
   29.28 -        
   29.29 -        private Gtk.Action miSaveArmyAs;
   29.30 -        
   29.31 -        private Gtk.Action miCloseArmy;
   29.32 -        
   29.33 -        private Gtk.Action miReloadFiles;
   29.34 -        
   29.35 -        private Gtk.Action miExit;
   29.36 -        
   29.37 -        private Gtk.Action menuEdit;
   29.38 -        
   29.39 -        private Gtk.Action miUndo;
   29.40 -        
   29.41 -        private Gtk.Action miRedo;
   29.42 -        
   29.43 -        private Gtk.Action menuHelp;
   29.44 -        
   29.45 -        private Gtk.Action miAbout;
   29.46 -        
   29.47 -        private Gtk.Action miDebugInformation;
   29.48 -        
   29.49 -        private Gtk.Action newArmyButton;
   29.50 -        
   29.51 -        private Gtk.Action openArmyButton;
   29.52 -        
   29.53 -        private Gtk.Action saveArmyButton;
   29.54 -        
   29.55 -        private Gtk.Action undoActionButton;
   29.56 -        
   29.57 -        private Gtk.Action redoActionButton;
   29.58 -        
   29.59 -        private Gtk.Action goDown;
   29.60 -        
   29.61 -        private Gtk.Action add;
   29.62 -        
   29.63 -        private Gtk.Action miExportArmy;
   29.64 -        
   29.65 -        private Gtk.Action miExportAsBasicHtml;
   29.66 -        
   29.67 -        private Gtk.VBox vbox1;
   29.68 -        
   29.69 -        private Gtk.MenuBar menubar1;
   29.70 -        
   29.71 -        private Gtk.Toolbar toolbar;
   29.72 -        
   29.73 -        private Gtk.HPaned hpaned2;
   29.74 -        
   29.75 -        private Gtk.TreeView treeUnits;
   29.76 -        
   29.77 -        private Gtk.Notebook unitsNotebook;
   29.78 -        
   29.79 -        private Gtk.Statusbar statusbar1;
   29.80 -        
   29.81 -        protected virtual void Build() {
   29.82 -            Stetic.Gui.Initialize(this);
   29.83 -            // Widget IBBoard.WarFoundry.GTK.FrmMainWindow
   29.84 -            this.UIManager = new Gtk.UIManager();
   29.85 -            Gtk.ActionGroup w1 = new Gtk.ActionGroup("Default");
   29.86 -            this.menuFile = new Gtk.Action("menuFile", Mono.Unix.Catalog.GetString("File"), null, null);
   29.87 -            this.menuFile.ShortLabel = Mono.Unix.Catalog.GetString("File");
   29.88 -            w1.Add(this.menuFile, null);
   29.89 -            this.miCreateArmy = new Gtk.Action("miCreateArmy", Mono.Unix.Catalog.GetString("Create army"), null, "gtk-new");
   29.90 -            this.miCreateArmy.ShortLabel = Mono.Unix.Catalog.GetString("Create army");
   29.91 -            w1.Add(this.miCreateArmy, null);
   29.92 -            this.miOpenArmy = new Gtk.Action("miOpenArmy", Mono.Unix.Catalog.GetString("Open army"), null, "gtk-open");
   29.93 -            this.miOpenArmy.ShortLabel = Mono.Unix.Catalog.GetString("Open army");
   29.94 -            w1.Add(this.miOpenArmy, null);
   29.95 -            this.miSaveArmy = new Gtk.Action("miSaveArmy", Mono.Unix.Catalog.GetString("Save army"), null, "gtk-save");
   29.96 -            this.miSaveArmy.Sensitive = false;
   29.97 -            this.miSaveArmy.ShortLabel = Mono.Unix.Catalog.GetString("Save army");
   29.98 -            w1.Add(this.miSaveArmy, null);
   29.99 -            this.miSaveArmyAs = new Gtk.Action("miSaveArmyAs", Mono.Unix.Catalog.GetString("Save army as"), null, "gtk-save-as");
  29.100 -            this.miSaveArmyAs.Sensitive = false;
  29.101 -            this.miSaveArmyAs.ShortLabel = Mono.Unix.Catalog.GetString("Save army as");
  29.102 -            w1.Add(this.miSaveArmyAs, null);
  29.103 -            this.miCloseArmy = new Gtk.Action("miCloseArmy", Mono.Unix.Catalog.GetString("Close army"), null, "gtk-close");
  29.104 -            this.miCloseArmy.Sensitive = false;
  29.105 -            this.miCloseArmy.ShortLabel = Mono.Unix.Catalog.GetString("Close army");
  29.106 -            w1.Add(this.miCloseArmy, null);
  29.107 -            this.miReloadFiles = new Gtk.Action("miReloadFiles", Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh");
  29.108 -            this.miReloadFiles.Sensitive = false;
  29.109 -            this.miReloadFiles.ShortLabel = Mono.Unix.Catalog.GetString("Reload files");
  29.110 -            w1.Add(this.miReloadFiles, null);
  29.111 -            this.miExit = new Gtk.Action("miExit", Mono.Unix.Catalog.GetString("Exit"), null, "gtk-quit");
  29.112 -            this.miExit.ShortLabel = Mono.Unix.Catalog.GetString("Exit");
  29.113 -            w1.Add(this.miExit, null);
  29.114 -            this.menuEdit = new Gtk.Action("menuEdit", Mono.Unix.Catalog.GetString("Edit"), null, null);
  29.115 -            this.menuEdit.ShortLabel = Mono.Unix.Catalog.GetString("Edit");
  29.116 -            w1.Add(this.menuEdit, null);
  29.117 -            this.miUndo = new Gtk.Action("miUndo", Mono.Unix.Catalog.GetString("Undo"), null, "gtk-undo");
  29.118 -            this.miUndo.Sensitive = false;
  29.119 -            this.miUndo.ShortLabel = Mono.Unix.Catalog.GetString("Undo");
  29.120 -            w1.Add(this.miUndo, null);
  29.121 -            this.miRedo = new Gtk.Action("miRedo", Mono.Unix.Catalog.GetString("Redo"), null, "gtk-redo");
  29.122 -            this.miRedo.Sensitive = false;
  29.123 -            this.miRedo.ShortLabel = Mono.Unix.Catalog.GetString("Redo");
  29.124 -            w1.Add(this.miRedo, null);
  29.125 -            this.menuHelp = new Gtk.Action("menuHelp", Mono.Unix.Catalog.GetString("Help"), null, null);
  29.126 -            this.menuHelp.ShortLabel = Mono.Unix.Catalog.GetString("Help");
  29.127 -            w1.Add(this.menuHelp, null);
  29.128 -            this.miAbout = new Gtk.Action("miAbout", Mono.Unix.Catalog.GetString("About"), null, "gtk-about");
  29.129 -            this.miAbout.ShortLabel = Mono.Unix.Catalog.GetString("About");
  29.130 -            w1.Add(this.miAbout, null);
  29.131 -            this.miDebugInformation = new Gtk.Action("miDebugInformation", Mono.Unix.Catalog.GetString("Debug Information"), null, null);
  29.132 -            this.miDebugInformation.ShortLabel = Mono.Unix.Catalog.GetString("Debug Information");
  29.133 -            w1.Add(this.miDebugInformation, null);
  29.134 -            this.newArmyButton = new Gtk.Action("newArmyButton", null, null, "gtk-new");
  29.135 -            w1.Add(this.newArmyButton, null);
  29.136 -            this.openArmyButton = new Gtk.Action("openArmyButton", null, null, "gtk-open");
  29.137 -            w1.Add(this.openArmyButton, null);
  29.138 -            this.saveArmyButton = new Gtk.Action("saveArmyButton", null, null, "gtk-save");
  29.139 -            this.saveArmyButton.Sensitive = false;
  29.140 -            w1.Add(this.saveArmyButton, null);
  29.141 -            this.undoActionButton = new Gtk.Action("undoActionButton", null, null, "gtk-undo");
  29.142 -            this.undoActionButton.Sensitive = false;
  29.143 -            w1.Add(this.undoActionButton, null);
  29.144 -            this.redoActionButton = new Gtk.Action("redoActionButton", null, null, "gtk-redo");
  29.145 -            this.redoActionButton.Sensitive = false;
  29.146 -            w1.Add(this.redoActionButton, null);
  29.147 -            this.goDown = new Gtk.Action("goDown", null, null, null);
  29.148 -            w1.Add(this.goDown, null);
  29.149 -            this.add = new Gtk.Action("add", null, null, "gtk-add");
  29.150 -            w1.Add(this.add, null);
  29.151 -            this.miExportArmy = new Gtk.Action("miExportArmy", Mono.Unix.Catalog.GetString("Export army as..."), null, "gtk-convert");
  29.152 -            this.miExportArmy.Sensitive = false;
  29.153 -            this.miExportArmy.ShortLabel = Mono.Unix.Catalog.GetString("Export army");
  29.154 -            w1.Add(this.miExportArmy, null);
  29.155 -            this.miExportAsBasicHtml = new Gtk.Action("miExportAsBasicHtml", Mono.Unix.Catalog.GetString("Basic HTML"), null, null);
  29.156 -            this.miExportAsBasicHtml.ShortLabel = Mono.Unix.Catalog.GetString("Basic HTML");
  29.157 -            w1.Add(this.miExportAsBasicHtml, null);
  29.158 -            this.UIManager.InsertActionGroup(w1, 0);
  29.159 -            this.AddAccelGroup(this.UIManager.AccelGroup);
  29.160 -            this.Name = "IBBoard.WarFoundry.GTK.FrmMainWindow";
  29.161 -            this.Title = Mono.Unix.Catalog.GetString("MainWindow");
  29.162 -            this.Icon = Gdk.Pixbuf.LoadFromResource("App.ico");
  29.163 -            // Container child IBBoard.WarFoundry.GTK.FrmMainWindow.Gtk.Container+ContainerChild
  29.164 -            this.vbox1 = new Gtk.VBox();
  29.165 -            this.vbox1.Name = "vbox1";
  29.166 -            // Container child vbox1.Gtk.Box+BoxChild
  29.167 -            this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='menuFile' action='menuFile'><menuitem name='miCreateArmy' action='miCreateArmy'/><menuitem name='miOpenArmy' action='miOpenArmy'/><menuitem name='miSaveArmy' action='miSaveArmy'/><menuitem name='miSaveArmyAs' action='miSaveArmyAs'/><menu name='miExportArmy' action='miExportArmy'><menuitem name='miExportAsBasicHtml' action='miExportAsBasicHtml'/></menu><menuitem name='miCloseArmy' action='miCloseArmy'/><separator/><menuitem name='miReloadFiles' action='miReloadFiles'/><separator/><menuitem name='miExit' action='miExit'/></menu><menu name='menuEdit' action='menuEdit'><menuitem name='miUndo' action='miUndo'/><menuitem name='miRedo' action='miRedo'/></menu><menu name='menuHelp' action='menuHelp'><menuitem name='miAbout' action='miAbout'/><menuitem name='miDebugInformation' action='miDebugInformation'/></menu></menubar></ui>");
  29.168 -            this.menubar1 = ((Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1")));
  29.169 -            this.menubar1.Name = "menubar1";
  29.170 -            this.vbox1.Add(this.menubar1);
  29.171 -            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.menubar1]));
  29.172 -            w2.Position = 0;
  29.173 -            w2.Expand = false;
  29.174 -            w2.Fill = false;
  29.175 -            // Container child vbox1.Gtk.Box+BoxChild
  29.176 -            this.UIManager.AddUiFromString("<ui><toolbar name='toolbar'><toolitem name='newArmyButton' action='newArmyButton'/><toolitem name='openArmyButton' action='openArmyButton'/><toolitem name='saveArmyButton' action='saveArmyButton'/><separator/><toolitem name='undoActionButton' action='undoActionButton'/><toolitem name='redoActionButton' action='redoActionButton'/><separator/></toolbar></ui>");
  29.177 -            this.toolbar = ((Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar")));
  29.178 -            this.toolbar.HeightRequest = 36;
  29.179 -            this.toolbar.Name = "toolbar";
  29.180 -            this.toolbar.ShowArrow = false;
  29.181 -            this.toolbar.ToolbarStyle = ((Gtk.ToolbarStyle)(0));
  29.182 -            this.toolbar.IconSize = ((Gtk.IconSize)(3));
  29.183 -            this.vbox1.Add(this.toolbar);
  29.184 -            Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.toolbar]));
  29.185 -            w3.Position = 1;
  29.186 -            w3.Expand = false;
  29.187 -            w3.Fill = false;
  29.188 -            // Container child vbox1.Gtk.Box+BoxChild
  29.189 -            this.hpaned2 = new Gtk.HPaned();
  29.190 -            this.hpaned2.CanFocus = true;
  29.191 -            this.hpaned2.Name = "hpaned2";
  29.192 -            this.hpaned2.Position = 178;
  29.193 -            // Container child hpaned2.Gtk.Paned+PanedChild
  29.194 -            this.treeUnits = new Gtk.TreeView();
  29.195 -            this.treeUnits.CanFocus = true;
  29.196 -            this.treeUnits.Name = "treeUnits";
  29.197 -            this.hpaned2.Add(this.treeUnits);
  29.198 -            Gtk.Paned.PanedChild w4 = ((Gtk.Paned.PanedChild)(this.hpaned2[this.treeUnits]));
  29.199 -            w4.Resize = false;
  29.200 -            // Container child hpaned2.Gtk.Paned+PanedChild
  29.201 -            this.unitsNotebook = new Gtk.Notebook();
  29.202 -            this.unitsNotebook.CanFocus = true;
  29.203 -            this.unitsNotebook.Name = "unitsNotebook";
  29.204 -            this.unitsNotebook.CurrentPage = -1;
  29.205 -            this.hpaned2.Add(this.unitsNotebook);
  29.206 -            this.vbox1.Add(this.hpaned2);
  29.207 -            Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox1[this.hpaned2]));
  29.208 -            w6.Position = 2;
  29.209 -            // Container child vbox1.Gtk.Box+BoxChild
  29.210 -            this.statusbar1 = new Gtk.Statusbar();
  29.211 -            this.statusbar1.Name = "statusbar1";
  29.212 -            this.statusbar1.Spacing = 2;
  29.213 -            this.vbox1.Add(this.statusbar1);
  29.214 -            Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
  29.215 -            w7.Position = 3;
  29.216 -            w7.Expand = false;
  29.217 -            w7.Fill = false;
  29.218 -            this.Add(this.vbox1);
  29.219 -            if ((this.Child != null)) {
  29.220 -                this.Child.ShowAll();
  29.221 -            }
  29.222 -            this.DefaultWidth = 832;
  29.223 -            this.DefaultHeight = 659;
  29.224 -            this.Show();
  29.225 -            this.miCreateArmy.Activated += new System.EventHandler(this.OnCreateArmyActivated);
  29.226 -            this.miOpenArmy.Activated += new System.EventHandler(this.OnOpenArmyActivated);
  29.227 -            this.miSaveArmy.Activated += new System.EventHandler(this.OnSaveArmyActivated);
  29.228 -            this.miSaveArmyAs.Activated += new System.EventHandler(this.OnSaveArmyAsActivated);
  29.229 -            this.miCloseArmy.Activated += new System.EventHandler(this.OnCloseArmyActivated);
  29.230 -            this.miReloadFiles.Activated += new System.EventHandler(this.OnReloadFilesActivated);
  29.231 -            this.miExit.Activated += new System.EventHandler(this.OnExitActivated);
  29.232 -            this.newArmyButton.Activated += new System.EventHandler(this.newTBButtonActivated);
  29.233 -            this.openArmyButton.Activated += new System.EventHandler(this.openTBButtonActivated);
  29.234 -            this.saveArmyButton.Activated += new System.EventHandler(this.saveTBButtonActivated);
  29.235 -            this.undoActionButton.Activated += new System.EventHandler(this.undoTBButtonActivated);
  29.236 -            this.redoActionButton.Activated += new System.EventHandler(this.redoTBButtonActivated);
  29.237 -            this.miExportAsBasicHtml.Activated += new System.EventHandler(this.OnMiExportAsBasicHtmlActivated);
  29.238 -            this.treeUnits.RowActivated += new Gtk.RowActivatedHandler(this.ArmyRowActivated);
  29.239 -            this.treeUnits.PopupMenu += new Gtk.PopupMenuHandler(this.OnTreeUnitsPopupMenu);
  29.240 -            this.treeUnits.ButtonPressEvent += new Gtk.ButtonPressEventHandler(this.UnitTreeButtonPressed);
  29.241 -        }
  29.242 -    }
  29.243 -}
    30.1 --- a/gtk-gui/IBBoard.WarFoundry.GTK.FrmNewArmy.cs	Sun Jan 31 20:46:06 2010 +0000
    30.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.3 @@ -1,236 +0,0 @@
    30.4 -// ------------------------------------------------------------------------------
    30.5 -//  <autogenerated>
    30.6 -//      This code was generated by a tool.
    30.7 -//      
    30.8 -// 
    30.9 -//      Changes to this file may cause incorrect behavior and will be lost if 
   30.10 -//      the code is regenerated.
   30.11 -//  </autogenerated>
   30.12 -// ------------------------------------------------------------------------------
   30.13 -
   30.14 -namespace IBBoard.WarFoundry.GTK {
   30.15 -    
   30.16 -    
   30.17 -    public partial class FrmNewArmy {
   30.18 -        
   30.19 -        private Gtk.Table table1;
   30.20 -        
   30.21 -        private Gtk.ScrolledWindow GtkScrolledWindow;
   30.22 -        
   30.23 -        private Gtk.TreeView lstRaces;
   30.24 -        
   30.25 -        private Gtk.HBox hbox2;
   30.26 -        
   30.27 -        private Gtk.SpinButton sbPointsValue;
   30.28 -        
   30.29 -        private Gtk.Label label1;
   30.30 -        
   30.31 -        private Gtk.Label label2;
   30.32 -        
   30.33 -        private Gtk.Label label3;
   30.34 -        
   30.35 -        private Gtk.Label label4;
   30.36 -        
   30.37 -        private Gtk.ComboBoxEntry systemCombo;
   30.38 -        
   30.39 -        private Gtk.Entry txtArmyName;
   30.40 -        
   30.41 -        private Gtk.Button bttnCancel;
   30.42 -        
   30.43 -        private Gtk.Button bttnCreate;
   30.44 -        
   30.45 -        protected virtual void Build() {
   30.46 -            Stetic.Gui.Initialize(this);
   30.47 -            // Widget IBBoard.WarFoundry.GTK.FrmNewArmy
   30.48 -            this.Events = ((Gdk.EventMask)(256));
   30.49 -            this.Name = "IBBoard.WarFoundry.GTK.FrmNewArmy";
   30.50 -            this.Title = Mono.Unix.Catalog.GetString("Create new army");
   30.51 -            this.Icon = Stetic.IconLoader.LoadIcon(this, "gtk-new", Gtk.IconSize.Menu, 16);
   30.52 -            this.WindowPosition = ((Gtk.WindowPosition)(4));
   30.53 -            this.SkipPagerHint = true;
   30.54 -            this.SkipTaskbarHint = true;
   30.55 -            // Internal child IBBoard.WarFoundry.GTK.FrmNewArmy.VBox
   30.56 -            Gtk.VBox w1 = this.VBox;
   30.57 -            w1.CanFocus = true;
   30.58 -            w1.Events = ((Gdk.EventMask)(256));
   30.59 -            w1.Name = "dialog_VBox";
   30.60 -            w1.BorderWidth = ((uint)(2));
   30.61 -            // Container child dialog_VBox.Gtk.Box+BoxChild
   30.62 -            this.table1 = new Gtk.Table(((uint)(4)), ((uint)(2)), false);
   30.63 -            this.table1.Name = "table1";
   30.64 -            this.table1.RowSpacing = ((uint)(6));
   30.65 -            this.table1.ColumnSpacing = ((uint)(6));
   30.66 -            // Container child table1.Gtk.Table+TableChild
   30.67 -            this.GtkScrolledWindow = new Gtk.ScrolledWindow();
   30.68 -            this.GtkScrolledWindow.Name = "GtkScrolledWindow";
   30.69 -            this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
   30.70 -            // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
   30.71 -            this.lstRaces = new Gtk.TreeView();
   30.72 -            this.lstRaces.HeightRequest = 150;
   30.73 -            this.lstRaces.CanFocus = true;
   30.74 -            this.lstRaces.Name = "lstRaces";
   30.75 -            this.lstRaces.HeadersVisible = false;
   30.76 -            this.lstRaces.RulesHint = true;
   30.77 -            this.GtkScrolledWindow.Add(this.lstRaces);
   30.78 -            this.table1.Add(this.GtkScrolledWindow);
   30.79 -            Gtk.Table.TableChild w3 = ((Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow]));
   30.80 -            w3.TopAttach = ((uint)(1));
   30.81 -            w3.BottomAttach = ((uint)(2));
   30.82 -            w3.LeftAttach = ((uint)(1));
   30.83 -            w3.RightAttach = ((uint)(2));
   30.84 -            w3.XOptions = ((Gtk.AttachOptions)(4));
   30.85 -            w3.YOptions = ((Gtk.AttachOptions)(4));
   30.86 -            // Container child table1.Gtk.Table+TableChild
   30.87 -            this.hbox2 = new Gtk.HBox();
   30.88 -            this.hbox2.Name = "hbox2";
   30.89 -            // Container child hbox2.Gtk.Box+BoxChild
   30.90 -            this.sbPointsValue = new Gtk.SpinButton(0, 2000000000, 100);
   30.91 -            this.sbPointsValue.WidthRequest = 150;
   30.92 -            this.sbPointsValue.CanFocus = true;
   30.93 -            this.sbPointsValue.Name = "sbPointsValue";
   30.94 -            this.sbPointsValue.Adjustment.PageIncrement = 1000;
   30.95 -            this.sbPointsValue.ClimbRate = 100;
   30.96 -            this.sbPointsValue.Numeric = true;
   30.97 -            this.sbPointsValue.Value = 1000;
   30.98 -            this.hbox2.Add(this.sbPointsValue);
   30.99 -            Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.hbox2[this.sbPointsValue]));
  30.100 -            w4.Position = 0;
  30.101 -            w4.Expand = false;
  30.102 -            w4.Fill = false;
  30.103 -            this.table1.Add(this.hbox2);
  30.104 -            Gtk.Table.TableChild w5 = ((Gtk.Table.TableChild)(this.table1[this.hbox2]));
  30.105 -            w5.TopAttach = ((uint)(3));
  30.106 -            w5.BottomAttach = ((uint)(4));
  30.107 -            w5.LeftAttach = ((uint)(1));
  30.108 -            w5.RightAttach = ((uint)(2));
  30.109 -            w5.XOptions = ((Gtk.AttachOptions)(4));
  30.110 -            w5.YOptions = ((Gtk.AttachOptions)(4));
  30.111 -            // Container child table1.Gtk.Table+TableChild
  30.112 -            this.label1 = new Gtk.Label();
  30.113 -            this.label1.Name = "label1";
  30.114 -            this.label1.LabelProp = Mono.Unix.Catalog.GetString("Race");
  30.115 -            this.table1.Add(this.label1);
  30.116 -            Gtk.Table.TableChild w6 = ((Gtk.Table.TableChild)(this.table1[this.label1]));
  30.117 -            w6.TopAttach = ((uint)(1));
  30.118 -            w6.BottomAttach = ((uint)(2));
  30.119 -            w6.XOptions = ((Gtk.AttachOptions)(4));
  30.120 -            w6.YOptions = ((Gtk.AttachOptions)(4));
  30.121 -            // Container child table1.Gtk.Table+TableChild
  30.122 -            this.label2 = new Gtk.Label();
  30.123 -            this.label2.Name = "label2";
  30.124 -            this.label2.LabelProp = Mono.Unix.Catalog.GetString("Army name");
  30.125 -            this.table1.Add(this.label2);
  30.126 -            Gtk.Table.TableChild w7 = ((Gtk.Table.TableChild)(this.table1[this.label2]));
  30.127 -            w7.TopAttach = ((uint)(2));
  30.128 -            w7.BottomAttach = ((uint)(3));
  30.129 -            w7.XOptions = ((Gtk.AttachOptions)(4));
  30.130 -            w7.YOptions = ((Gtk.AttachOptions)(4));
  30.131 -            // Container child table1.Gtk.Table+TableChild
  30.132 -            this.label3 = new Gtk.Label();
  30.133 -            this.label3.Name = "label3";
  30.134 -            this.label3.LabelProp = Mono.Unix.Catalog.GetString("Points value");
  30.135 -            this.table1.Add(this.label3);
  30.136 -            Gtk.Table.TableChild w8 = ((Gtk.Table.TableChild)(this.table1[this.label3]));
  30.137 -            w8.TopAttach = ((uint)(3));
  30.138 -            w8.BottomAttach = ((uint)(4));
  30.139 -            w8.XOptions = ((Gtk.AttachOptions)(4));
  30.140 -            w8.YOptions = ((Gtk.AttachOptions)(4));
  30.141 -            // Container child table1.Gtk.Table+TableChild
  30.142 -            this.label4 = new Gtk.Label();
  30.143 -            this.label4.Name = "label4";
  30.144 -            this.label4.LabelProp = Mono.Unix.Catalog.GetString("game system");
  30.145 -            this.table1.Add(this.label4);
  30.146 -            Gtk.Table.TableChild w9 = ((Gtk.Table.TableChild)(this.table1[this.label4]));
  30.147 -            w9.XOptions = ((Gtk.AttachOptions)(4));
  30.148 -            w9.YOptions = ((Gtk.AttachOptions)(4));
  30.149 -            // Container child table1.Gtk.Table+TableChild
  30.150 -            this.systemCombo = Gtk.ComboBoxEntry.NewText();
  30.151 -            this.systemCombo.Name = "systemCombo";
  30.152 -            this.table1.Add(this.systemCombo);
  30.153 -            Gtk.Table.TableChild w10 = ((Gtk.Table.TableChild)(this.table1[this.systemCombo]));
  30.154 -            w10.LeftAttach = ((uint)(1));
  30.155 -            w10.RightAttach = ((uint)(2));
  30.156 -            w10.YOptions = ((Gtk.AttachOptions)(4));
  30.157 -            // Container child table1.Gtk.Table+TableChild
  30.158 -            this.txtArmyName = new Gtk.Entry();
  30.159 -            this.txtArmyName.CanFocus = true;
  30.160 -            this.txtArmyName.Name = "txtArmyName";
  30.161 -            this.txtArmyName.IsEditable = true;
  30.162 -            this.txtArmyName.InvisibleChar = '•';
  30.163 -            this.table1.Add(this.txtArmyName);
  30.164 -            Gtk.Table.TableChild w11 = ((Gtk.Table.TableChild)(this.table1[this.txtArmyName]));
  30.165 -            w11.TopAttach = ((uint)(2));
  30.166 -            w11.BottomAttach = ((uint)(3));
  30.167 -            w11.LeftAttach = ((uint)(1));
  30.168 -            w11.RightAttach = ((uint)(2));
  30.169 -            w11.XOptions = ((Gtk.AttachOptions)(4));
  30.170 -            w11.YOptions = ((Gtk.AttachOptions)(4));
  30.171 -            w1.Add(this.table1);
  30.172 -            Gtk.Box.BoxChild w12 = ((Gtk.Box.BoxChild)(w1[this.table1]));
  30.173 -            w12.Position = 0;
  30.174 -            w12.Expand = false;
  30.175 -            w12.Fill = false;
  30.176 -            w12.Padding = ((uint)(6));
  30.177 -            // Internal child IBBoard.WarFoundry.GTK.FrmNewArmy.ActionArea
  30.178 -            Gtk.HButtonBox w13 = this.ActionArea;
  30.179 -            w13.CanFocus = true;
  30.180 -            w13.Events = ((Gdk.EventMask)(256));
  30.181 -            w13.Name = "WarFoundrySharp.FrmNewArmy_ActionArea";
  30.182 -            w13.Spacing = 6;
  30.183 -            w13.BorderWidth = ((uint)(5));
  30.184 -            w13.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
  30.185 -            // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  30.186 -            this.bttnCancel = new Gtk.Button();
  30.187 -            this.bttnCancel.CanFocus = true;
  30.188 -            this.bttnCancel.Name = "bttnCancel";
  30.189 -            this.bttnCancel.UseStock = true;
  30.190 -            this.bttnCancel.UseUnderline = true;
  30.191 -            this.bttnCancel.Label = "gtk-cancel";
  30.192 -            this.AddActionWidget(this.bttnCancel, -6);
  30.193 -            Gtk.ButtonBox.ButtonBoxChild w14 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCancel]));
  30.194 -            w14.Expand = false;
  30.195 -            w14.Fill = false;
  30.196 -            // Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  30.197 -            this.bttnCreate = new Gtk.Button();
  30.198 -            this.bttnCreate.Sensitive = false;
  30.199 -            this.bttnCreate.CanDefault = true;
  30.200 -            this.bttnCreate.CanFocus = true;
  30.201 -            this.bttnCreate.Name = "bttnCreate";
  30.202 -            this.bttnCreate.UseUnderline = true;
  30.203 -            // Container child bttnCreate.Gtk.Container+ContainerChild
  30.204 -            Gtk.Alignment w15 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
  30.205 -            // Container child GtkAlignment.Gtk.Container+ContainerChild
  30.206 -            Gtk.HBox w16 = new Gtk.HBox();
  30.207 -            w16.Spacing = 2;
  30.208 -            // Container child GtkHBox.Gtk.Container+ContainerChild
  30.209 -            Gtk.Image w17 = new Gtk.Image();
  30.210 -            w17.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-ok", Gtk.IconSize.Menu, 16);
  30.211 -            w16.Add(w17);
  30.212 -            // Container child GtkHBox.Gtk.Container+ContainerChild
  30.213 -            Gtk.Label w19 = new Gtk.Label();
  30.214 -            w19.LabelProp = Mono.Unix.Catalog.GetString("C_reate");
  30.215 -            w19.UseUnderline = true;
  30.216 -            w16.Add(w19);
  30.217 -            w15.Add(w16);
  30.218 -            this.bttnCreate.Add(w15);
  30.219 -            this.AddActionWidget(this.bttnCreate, -5);
  30.220 -            Gtk.ButtonBox.ButtonBoxChild w23 = ((Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCreate]));
  30.221 -            w23.Position = 1;
  30.222 -            w23.Expand = false;
  30.223 -            w23.Fill = false;
  30.224 -            if ((this.Child != null)) {
  30.225 -                this.Child.ShowAll();
  30.226 -            }
  30.227 -            this.DefaultWidth = 370;
  30.228 -            this.DefaultHeight = 348;
  30.229 -            this.Show();
  30.230 -            this.txtArmyName.Changed += new System.EventHandler(this.OnTextChanged);
  30.231 -            this.systemCombo.Changed += new System.EventHandler(this.OnSystemComboChanged);
  30.232 -            this.sbPointsValue.ChangeValue += new Gtk.ChangeValueHandler(this.OnSpinChangeValue);
  30.233 -            this.sbPointsValue.ValueChanged += new System.EventHandler(this.OnSpinValueChanged);
  30.234 -            this.sbPointsValue.Changed += new System.EventHandler(this.OnSpinValueChanged);
  30.235 -            this.bttnCancel.Clicked += new System.EventHandler(this.OnCancelClicked);
  30.236 -            this.bttnCreate.Clicked += new System.EventHandler(this.OnCreateClicked);
  30.237 -        }
  30.238 -    }
  30.239 -}
    31.1 --- a/gtk-gui/IBBoard.WarFoundry.GTK.FrmNewUnit.cs	Sun Jan 31 20:46:06 2010 +0000
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,140 +0,0 @@
    31.4 -// ------------------------------------------------------------------------------
    31.5 -//  <autogenerated>
    31.6 -//      This code was generated by a tool.
    31.7 -//      
    31.8 -// 
    31.9 -//      Changes to this file may cause incorrect behavior and will be lost if 
   31.10 -//      the code is regenerated.
   31.11 -//  </autogenerated>
   31.12 -// ------------------------------------------------------------------------------
   31.13 -
   31.14 -namespace IBBoard.WarFoundry.GTK {
   31.15 -    
   31.16 -    
   31.17 -    public partial class FrmNewUnit {
   31.18 -        
   31.19 -        private Gtk.VBox vbox2;
   31.20 -        
   31.21 -        private Gtk.HBox hbox1;
   31.22 -        
   31.23 -        private Gtk.Label label1;
   31.24 -        
   31.25 -        private Gtk.ScrolledWindow GtkScrolledWindow;
   31.26 -        
   31.27 -        private Gtk.TreeView lstUnitTypes;
   31.28 -        
   31.29 -        private Gtk.Label lblNewUnitWarning;
   31.30 -        
   31.31 -        private Gtk.Button buttonCancel;
   31.32 -        
   31.33 -        private Gtk.Button buttonOk;
   31.34 -        
   31.35 -        protected virtual void Build() {
   31.36 -            Stetic.Gui.Initialize(this);
   31.37 -            // Widget IBBoard.WarFoundry.GTK.FrmNewUnit
   31.38 -            this.Name = "IBBoard.WarFoundry.GTK.FrmNewUnit";
   31.39 -            this.Title = Mono.Unix.Catalog.GetString("Add new unit");
   31.40 -            this.Icon = Stetic.IconLoader.LoadIcon(this, "gtk-new", Gtk.IconSize.Menu, 16);
   31.41 -            this.WindowPosition = ((Gtk.WindowPosition)(4));
   31.42 -            this.Modal = true;
   31.43 -            this.SkipPagerHint = true;
   31.44 -            this.SkipTaskbarHint = true;
   31.45 -            // Internal child IBBoard.WarFoundry.GTK.FrmNewUnit.VBox
   31.46 -            Gtk.VBox w1 = this.VBox;
   31.47 -            w1.Name = "dialog1_VBox";
   31.48 -            w1.BorderWidth = ((uint)(2));
   31.49 -            // Container child dialog1_VBox.Gtk.Box+BoxChild
   31.50 -            this.vbox2 = new Gtk.VBox();
   31.51 -            this.vbox2.Name = "vbox2";
   31.52 -            this.vbox2.Spacing = 6;
   31.53 -            // Container child vbox2.Gtk.Box+BoxChild
   31.54 -            this.hbox1 = new Gtk.HBox();
   31.55 -            this.hbox1.Name = "hbox1";
   31.56 -            this.hbox1.Spacing = 6;
   31.57 -            // Container child hbox1.Gtk.Box+BoxChild
   31.58 -            this.label1 = new Gtk.Label();
   31.59 -            this.label1.Name = "label1";
   31.60 -            this.label1.LabelProp = Mono.Unix.Catalog.GetString("Unit Type:");
   31.61 -            this.hbox1.Add(this.label1);
   31.62 -            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.label1]));
   31.63 -            w2.Position = 0;
   31.64 -            w2.Expand = false;
   31.65 -            w2.Fill = false;
   31.66 -            // Container child hbox1.Gtk.Box+BoxChild
   31.67 -            this.GtkScrolledWindow = new Gtk.ScrolledWindow();
   31.68 -            this.GtkScrolledWindow.Name = "GtkScrolledWindow";
   31.69 -            this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
   31.70 -            // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
   31.71 -            this.lstUnitTypes = new Gtk.TreeView();
   31.72 -            this.lstUnitTypes.HeightRequest = 150;
   31.73 -            this.lstUnitTypes.CanFocus = true;
   31.74 -            this.lstUnitTypes.Name = "lstUnitTypes";
   31.75 -            this.lstUnitTypes.HeadersVisible = false;
   31.76 -            this.GtkScrolledWindow.Add(this.lstUnitTypes);
   31.77 -            this.hbox1.Add(this.GtkScrolledWindow);
   31.78 -            Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.hbox1[this.GtkScrolledWindow]));
   31.79 -            w4.Position = 1;
   31.80 -            this.vbox2.Add(this.hbox1);
   31.81 -            Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbox1]));
   31.82 -            w5.Position = 0;
   31.83 -            w5.Expand = false;
   31.84 -            w5.Fill = false;
   31.85 -            // Container child vbox2.Gtk.Box+BoxChild
   31.86 -            this.lblNewUnitWarning = new Gtk.Label();
   31.87 -            this.lblNewUnitWarning.Name = "lblNewUnitWarning";
   31.88 -            this.lblNewUnitWarning.Xalign = 0F;
   31.89 -            this.lblNewUnitWarning.Yalign = 0F;
   31.90 -            this.vbox2.Add(this.lblNewUnitWarning);
   31.91 -            Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox2[this.lblNewUnitWarning]));
   31.92 -            w6.Position = 1;
   31.93 -            w6.Expand = false;
   31.94 -            w6.Fill = false;
   31.95 -            w1.Add(this.vbox2);
   31.96 -            Gtk.Box.BoxChild w7 = ((Gtk.Box.BoxChild)(w1[this.vbox2]));
   31.97 -            w7.Position = 0;
   31.98 -            w7.Expand = false;
   31.99 -            w7.Fill = false;
  31.100 -            // Internal child IBBoard.WarFoundry.GTK.FrmNewUnit.ActionArea
  31.101 -            Gtk.HButtonBox w8 = this.ActionArea;
  31.102 -            w8.Name = "dialog1_ActionArea";
  31.103 -            w8.Spacing = 6;
  31.104 -            w8.BorderWidth = ((uint)(5));
  31.105 -            w8.LayoutStyle = ((Gtk.ButtonBoxStyle)(4));
  31.106 -            // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  31.107 -            this.buttonCancel = new Gtk.Button();
  31.108 -            this.buttonCancel.CanDefault = true;
  31.109 -            this.buttonCancel.CanFocus = true;
  31.110 -            this.buttonCancel.Name = "buttonCancel";
  31.111 -            this.buttonCancel.UseStock = true;
  31.112 -            this.buttonCancel.UseUnderline = true;
  31.113 -            this.buttonCancel.Label = "gtk-cancel";
  31.114 -            this.AddActionWidget(this.buttonCancel, -6);
  31.115 -            Gtk.ButtonBox.ButtonBoxChild w9 = ((Gtk.ButtonBox.ButtonBoxChild)(w8[this.buttonCancel]));
  31.116 -            w9.Expand = false;
  31.117 -            w9.Fill = false;
  31.118 -            // Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  31.119 -            this.buttonOk = new Gtk.Button();
  31.120 -            this.buttonOk.Sensitive = false;
  31.121 -            this.buttonOk.CanDefault = true;
  31.122 -            this.buttonOk.CanFocus = true;
  31.123 -            this.buttonOk.Name = "buttonOk";
  31.124 -            this.buttonOk.UseStock = true;
  31.125 -            this.buttonOk.UseUnderline = true;
  31.126 -            this.buttonOk.Label = "gtk-ok";
  31.127 -            this.AddActionWidget(this.buttonOk, -5);
  31.128 -            Gtk.ButtonBox.ButtonBoxChild w10 = ((Gtk.ButtonBox.ButtonBoxChild)(w8[this.buttonOk]));
  31.129 -            w10.Position = 1;
  31.130 -            w10.Expand = false;
  31.131 -            w10.Fill = false;
  31.132 -            if ((this.Child != null)) {
  31.133 -                this.Child.ShowAll();
  31.134 -            }
  31.135 -            this.DefaultWidth = 400;
  31.136 -            this.DefaultHeight = 318;
  31.137 -            this.Show();
  31.138 -            this.lstUnitTypes.RowActivated += new Gtk.RowActivatedHandler(this.OnRowActivated);
  31.139 -            this.buttonCancel.Activated += new System.EventHandler(this.OnButtonCancelActivated);
  31.140 -            this.buttonOk.Clicked += new System.EventHandler(this.OnButtonOkClicked);
  31.141 -        }
  31.142 -    }
  31.143 -}
    32.1 --- a/gtk-gui/IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget.cs	Sun Jan 31 20:46:06 2010 +0000
    32.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.3 @@ -1,273 +0,0 @@
    32.4 -// ------------------------------------------------------------------------------
    32.5 -//  <autogenerated>
    32.6 -//      This code was generated by a tool.
    32.7 -//      
    32.8 -// 
    32.9 -//      Changes to this file may cause incorrect behavior and will be lost if 
   32.10 -//      the code is regenerated.
   32.11 -//  </autogenerated>
   32.12 -// ------------------------------------------------------------------------------
   32.13 -
   32.14 -namespace IBBoard.WarFoundry.GTK.Widgets {
   32.15 -    
   32.16 -    
   32.17 -    public partial class UnitDisplayWidget {
   32.18 -        
   32.19 -        private Gtk.VBox vbox1;
   32.20 -        
   32.21 -        private Gtk.HBox hbox1;
   32.22 -        
   32.23 -        private Gtk.Entry unitName;
   32.24 -        
   32.25 -        private Gtk.SpinButton unitSize;
   32.26 -        
   32.27 -        private Gtk.ScrolledWindow GtkScrolledWindow;
   32.28 -        
   32.29 -        private Gtk.NodeView unitStats;
   32.30 -        
   32.31 -        private Gtk.HSeparator hseparator1;
   32.32 -        
   32.33 -        private Gtk.Table table1;
   32.34 -        
   32.35 -        private Gtk.ScrolledWindow GtkScrolledWindow1;
   32.36 -        
   32.37 -        private Gtk.NodeView optionalEquipment;
   32.38 -        
   32.39 -        private Gtk.ScrolledWindow GtkScrolledWindow2;
   32.40 -        
   32.41 -        private Gtk.NodeView requiredEquipment;
   32.42 -        
   32.43 -        private Gtk.Label optionalEquipmentLabel;
   32.44 -        
   32.45 -        private Gtk.Label requiredEquipmentLabel;
   32.46 -        
   32.47 -        private Gtk.VBox vbox2;
   32.48 -        
   32.49 -        private Gtk.Button bttnReplaceRequired;
   32.50 -        
   32.51 -        private Gtk.Button bttnEditRequired;
   32.52 -        
   32.53 -        private Gtk.VBox vbox3;
   32.54 -        
   32.55 -        private Gtk.Button bttnAddOptional;
   32.56 -        
   32.57 -        private Gtk.Button bttnEditOptional;
   32.58 -        
   32.59 -        private Gtk.Button bttnRemove;
   32.60 -        
   32.61 -        private Gtk.HBox hbox2;
   32.62 -        
   32.63 -        protected virtual void Build() {
   32.64 -            Stetic.Gui.Initialize(this);
   32.65 -            // Widget IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget
   32.66 -            Stetic.BinContainer.Attach(this);
   32.67 -            this.Name = "IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget";
   32.68 -            // Container child IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget.Gtk.Container+ContainerChild
   32.69 -            this.vbox1 = new Gtk.VBox();
   32.70 -            this.vbox1.Name = "vbox1";
   32.71 -            this.vbox1.Spacing = 6;
   32.72 -            // Container child vbox1.Gtk.Box+BoxChild
   32.73 -            this.hbox1 = new Gtk.HBox();
   32.74 -            this.hbox1.Name = "hbox1";
   32.75 -            this.hbox1.Spacing = 6;
   32.76 -            // Container child hbox1.Gtk.Box+BoxChild
   32.77 -            this.unitName = new Gtk.Entry();
   32.78 -            this.unitName.CanFocus = true;
   32.79 -            this.unitName.Name = "unitName";
   32.80 -            this.unitName.IsEditable = true;
   32.81 -            this.unitName.InvisibleChar = '•';
   32.82 -            this.hbox1.Add(this.unitName);
   32.83 -            Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.hbox1[this.unitName]));
   32.84 -            w1.Position = 0;
   32.85 -            // Container child hbox1.Gtk.Box+BoxChild
   32.86 -            this.unitSize = new Gtk.SpinButton(0, 100, 1);
   32.87 -            this.unitSize.CanFocus = true;
   32.88 -            this.unitSize.Name = "unitSize";
   32.89 -            this.unitSize.Adjustment.PageIncrement = 10;
   32.90 -            this.unitSize.ClimbRate = 1;
   32.91 -            this.unitSize.Numeric = true;
   32.92 -            this.hbox1.Add(this.unitSize);
   32.93 -            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.unitSize]));
   32.94 -            w2.Position = 1;
   32.95 -            w2.Expand = false;
   32.96 -            w2.Fill = false;
   32.97 -            this.vbox1.Add(this.hbox1);
   32.98 -            Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox1]));
   32.99 -            w3.Position = 0;
  32.100 -            w3.Expand = false;
  32.101 -            w3.Fill = false;
  32.102 -            // Container child vbox1.Gtk.Box+BoxChild
  32.103 -            this.GtkScrolledWindow = new Gtk.ScrolledWindow();
  32.104 -            this.GtkScrolledWindow.Name = "GtkScrolledWindow";
  32.105 -            this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
  32.106 -            // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
  32.107 -            this.unitStats = new Gtk.NodeView();
  32.108 -            this.unitStats.HeightRequest = 75;
  32.109 -            this.unitStats.CanFocus = true;
  32.110 -            this.unitStats.Name = "unitStats";
  32.111 -            this.GtkScrolledWindow.Add(this.unitStats);
  32.112 -            this.vbox1.Add(this.GtkScrolledWindow);
  32.113 -            Gtk.Box.BoxChild w5 = ((Gtk.Box.BoxChild)(this.vbox1[this.GtkScrolledWindow]));
  32.114 -            w5.Position = 1;
  32.115 -            // Container child vbox1.Gtk.Box+BoxChild
  32.116 -            this.hseparator1 = new Gtk.HSeparator();
  32.117 -            this.hseparator1.Name = "hseparator1";
  32.118 -            this.vbox1.Add(this.hseparator1);
  32.119 -            Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox1[this.hseparator1]));
  32.120 -            w6.Position = 2;
  32.121 -            w6.Expand = false;
  32.122 -            w6.Fill = false;
  32.123 -            // Container child vbox1.Gtk.Box+BoxChild
  32.124 -            this.table1 = new Gtk.Table(((uint)(2)), ((uint)(3)), false);
  32.125 -            this.table1.Name = "table1";
  32.126 -            this.table1.RowSpacing = ((uint)(6));
  32.127 -            this.table1.ColumnSpacing = ((uint)(6));
  32.128 -            // Container child table1.Gtk.Table+TableChild
  32.129 -            this.GtkScrolledWindow1 = new Gtk.ScrolledWindow();
  32.130 -            this.GtkScrolledWindow1.Name = "GtkScrolledWindow1";
  32.131 -            this.GtkScrolledWindow1.ShadowType = ((Gtk.ShadowType)(1));
  32.132 -            // Container child GtkScrolledWindow1.Gtk.Container+ContainerChild
  32.133 -            this.optionalEquipment = new Gtk.NodeView();
  32.134 -            this.optionalEquipment.CanFocus = true;
  32.135 -            this.optionalEquipment.Name = "optionalEquipment";
  32.136 -            this.GtkScrolledWindow1.Add(this.optionalEquipment);
  32.137 -            this.table1.Add(this.GtkScrolledWindow1);
  32.138 -            Gtk.Table.TableChild w8 = ((Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow1]));
  32.139 -            w8.TopAttach = ((uint)(1));
  32.140 -            w8.BottomAttach = ((uint)(2));
  32.141 -            w8.LeftAttach = ((uint)(1));
  32.142 -            w8.RightAttach = ((uint)(2));
  32.143 -            w8.YOptions = ((Gtk.AttachOptions)(4));
  32.144 -            // Container child table1.Gtk.Table+TableChild
  32.145 -            this.GtkScrolledWindow2 = new Gtk.ScrolledWindow();
  32.146 -            this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
  32.147 -            this.GtkScrolledWindow2.ShadowType = ((Gtk.ShadowType)(1));
  32.148 -            // Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
  32.149 -            this.requiredEquipment = new Gtk.NodeView();
  32.150 -            this.requiredEquipment.CanFocus = true;
  32.151 -            this.requiredEquipment.Name = "requiredEquipment";
  32.152 -            this.GtkScrolledWindow2.Add(this.requiredEquipment);
  32.153 -            this.table1.Add(this.GtkScrolledWindow2);
  32.154 -            Gtk.Table.TableChild w10 = ((Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow2]));
  32.155 -            w10.LeftAttach = ((uint)(1));
  32.156 -            w10.RightAttach = ((uint)(2));
  32.157 -            w10.YOptions = ((Gtk.AttachOptions)(4));
  32.158 -            // Container child table1.Gtk.Table+TableChild
  32.159 -            this.optionalEquipmentLabel = new Gtk.Label();
  32.160 -            this.optionalEquipmentLabel.Name = "optionalEquipmentLabel";
  32.161 -            this.optionalEquipmentLabel.LabelProp = Mono.Unix.Catalog.GetString("Optional Equipment:");
  32.162 -            this.table1.Add(this.optionalEquipmentLabel);
  32.163 -            Gtk.Table.TableChild w11 = ((Gtk.Table.TableChild)(this.table1[this.optionalEquipmentLabel]));
  32.164 -            w11.TopAttach = ((uint)(1));
  32.165 -            w11.BottomAttach = ((uint)(2));
  32.166 -            w11.XOptions = ((Gtk.AttachOptions)(4));
  32.167 -            w11.YOptions = ((Gtk.AttachOptions)(4));
  32.168 -            // Container child table1.Gtk.Table+TableChild
  32.169 -            this.requiredEquipmentLabel = new Gtk.Label();
  32.170 -            this.requiredEquipmentLabel.Name = "requiredEquipmentLabel";
  32.171 -            this.requiredEquipmentLabel.LabelProp = Mono.Unix.Catalog.GetString("Required Equipment:");
  32.172 -            this.table1.Add(this.requiredEquipmentLabel);
  32.173 -            Gtk.Table.TableChild w12 = ((Gtk.Table.TableChild)(this.table1[this.requiredEquipmentLabel]));
  32.174 -            w12.XOptions = ((Gtk.AttachOptions)(4));
  32.175 -            w12.YOptions = ((Gtk.AttachOptions)(4));
  32.176 -            // Container child table1.Gtk.Table+TableChild
  32.177 -            this.vbox2 = new Gtk.VBox();
  32.178 -            this.vbox2.Name = "vbox2";
  32.179 -            this.vbox2.Spacing = 6;
  32.180 -            // Container child vbox2.Gtk.Box+BoxChild
  32.181 -            this.bttnReplaceRequired = new Gtk.Button();
  32.182 -            this.bttnReplaceRequired.CanFocus = true;
  32.183 -            this.bttnReplaceRequired.Name = "bttnReplaceRequired";
  32.184 -            this.bttnReplaceRequired.UseUnderline = true;
  32.185 -            this.bttnReplaceRequired.Label = Mono.Unix.Catalog.GetString("Replace");
  32.186 -            this.vbox2.Add(this.bttnReplaceRequired);
  32.187 -            Gtk.Box.BoxChild w13 = ((Gtk.Box.BoxChild)(this.vbox2[this.bttnReplaceRequired]));
  32.188 -            w13.Position = 0;
  32.189 -            w13.Expand = false;
  32.190 -            w13.Fill = false;
  32.191 -            // Container child vbox2.Gtk.Box+BoxChild
  32.192 -            this.bttnEditRequired = new Gtk.Button();
  32.193 -            this.bttnEditRequired.CanFocus = true;
  32.194 -            this.bttnEditRequired.Name = "bttnEditRequired";
  32.195 -            this.bttnEditRequired.UseUnderline = true;
  32.196 -            this.bttnEditRequired.Label = Mono.Unix.Catalog.GetString("Edit");
  32.197 -            this.vbox2.Add(this.bttnEditRequired);
  32.198 -            Gtk.Box.BoxChild w14 = ((Gtk.Box.BoxChild)(this.vbox2[this.bttnEditRequired]));
  32.199 -            w14.Position = 1;
  32.200 -            w14.Expand = false;
  32.201 -            w14.Fill = false;
  32.202 -            this.table1.Add(this.vbox2);
  32.203 -            Gtk.Table.TableChild w15 = ((Gtk.Table.TableChild)(this.table1[this.vbox2]));
  32.204 -            w15.LeftAttach = ((uint)(2));
  32.205 -            w15.RightAttach = ((uint)(3));
  32.206 -            w15.XOptions = ((Gtk.AttachOptions)(4));
  32.207 -            w15.YOptions = ((Gtk.AttachOptions)(4));
  32.208 -            // Container child table1.Gtk.Table+TableChild
  32.209 -            this.vbox3 = new Gtk.VBox();
  32.210 -            this.vbox3.Name = "vbox3";
  32.211 -            this.vbox3.Spacing = 6;
  32.212 -            // Container child vbox3.Gtk.Box+BoxChild
  32.213 -            this.bttnAddOptional = new Gtk.Button();
  32.214 -            this.bttnAddOptional.CanFocus = true;
  32.215 -            this.bttnAddOptional.Name = "bttnAddOptional";
  32.216 -            this.bttnAddOptional.UseUnderline = true;
  32.217 -            this.bttnAddOptional.Label = Mono.Unix.Catalog.GetString("Add");
  32.218 -            this.vbox3.Add(this.bttnAddOptional);
  32.219 -            Gtk.Box.BoxChild w16 = ((Gtk.Box.BoxChild)(this.vbox3[this.bttnAddOptional]));
  32.220 -            w16.Position = 0;
  32.221 -            w16.Expand = false;
  32.222 -            w16.Fill = false;
  32.223 -            // Container child vbox3.Gtk.Box+BoxChild
  32.224 -            this.bttnEditOptional = new Gtk.Button();
  32.225 -            this.bttnEditOptional.CanFocus = true;
  32.226 -            this.bttnEditOptional.Name = "bttnEditOptional";
  32.227 -            this.bttnEditOptional.UseUnderline = true;
  32.228 -            this.bttnEditOptional.Label = Mono.Unix.Catalog.GetString("Edit");
  32.229 -            this.vbox3.Add(this.bttnEditOptional);
  32.230 -            Gtk.Box.BoxChild w17 = ((Gtk.Box.BoxChild)(this.vbox3[this.bttnEditOptional]));
  32.231 -            w17.Position = 1;
  32.232 -            w17.Expand = false;
  32.233 -            w17.Fill = false;
  32.234 -            // Container child vbox3.Gtk.Box+BoxChild
  32.235 -            this.bttnRemove = new Gtk.Button();
  32.236 -            this.bttnRemove.CanFocus = true;
  32.237 -            this.bttnRemove.Name = "bttnRemove";
  32.238 -            this.bttnRemove.UseUnderline = true;
  32.239 -            this.bttnRemove.Label = Mono.Unix.Catalog.GetString("Remove");
  32.240 -            this.vbox3.Add(this.bttnRemove);
  32.241 -            Gtk.Box.BoxChild w18 = ((Gtk.Box.BoxChild)(this.vbox3[this.bttnRemove]));
  32.242 -            w18.Position = 2;
  32.243 -            w18.Expand = false;
  32.244 -            w18.Fill = false;
  32.245 -            this.table1.Add(this.vbox3);
  32.246 -            Gtk.Table.TableChild w19 = ((Gtk.Table.TableChild)(this.table1[this.vbox3]));
  32.247 -            w19.TopAttach = ((uint)(1));
  32.248 -            w19.BottomAttach = ((uint)(2));
  32.249 -            w19.LeftAttach = ((uint)(2));
  32.250 -            w19.RightAttach = ((uint)(3));
  32.251 -            w19.XOptions = ((Gtk.AttachOptions)(4));
  32.252 -            w19.YOptions = ((Gtk.AttachOptions)(4));
  32.253 -            this.vbox1.Add(this.table1);
  32.254 -            Gtk.Box.BoxChild w20 = ((Gtk.Box.BoxChild)(this.vbox1[this.table1]));
  32.255 -            w20.Position = 3;
  32.256 -            w20.Expand = false;
  32.257 -            w20.Fill = false;
  32.258 -            // Container child vbox1.Gtk.Box+BoxChild
  32.259 -            this.hbox2 = new Gtk.HBox();
  32.260 -            this.hbox2.Name = "hbox2";
  32.261 -            this.hbox2.Spacing = 6;
  32.262 -            this.vbox1.Add(this.hbox2);
  32.263 -            Gtk.Box.BoxChild w21 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox2]));
  32.264 -            w21.Position = 4;
  32.265 -            this.Add(this.vbox1);
  32.266 -            if ((this.Child != null)) {
  32.267 -                this.Child.ShowAll();
  32.268 -            }
  32.269 -            this.Show();
  32.270 -            this.unitName.FocusOutEvent += new Gtk.FocusOutEventHandler(this.OnUnitNameFocusOut);
  32.271 -            this.unitName.KeyPressEvent += new Gtk.KeyPressEventHandler(this.OnUnitNameKeyPress);
  32.272 -            this.unitSize.FocusOutEvent += new Gtk.FocusOutEventHandler(this.OnUnitSizeFocusOut);
  32.273 -            this.unitSize.KeyPressEvent += new Gtk.KeyPressEventHandler(this.OnUnitSizeKeyPress);
  32.274 -        }
  32.275 -    }
  32.276 -}
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAbout.cs	Mon Jan 17 19:43:47 2011 +0000
    33.3 @@ -0,0 +1,122 @@
    33.4 +
    33.5 +// This file has been generated by the GUI designer. Do not modify.
    33.6 +namespace IBBoard.WarFoundry.GUI.GTK
    33.7 +{
    33.8 +	public partial class FrmAbout
    33.9 +	{
   33.10 +		private global::Gtk.Image logoImage;
   33.11 +		private global::Gtk.Label label1;
   33.12 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblWarFoundryDesc;
   33.13 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblWarFoundryCopyright;
   33.14 +		private global::Gtk.Label lblWarFoundryLink;
   33.15 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCredits;
   33.16 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnClose;
   33.17 +
   33.18 +		protected virtual void Build()
   33.19 +		{
   33.20 +			global::Stetic.Gui.Initialize(this);
   33.21 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmAbout
   33.22 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmAbout";
   33.23 +			this.Title = global::Mono.Unix.Catalog.GetString("About WF");
   33.24 +			this.Icon = global::Gdk.Pixbuf.LoadFromResource("App.ico");
   33.25 +			this.TypeHint = ((global::Gdk.WindowTypeHint)(1));
   33.26 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   33.27 +			this.Resizable = false;
   33.28 +			this.AllowGrow = false;
   33.29 +			this.SkipPagerHint = true;
   33.30 +			this.SkipTaskbarHint = true;
   33.31 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmAbout.VBox
   33.32 +			global::Gtk.VBox w1 = this.VBox;
   33.33 +			w1.Name = "dialog1_VBox";
   33.34 +			w1.BorderWidth = ((uint)(2));
   33.35 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   33.36 +			this.logoImage = new global::Gtk.Image();
   33.37 +			this.logoImage.Name = "logoImage";
   33.38 +			this.logoImage.Pixbuf = global::Gdk.Pixbuf.LoadFromResource("IBBoard.WarFoundry.GUI.GTK.App-lrg.png");
   33.39 +			w1.Add(this.logoImage);
   33.40 +			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(w1[this.logoImage]));
   33.41 +			w2.Position = 0;
   33.42 +			w2.Expand = false;
   33.43 +			w2.Fill = false;
   33.44 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   33.45 +			this.label1 = new global::Gtk.Label();
   33.46 +			this.label1.Name = "label1";
   33.47 +			this.label1.LabelProp = global::Mono.Unix.Catalog.GetString("<span font_size=\"x-large\" weight=\"bold\">WarFoundry v0.1 RC 1</span>");
   33.48 +			this.label1.UseMarkup = true;
   33.49 +			w1.Add(this.label1);
   33.50 +			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(w1[this.label1]));
   33.51 +			w3.Position = 1;
   33.52 +			w3.Expand = false;
   33.53 +			w3.Fill = false;
   33.54 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   33.55 +			this.lblWarFoundryDesc = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   33.56 +			this.lblWarFoundryDesc.Name = "lblWarFoundryDesc";
   33.57 +			this.lblWarFoundryDesc.LabelProp = global::Mono.Unix.Catalog.GetString("WarFoundry is an open-source army creation tool that lets you create rosters for multiple game systems.");
   33.58 +			this.lblWarFoundryDesc.Wrap = true;
   33.59 +			this.lblWarFoundryDesc.Justify = ((global::Gtk.Justification)(2));
   33.60 +			w1.Add(this.lblWarFoundryDesc);
   33.61 +			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(w1[this.lblWarFoundryDesc]));
   33.62 +			w4.Position = 2;
   33.63 +			w4.Expand = false;
   33.64 +			w4.Fill = false;
   33.65 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   33.66 +			this.lblWarFoundryCopyright = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   33.67 +			this.lblWarFoundryCopyright.Name = "lblWarFoundryCopyright";
   33.68 +			this.lblWarFoundryCopyright.LabelProp = global::Mono.Unix.Catalog.GetString("© 2007-2010, IBBoard and others");
   33.69 +			w1.Add(this.lblWarFoundryCopyright);
   33.70 +			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(w1[this.lblWarFoundryCopyright]));
   33.71 +			w5.Position = 3;
   33.72 +			w5.Expand = false;
   33.73 +			w5.Fill = false;
   33.74 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   33.75 +			this.lblWarFoundryLink = new global::Gtk.Label();
   33.76 +			this.lblWarFoundryLink.Name = "lblWarFoundryLink";
   33.77 +			this.lblWarFoundryLink.LabelProp = global::Mono.Unix.Catalog.GetString("<a href=\"http://warfoundry.co.uk\">http://warfoundry.co.uk</a>");
   33.78 +			this.lblWarFoundryLink.UseMarkup = true;
   33.79 +			w1.Add(this.lblWarFoundryLink);
   33.80 +			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(w1[this.lblWarFoundryLink]));
   33.81 +			w6.Position = 4;
   33.82 +			w6.Expand = false;
   33.83 +			w6.Fill = false;
   33.84 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmAbout.ActionArea
   33.85 +			global::Gtk.HButtonBox w7 = this.ActionArea;
   33.86 +			w7.Name = "dialog1_ActionArea";
   33.87 +			w7.Spacing = 10;
   33.88 +			w7.BorderWidth = ((uint)(5));
   33.89 +			w7.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
   33.90 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
   33.91 +			this.bttnCredits = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
   33.92 +			this.bttnCredits.CanFocus = true;
   33.93 +			this.bttnCredits.Name = "bttnCredits";
   33.94 +			this.bttnCredits.UseStock = true;
   33.95 +			this.bttnCredits.UseUnderline = true;
   33.96 +			this.bttnCredits.Label = "gtk-about";
   33.97 +			w7.Add(this.bttnCredits);
   33.98 +			global::Gtk.ButtonBox.ButtonBoxChild w8 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7[this.bttnCredits]));
   33.99 +			w8.Expand = false;
  33.100 +			w8.Fill = false;
  33.101 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  33.102 +			this.bttnClose = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  33.103 +			this.bttnClose.CanDefault = true;
  33.104 +			this.bttnClose.CanFocus = true;
  33.105 +			this.bttnClose.Name = "bttnClose";
  33.106 +			this.bttnClose.UseStock = true;
  33.107 +			this.bttnClose.UseUnderline = true;
  33.108 +			this.bttnClose.Label = "gtk-close";
  33.109 +			this.AddActionWidget(this.bttnClose, -7);
  33.110 +			global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w7[this.bttnClose]));
  33.111 +			w9.Position = 1;
  33.112 +			w9.Expand = false;
  33.113 +			w9.Fill = false;
  33.114 +			if ((this.Child != null))
  33.115 +			{
  33.116 +				this.Child.ShowAll();
  33.117 +			}
  33.118 +			this.DefaultWidth = 330;
  33.119 +			this.DefaultHeight = 300;
  33.120 +			this.bttnClose.HasDefault = true;
  33.121 +			this.Show();
  33.122 +			this.bttnCredits.Clicked += new global::System.EventHandler(this.BttnCreditsClicked);
  33.123 +		}
  33.124 +	}
  33.125 +}
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAboutCredits.cs	Mon Jan 17 19:43:47 2011 +0000
    34.3 @@ -0,0 +1,152 @@
    34.4 +
    34.5 +// This file has been generated by the GUI designer. Do not modify.
    34.6 +namespace IBBoard.WarFoundry.GUI.GTK
    34.7 +{
    34.8 +	public partial class FrmAboutCredits
    34.9 +	{
   34.10 +		private global::Gtk.Table table1;
   34.11 +		private global::Gtk.Label label1;
   34.12 +		private global::Gtk.Label label2;
   34.13 +		private global::Gtk.Label label3;
   34.14 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblDevelopers;
   34.15 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblTestersCommon;
   34.16 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblTestersGtk;
   34.17 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnClose;
   34.18 +
   34.19 +		protected virtual void Build()
   34.20 +		{
   34.21 +			global::Stetic.Gui.Initialize(this);
   34.22 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmAboutCredits
   34.23 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmAboutCredits";
   34.24 +			this.Icon = global::Gdk.Pixbuf.LoadFromResource("App.ico");
   34.25 +			this.TypeHint = ((global::Gdk.WindowTypeHint)(1));
   34.26 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   34.27 +			this.SkipPagerHint = true;
   34.28 +			this.SkipTaskbarHint = true;
   34.29 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmAboutCredits.VBox
   34.30 +			global::Gtk.VBox w1 = this.VBox;
   34.31 +			w1.Name = "dialog1_VBox";
   34.32 +			w1.BorderWidth = ((uint)(2));
   34.33 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   34.34 +			this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false);
   34.35 +			this.table1.Name = "table1";
   34.36 +			this.table1.RowSpacing = ((uint)(6));
   34.37 +			this.table1.ColumnSpacing = ((uint)(6));
   34.38 +			// Container child table1.Gtk.Table+TableChild
   34.39 +			this.label1 = new global::Gtk.Label();
   34.40 +			this.label1.Name = "label1";
   34.41 +			this.label1.Xpad = 3;
   34.42 +			this.label1.Ypad = 3;
   34.43 +			this.label1.Xalign = 0F;
   34.44 +			this.label1.Yalign = 0F;
   34.45 +			this.label1.LabelProp = "IBBoard (Main developer and project lead)";
   34.46 +			this.table1.Add(this.label1);
   34.47 +			global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table1[this.label1]));
   34.48 +			w2.LeftAttach = ((uint)(1));
   34.49 +			w2.RightAttach = ((uint)(2));
   34.50 +			w2.XOptions = ((global::Gtk.AttachOptions)(4));
   34.51 +			w2.YOptions = ((global::Gtk.AttachOptions)(4));
   34.52 +			// Container child table1.Gtk.Table+TableChild
   34.53 +			this.label2 = new global::Gtk.Label();
   34.54 +			this.label2.Name = "label2";
   34.55 +			this.label2.Xpad = 3;
   34.56 +			this.label2.Ypad = 3;
   34.57 +			this.label2.Xalign = 0F;
   34.58 +			this.label2.Yalign = 0F;
   34.59 +			this.label2.LabelProp = global::Mono.Unix.Catalog.GetString("HeWhoWatches");
   34.60 +			this.table1.Add(this.label2);
   34.61 +			global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.label2]));
   34.62 +			w3.TopAttach = ((uint)(1));
   34.63 +			w3.BottomAttach = ((uint)(2));
   34.64 +			w3.LeftAttach = ((uint)(1));
   34.65 +			w3.RightAttach = ((uint)(2));
   34.66 +			w3.YOptions = ((global::Gtk.AttachOptions)(4));
   34.67 +			// Container child table1.Gtk.Table+TableChild
   34.68 +			this.label3 = new global::Gtk.Label();
   34.69 +			this.label3.Name = "label3";
   34.70 +			this.label3.Xpad = 3;
   34.71 +			this.label3.Ypad = 3;
   34.72 +			this.label3.Xalign = 0F;
   34.73 +			this.label3.Yalign = 0F;
   34.74 +			this.label3.LabelProp = global::Mono.Unix.Catalog.GetString("Snowblizz,\r\nFrostlee,\r\nLord_Archaon,\r\nFurrie,\r\nclutch110,\r\nMollo,\r\nHeWhoWatches");
   34.75 +			this.table1.Add(this.label3);
   34.76 +			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.label3]));
   34.77 +			w4.TopAttach = ((uint)(2));
   34.78 +			w4.BottomAttach = ((uint)(3));
   34.79 +			w4.LeftAttach = ((uint)(1));
   34.80 +			w4.RightAttach = ((uint)(2));
   34.81 +			w4.XOptions = ((global::Gtk.AttachOptions)(4));
   34.82 +			w4.YOptions = ((global::Gtk.AttachOptions)(4));
   34.83 +			// Container child table1.Gtk.Table+TableChild
   34.84 +			this.lblDevelopers = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   34.85 +			this.lblDevelopers.Name = "lblDevelopers";
   34.86 +			this.lblDevelopers.Xpad = 3;
   34.87 +			this.lblDevelopers.Ypad = 3;
   34.88 +			this.lblDevelopers.Xalign = 0F;
   34.89 +			this.lblDevelopers.Yalign = 0F;
   34.90 +			this.lblDevelopers.LabelProp = global::Mono.Unix.Catalog.GetString("developers:");
   34.91 +			this.table1.Add(this.lblDevelopers);
   34.92 +			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.lblDevelopers]));
   34.93 +			w5.XOptions = ((global::Gtk.AttachOptions)(4));
   34.94 +			w5.YOptions = ((global::Gtk.AttachOptions)(4));
   34.95 +			// Container child table1.Gtk.Table+TableChild
   34.96 +			this.lblTestersCommon = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   34.97 +			this.lblTestersCommon.Name = "lblTestersCommon";
   34.98 +			this.lblTestersCommon.Xpad = 3;
   34.99 +			this.lblTestersCommon.Ypad = 3;
  34.100 +			this.lblTestersCommon.Xalign = 0F;
  34.101 +			this.lblTestersCommon.Yalign = 0F;
  34.102 +			this.lblTestersCommon.LabelProp = global::Mono.Unix.Catalog.GetString("testers (common):");
  34.103 +			this.table1.Add(this.lblTestersCommon);
  34.104 +			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.lblTestersCommon]));
  34.105 +			w6.TopAttach = ((uint)(2));
  34.106 +			w6.BottomAttach = ((uint)(3));
  34.107 +			w6.XOptions = ((global::Gtk.AttachOptions)(4));
  34.108 +			w6.YOptions = ((global::Gtk.AttachOptions)(4));
  34.109 +			// Container child table1.Gtk.Table+TableChild
  34.110 +			this.lblTestersGtk = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  34.111 +			this.lblTestersGtk.Name = "lblTestersGtk";
  34.112 +			this.lblTestersGtk.Xpad = 3;
  34.113 +			this.lblTestersGtk.Ypad = 3;
  34.114 +			this.lblTestersGtk.Xalign = 0F;
  34.115 +			this.lblTestersGtk.Yalign = 0F;
  34.116 +			this.lblTestersGtk.LabelProp = global::Mono.Unix.Catalog.GetString("testers (GTK UI):");
  34.117 +			this.table1.Add(this.lblTestersGtk);
  34.118 +			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.lblTestersGtk]));
  34.119 +			w7.TopAttach = ((uint)(1));
  34.120 +			w7.BottomAttach = ((uint)(2));
  34.121 +			w7.XOptions = ((global::Gtk.AttachOptions)(4));
  34.122 +			w7.YOptions = ((global::Gtk.AttachOptions)(4));
  34.123 +			w1.Add(this.table1);
  34.124 +			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(w1[this.table1]));
  34.125 +			w8.Position = 0;
  34.126 +			w8.Expand = false;
  34.127 +			w8.Fill = false;
  34.128 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmAboutCredits.ActionArea
  34.129 +			global::Gtk.HButtonBox w9 = this.ActionArea;
  34.130 +			w9.Name = "dialog1_ActionArea";
  34.131 +			w9.Spacing = 10;
  34.132 +			w9.BorderWidth = ((uint)(5));
  34.133 +			w9.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
  34.134 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  34.135 +			this.bttnClose = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  34.136 +			this.bttnClose.CanDefault = true;
  34.137 +			this.bttnClose.CanFocus = true;
  34.138 +			this.bttnClose.Name = "bttnClose";
  34.139 +			this.bttnClose.UseStock = true;
  34.140 +			this.bttnClose.UseUnderline = true;
  34.141 +			this.bttnClose.Label = "gtk-close";
  34.142 +			this.AddActionWidget(this.bttnClose, -7);
  34.143 +			global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w9[this.bttnClose]));
  34.144 +			w10.Expand = false;
  34.145 +			w10.Fill = false;
  34.146 +			if ((this.Child != null))
  34.147 +			{
  34.148 +				this.Child.ShowAll();
  34.149 +			}
  34.150 +			this.DefaultWidth = 376;
  34.151 +			this.DefaultHeight = 250;
  34.152 +			this.Show();
  34.153 +		}
  34.154 +	}
  34.155 +}
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs	Mon Jan 17 19:43:47 2011 +0000
    35.3 @@ -0,0 +1,237 @@
    35.4 +
    35.5 +// This file has been generated by the GUI designer. Do not modify.
    35.6 +namespace IBBoard.WarFoundry.GUI.GTK
    35.7 +{
    35.8 +	public partial class FrmAddEquipment
    35.9 +	{
   35.10 +		private global::Gtk.Table table1;
   35.11 +		private global::Gtk.ScrolledWindow GtkScrolledWindow;
   35.12 +		private global::Gtk.TreeView lstEquipment;
   35.13 +		private global::Gtk.HBox hbox2;
   35.14 +		private global::Gtk.Table table2;
   35.15 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblEquipAll;
   35.16 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblPercent;
   35.17 +		private global::Gtk.SpinButton numericAmount;
   35.18 +		private global::Gtk.SpinButton percentageAmount;
   35.19 +		private global::Gtk.RadioButton rbEquipAll;
   35.20 +		private global::Gtk.RadioButton rbEquipNumeric;
   35.21 +		private global::Gtk.RadioButton rbEquipPercent;
   35.22 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblAmount;
   35.23 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblItem;
   35.24 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
   35.25 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnOkay;
   35.26 +
   35.27 +		protected virtual void Build()
   35.28 +		{
   35.29 +			global::Stetic.Gui.Initialize(this);
   35.30 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment
   35.31 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment";
   35.32 +			this.Title = global::Mono.Unix.Catalog.GetString("Add equipment");
   35.33 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   35.34 +			this.Modal = true;
   35.35 +			this.SkipPagerHint = true;
   35.36 +			this.SkipTaskbarHint = true;
   35.37 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.VBox
   35.38 +			global::Gtk.VBox w1 = this.VBox;
   35.39 +			w1.Name = "dialog1_VBox";
   35.40 +			w1.BorderWidth = ((uint)(2));
   35.41 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   35.42 +			this.table1 = new global::Gtk.Table(((uint)(2)), ((uint)(2)), false);
   35.43 +			this.table1.Name = "table1";
   35.44 +			this.table1.RowSpacing = ((uint)(6));
   35.45 +			this.table1.ColumnSpacing = ((uint)(6));
   35.46 +			// Container child table1.Gtk.Table+TableChild
   35.47 +			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
   35.48 +			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
   35.49 +			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
   35.50 +			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
   35.51 +			this.lstEquipment = new global::Gtk.TreeView();
   35.52 +			this.lstEquipment.CanFocus = true;
   35.53 +			this.lstEquipment.Name = "lstEquipment";
   35.54 +			this.lstEquipment.HeadersVisible = false;
   35.55 +			this.GtkScrolledWindow.Add(this.lstEquipment);
   35.56 +			this.table1.Add(this.GtkScrolledWindow);
   35.57 +			global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow]));
   35.58 +			w3.LeftAttach = ((uint)(1));
   35.59 +			w3.RightAttach = ((uint)(2));
   35.60 +			w3.YOptions = ((global::Gtk.AttachOptions)(4));
   35.61 +			// Container child table1.Gtk.Table+TableChild
   35.62 +			this.hbox2 = new global::Gtk.HBox();
   35.63 +			this.hbox2.Name = "hbox2";
   35.64 +			this.hbox2.Spacing = 6;
   35.65 +			// Container child hbox2.Gtk.Box+BoxChild
   35.66 +			this.table2 = new global::Gtk.Table(((uint)(3)), ((uint)(3)), false);
   35.67 +			this.table2.Name = "table2";
   35.68 +			this.table2.RowSpacing = ((uint)(6));
   35.69 +			this.table2.ColumnSpacing = ((uint)(6));
   35.70 +			// Container child table2.Gtk.Table+TableChild
   35.71 +			this.lblEquipAll = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   35.72 +			this.lblEquipAll.Name = "lblEquipAll";
   35.73 +			this.lblEquipAll.LabelProp = global::Mono.Unix.Catalog.GetString("equip all");
   35.74 +			this.table2.Add(this.lblEquipAll);
   35.75 +			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2[this.lblEquipAll]));
   35.76 +			w4.TopAttach = ((uint)(2));
   35.77 +			w4.BottomAttach = ((uint)(3));
   35.78 +			w4.LeftAttach = ((uint)(1));
   35.79 +			w4.RightAttach = ((uint)(2));
   35.80 +			w4.YOptions = ((global::Gtk.AttachOptions)(4));
   35.81 +			// Container child table2.Gtk.Table+TableChild
   35.82 +			this.lblPercent = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   35.83 +			this.lblPercent.Name = "lblPercent";
   35.84 +			this.lblPercent.LabelProp = global::Mono.Unix.Catalog.GetString("%");
   35.85 +			this.table2.Add(this.lblPercent);
   35.86 +			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2[this.lblPercent]));
   35.87 +			w5.TopAttach = ((uint)(1));
   35.88 +			w5.BottomAttach = ((uint)(2));
   35.89 +			w5.LeftAttach = ((uint)(2));
   35.90 +			w5.RightAttach = ((uint)(3));
   35.91 +			w5.XOptions = ((global::Gtk.AttachOptions)(4));
   35.92 +			w5.YOptions = ((global::Gtk.AttachOptions)(4));
   35.93 +			// Container child table2.Gtk.Table+TableChild
   35.94 +			this.numericAmount = new global::Gtk.SpinButton(0, 100, 1);
   35.95 +			this.numericAmount.CanFocus = true;
   35.96 +			this.numericAmount.Name = "numericAmount";
   35.97 +			this.numericAmount.Adjustment.PageIncrement = 10;
   35.98 +			this.numericAmount.ClimbRate = 1;
   35.99 +			this.numericAmount.Numeric = true;
  35.100 +			this.table2.Add(this.numericAmount);
  35.101 +			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2[this.numericAmount]));
  35.102 +			w6.LeftAttach = ((uint)(1));
  35.103 +			w6.RightAttach = ((uint)(2));
  35.104 +			w6.XOptions = ((global::Gtk.AttachOptions)(0));
  35.105 +			w6.YOptions = ((global::Gtk.AttachOptions)(4));
  35.106 +			// Container child table2.Gtk.Table+TableChild
  35.107 +			this.percentageAmount = new global::Gtk.SpinButton(0, 100, 1);
  35.108 +			this.percentageAmount.CanFocus = true;
  35.109 +			this.percentageAmount.Name = "percentageAmount";
  35.110 +			this.percentageAmount.Adjustment.PageIncrement = 10;
  35.111 +			this.percentageAmount.ClimbRate = 1;
  35.112 +			this.percentageAmount.Digits = ((uint)(1));
  35.113 +			this.percentageAmount.Numeric = true;
  35.114 +			this.table2.Add(this.percentageAmount);
  35.115 +			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2[this.percentageAmount]));
  35.116 +			w7.TopAttach = ((uint)(1));
  35.117 +			w7.BottomAttach = ((uint)(2));
  35.118 +			w7.LeftAttach = ((uint)(1));
  35.119 +			w7.RightAttach = ((uint)(2));
  35.120 +			w7.XOptions = ((global::Gtk.AttachOptions)(0));
  35.121 +			w7.YOptions = ((global::Gtk.AttachOptions)(4));
  35.122 +			// Container child table2.Gtk.Table+TableChild
  35.123 +			this.rbEquipAll = new global::Gtk.RadioButton("");
  35.124 +			this.rbEquipAll.CanFocus = true;
  35.125 +			this.rbEquipAll.Name = "rbEquipAll";
  35.126 +			this.rbEquipAll.Active = true;
  35.127 +			this.rbEquipAll.DrawIndicator = true;
  35.128 +			this.rbEquipAll.UseUnderline = true;
  35.129 +			this.rbEquipAll.Group = new global::GLib.SList(global::System.IntPtr.Zero);
  35.130 +			this.table2.Add(this.rbEquipAll);
  35.131 +			global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipAll]));
  35.132 +			w8.TopAttach = ((uint)(2));
  35.133 +			w8.BottomAttach = ((uint)(3));
  35.134 +			w8.XOptions = ((global::Gtk.AttachOptions)(4));
  35.135 +			w8.YOptions = ((global::Gtk.AttachOptions)(4));
  35.136 +			// Container child table2.Gtk.Table+TableChild
  35.137 +			this.rbEquipNumeric = new global::Gtk.RadioButton("");
  35.138 +			this.rbEquipNumeric.CanFocus = true;
  35.139 +			this.rbEquipNumeric.Name = "rbEquipNumeric";
  35.140 +			this.rbEquipNumeric.DrawIndicator = true;
  35.141 +			this.rbEquipNumeric.UseUnderline = true;
  35.142 +			this.rbEquipNumeric.Group = this.rbEquipAll.Group;
  35.143 +			this.table2.Add(this.rbEquipNumeric);
  35.144 +			global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipNumeric]));
  35.145 +			w9.XOptions = ((global::Gtk.AttachOptions)(4));
  35.146 +			w9.YOptions = ((global::Gtk.AttachOptions)(4));
  35.147 +			// Container child table2.Gtk.Table+TableChild
  35.148 +			this.rbEquipPercent = new global::Gtk.RadioButton("");
  35.149 +			this.rbEquipPercent.CanFocus = true;
  35.150 +			this.rbEquipPercent.Name = "rbEquipPercent";
  35.151 +			this.rbEquipPercent.DrawIndicator = true;
  35.152 +			this.rbEquipPercent.UseUnderline = true;
  35.153 +			this.rbEquipPercent.Group = this.rbEquipAll.Group;
  35.154 +			this.table2.Add(this.rbEquipPercent);
  35.155 +			global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipPercent]));
  35.156 +			w10.TopAttach = ((uint)(1));
  35.157 +			w10.BottomAttach = ((uint)(2));
  35.158 +			w10.XOptions = ((global::Gtk.AttachOptions)(4));
  35.159 +			w10.YOptions = ((global::Gtk.AttachOptions)(4));
  35.160 +			this.hbox2.Add(this.table2);
  35.161 +			global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.table2]));
  35.162 +			w11.Position = 0;
  35.163 +			w11.Expand = false;
  35.164 +			w11.Fill = false;
  35.165 +			this.table1.Add(this.hbox2);
  35.166 +			global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.hbox2]));
  35.167 +			w12.TopAttach = ((uint)(1));
  35.168 +			w12.BottomAttach = ((uint)(2));
  35.169 +			w12.LeftAttach = ((uint)(1));
  35.170 +			w12.RightAttach = ((uint)(2));
  35.171 +			w12.YOptions = ((global::Gtk.AttachOptions)(4));
  35.172 +			// Container child table1.Gtk.Table+TableChild
  35.173 +			this.lblAmount = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  35.174 +			this.lblAmount.Name = "lblAmount";
  35.175 +			this.lblAmount.LabelProp = global::Mono.Unix.Catalog.GetString("amount:");
  35.176 +			this.table1.Add(this.lblAmount);
  35.177 +			global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.lblAmount]));
  35.178 +			w13.TopAttach = ((uint)(1));
  35.179 +			w13.BottomAttach = ((uint)(2));
  35.180 +			w13.XOptions = ((global::Gtk.AttachOptions)(4));
  35.181 +			w13.YOptions = ((global::Gtk.AttachOptions)(4));
  35.182 +			// Container child table1.Gtk.Table+TableChild
  35.183 +			this.lblItem = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  35.184 +			this.lblItem.Name = "lblItem";
  35.185 +			this.lblItem.LabelProp = global::Mono.Unix.Catalog.GetString("equipment");
  35.186 +			this.table1.Add(this.lblItem);
  35.187 +			global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.lblItem]));
  35.188 +			w14.XOptions = ((global::Gtk.AttachOptions)(4));
  35.189 +			w14.YOptions = ((global::Gtk.AttachOptions)(4));
  35.190 +			w1.Add(this.table1);
  35.191 +			global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(w1[this.table1]));
  35.192 +			w15.Position = 0;
  35.193 +			w15.Expand = false;
  35.194 +			w15.Fill = false;
  35.195 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.ActionArea
  35.196 +			global::Gtk.HButtonBox w16 = this.ActionArea;
  35.197 +			w16.Name = "dialog1_ActionArea";
  35.198 +			w16.Spacing = 10;
  35.199 +			w16.BorderWidth = ((uint)(5));
  35.200 +			w16.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
  35.201 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  35.202 +			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  35.203 +			this.bttnCancel.CanDefault = true;
  35.204 +			this.bttnCancel.CanFocus = true;
  35.205 +			this.bttnCancel.Name = "bttnCancel";
  35.206 +			this.bttnCancel.UseStock = true;
  35.207 +			this.bttnCancel.UseUnderline = true;
  35.208 +			this.bttnCancel.Label = "gtk-cancel";
  35.209 +			this.AddActionWidget(this.bttnCancel, -6);
  35.210 +			global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.bttnCancel]));
  35.211 +			w17.Expand = false;
  35.212 +			w17.Fill = false;
  35.213 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  35.214 +			this.bttnOkay = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  35.215 +			this.bttnOkay.CanDefault = true;
  35.216 +			this.bttnOkay.CanFocus = true;
  35.217 +			this.bttnOkay.Name = "bttnOkay";
  35.218 +			this.bttnOkay.UseStock = true;
  35.219 +			this.bttnOkay.UseUnderline = true;
  35.220 +			this.bttnOkay.Label = "gtk-ok";
  35.221 +			this.AddActionWidget(this.bttnOkay, -5);
  35.222 +			global::Gtk.ButtonBox.ButtonBoxChild w18 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.bttnOkay]));
  35.223 +			w18.Position = 1;
  35.224 +			w18.Expand = false;
  35.225 +			w18.Fill = false;
  35.226 +			if ((this.Child != null))
  35.227 +			{
  35.228 +				this.Child.ShowAll();
  35.229 +			}
  35.230 +			this.DefaultWidth = 400;
  35.231 +			this.DefaultHeight = 300;
  35.232 +			this.Show();
  35.233 +			this.rbEquipNumeric.Clicked += new global::System.EventHandler(this.RadioButtonClicked);
  35.234 +			this.percentageAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
  35.235 +			this.numericAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
  35.236 +			this.bttnCancel.Clicked += new global::System.EventHandler(this.CancelButtonClicked);
  35.237 +			this.bttnOkay.Clicked += new global::System.EventHandler(this.OkayButtonClicked);
  35.238 +		}
  35.239 +	}
  35.240 +}
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment.cs	Mon Jan 17 19:43:47 2011 +0000
    36.3 @@ -0,0 +1,208 @@
    36.4 +
    36.5 +// This file has been generated by the GUI designer. Do not modify.
    36.6 +namespace IBBoard.WarFoundry.GUI.GTK
    36.7 +{
    36.8 +	public partial class FrmEditEquipment
    36.9 +	{
   36.10 +		private global::Gtk.Table table1;
   36.11 +		private global::Gtk.HBox hbox2;
   36.12 +		private global::Gtk.Table table2;
   36.13 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblEquipAll;
   36.14 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblPercent;
   36.15 +		private global::Gtk.SpinButton numericAmount;
   36.16 +		private global::Gtk.SpinButton percentageAmount;
   36.17 +		private global::Gtk.RadioButton rbEquipAll;
   36.18 +		private global::Gtk.RadioButton rbEquipNumeric;
   36.19 +		private global::Gtk.RadioButton rbEquipPercent;
   36.20 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblAmount;
   36.21 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
   36.22 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnOkay;
   36.23 +
   36.24 +		protected virtual void Build()
   36.25 +		{
   36.26 +			global::Stetic.Gui.Initialize(this);
   36.27 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment
   36.28 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment";
   36.29 +			this.Title = global::Mono.Unix.Catalog.GetString("Edit equipment");
   36.30 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   36.31 +			this.Modal = true;
   36.32 +			this.SkipPagerHint = true;
   36.33 +			this.SkipTaskbarHint = true;
   36.34 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment.VBox
   36.35 +			global::Gtk.VBox w1 = this.VBox;
   36.36 +			w1.Name = "dialog1_VBox";
   36.37 +			w1.BorderWidth = ((uint)(2));
   36.38 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   36.39 +			this.table1 = new global::Gtk.Table(((uint)(1)), ((uint)(2)), false);
   36.40 +			this.table1.Name = "table1";
   36.41 +			this.table1.RowSpacing = ((uint)(6));
   36.42 +			this.table1.ColumnSpacing = ((uint)(6));
   36.43 +			// Container child table1.Gtk.Table+TableChild
   36.44 +			this.hbox2 = new global::Gtk.HBox();
   36.45 +			this.hbox2.Name = "hbox2";
   36.46 +			this.hbox2.Spacing = 6;
   36.47 +			// Container child hbox2.Gtk.Box+BoxChild
   36.48 +			this.table2 = new global::Gtk.Table(((uint)(3)), ((uint)(3)), false);
   36.49 +			this.table2.Name = "table2";
   36.50 +			this.table2.RowSpacing = ((uint)(6));
   36.51 +			this.table2.ColumnSpacing = ((uint)(6));
   36.52 +			// Container child table2.Gtk.Table+TableChild
   36.53 +			this.lblEquipAll = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   36.54 +			this.lblEquipAll.Name = "lblEquipAll";
   36.55 +			this.lblEquipAll.LabelProp = global::Mono.Unix.Catalog.GetString("equip all");
   36.56 +			this.table2.Add(this.lblEquipAll);
   36.57 +			global::Gtk.Table.TableChild w2 = ((global::Gtk.Table.TableChild)(this.table2[this.lblEquipAll]));
   36.58 +			w2.TopAttach = ((uint)(2));
   36.59 +			w2.BottomAttach = ((uint)(3));
   36.60 +			w2.LeftAttach = ((uint)(1));
   36.61 +			w2.RightAttach = ((uint)(2));
   36.62 +			w2.YOptions = ((global::Gtk.AttachOptions)(4));
   36.63 +			// Container child table2.Gtk.Table+TableChild
   36.64 +			this.lblPercent = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   36.65 +			this.lblPercent.Name = "lblPercent";
   36.66 +			this.lblPercent.LabelProp = global::Mono.Unix.Catalog.GetString("%");
   36.67 +			this.table2.Add(this.lblPercent);
   36.68 +			global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table2[this.lblPercent]));
   36.69 +			w3.TopAttach = ((uint)(1));
   36.70 +			w3.BottomAttach = ((uint)(2));
   36.71 +			w3.LeftAttach = ((uint)(2));
   36.72 +			w3.RightAttach = ((uint)(3));
   36.73 +			w3.XOptions = ((global::Gtk.AttachOptions)(4));
   36.74 +			w3.YOptions = ((global::Gtk.AttachOptions)(4));
   36.75 +			// Container child table2.Gtk.Table+TableChild
   36.76 +			this.numericAmount = new global::Gtk.SpinButton(0, 100, 1);
   36.77 +			this.numericAmount.CanFocus = true;
   36.78 +			this.numericAmount.Name = "numericAmount";
   36.79 +			this.numericAmount.Adjustment.PageIncrement = 10;
   36.80 +			this.numericAmount.ClimbRate = 1;
   36.81 +			this.numericAmount.Numeric = true;
   36.82 +			this.table2.Add(this.numericAmount);
   36.83 +			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2[this.numericAmount]));
   36.84 +			w4.LeftAttach = ((uint)(1));
   36.85 +			w4.RightAttach = ((uint)(2));
   36.86 +			w4.XOptions = ((global::Gtk.AttachOptions)(0));
   36.87 +			w4.YOptions = ((global::Gtk.AttachOptions)(4));
   36.88 +			// Container child table2.Gtk.Table+TableChild
   36.89 +			this.percentageAmount = new global::Gtk.SpinButton(0, 100, 1);
   36.90 +			this.percentageAmount.CanFocus = true;
   36.91 +			this.percentageAmount.Name = "percentageAmount";
   36.92 +			this.percentageAmount.Adjustment.PageIncrement = 10;
   36.93 +			this.percentageAmount.ClimbRate = 1;
   36.94 +			this.percentageAmount.Digits = ((uint)(1));
   36.95 +			this.percentageAmount.Numeric = true;
   36.96 +			this.table2.Add(this.percentageAmount);
   36.97 +			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2[this.percentageAmount]));
   36.98 +			w5.TopAttach = ((uint)(1));
   36.99 +			w5.BottomAttach = ((uint)(2));
  36.100 +			w5.LeftAttach = ((uint)(1));
  36.101 +			w5.RightAttach = ((uint)(2));
  36.102 +			w5.XOptions = ((global::Gtk.AttachOptions)(0));
  36.103 +			w5.YOptions = ((global::Gtk.AttachOptions)(4));
  36.104 +			// Container child table2.Gtk.Table+TableChild
  36.105 +			this.rbEquipAll = new global::Gtk.RadioButton("");
  36.106 +			this.rbEquipAll.CanFocus = true;
  36.107 +			this.rbEquipAll.Name = "rbEquipAll";
  36.108 +			this.rbEquipAll.DrawIndicator = true;
  36.109 +			this.rbEquipAll.UseUnderline = true;
  36.110 +			this.rbEquipAll.Group = new global::GLib.SList(global::System.IntPtr.Zero);
  36.111 +			this.table2.Add(this.rbEquipAll);
  36.112 +			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipAll]));
  36.113 +			w6.TopAttach = ((uint)(2));
  36.114 +			w6.BottomAttach = ((uint)(3));
  36.115 +			w6.XOptions = ((global::Gtk.AttachOptions)(4));
  36.116 +			w6.YOptions = ((global::Gtk.AttachOptions)(4));
  36.117 +			// Container child table2.Gtk.Table+TableChild
  36.118 +			this.rbEquipNumeric = new global::Gtk.RadioButton("");
  36.119 +			this.rbEquipNumeric.CanFocus = true;
  36.120 +			this.rbEquipNumeric.Name = "rbEquipNumeric";
  36.121 +			this.rbEquipNumeric.DrawIndicator = true;
  36.122 +			this.rbEquipNumeric.UseUnderline = true;
  36.123 +			this.rbEquipNumeric.Group = this.rbEquipAll.Group;
  36.124 +			this.table2.Add(this.rbEquipNumeric);
  36.125 +			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipNumeric]));
  36.126 +			w7.XOptions = ((global::Gtk.AttachOptions)(4));
  36.127 +			w7.YOptions = ((global::Gtk.AttachOptions)(4));
  36.128 +			// Container child table2.Gtk.Table+TableChild
  36.129 +			this.rbEquipPercent = new global::Gtk.RadioButton("");
  36.130 +			this.rbEquipPercent.CanFocus = true;
  36.131 +			this.rbEquipPercent.Name = "rbEquipPercent";
  36.132 +			this.rbEquipPercent.DrawIndicator = true;
  36.133 +			this.rbEquipPercent.UseUnderline = true;
  36.134 +			this.rbEquipPercent.Group = this.rbEquipAll.Group;
  36.135 +			this.table2.Add(this.rbEquipPercent);
  36.136 +			global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipPercent]));
  36.137 +			w8.TopAttach = ((uint)(1));
  36.138 +			w8.BottomAttach = ((uint)(2));
  36.139 +			w8.XOptions = ((global::Gtk.AttachOptions)(4));
  36.140 +			w8.YOptions = ((global::Gtk.AttachOptions)(4));
  36.141 +			this.hbox2.Add(this.table2);
  36.142 +			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.table2]));
  36.143 +			w9.Position = 0;
  36.144 +			w9.Expand = false;
  36.145 +			w9.Fill = false;
  36.146 +			this.table1.Add(this.hbox2);
  36.147 +			global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1[this.hbox2]));
  36.148 +			w10.LeftAttach = ((uint)(1));
  36.149 +			w10.RightAttach = ((uint)(2));
  36.150 +			w10.YOptions = ((global::Gtk.AttachOptions)(4));
  36.151 +			// Container child table1.Gtk.Table+TableChild
  36.152 +			this.lblAmount = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  36.153 +			this.lblAmount.Name = "lblAmount";
  36.154 +			this.lblAmount.LabelProp = global::Mono.Unix.Catalog.GetString("amount:");
  36.155 +			this.lblAmount.Justify = ((global::Gtk.Justification)(1));
  36.156 +			this.table1.Add(this.lblAmount);
  36.157 +			global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.lblAmount]));
  36.158 +			w11.YOptions = ((global::Gtk.AttachOptions)(4));
  36.159 +			w1.Add(this.table1);
  36.160 +			global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(w1[this.table1]));
  36.161 +			w12.Position = 0;
  36.162 +			w12.Expand = false;
  36.163 +			w12.Fill = false;
  36.164 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment.ActionArea
  36.165 +			global::Gtk.HButtonBox w13 = this.ActionArea;
  36.166 +			w13.Name = "dialog1_ActionArea";
  36.167 +			w13.Spacing = 10;
  36.168 +			w13.BorderWidth = ((uint)(5));
  36.169 +			w13.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
  36.170 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  36.171 +			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  36.172 +			this.bttnCancel.CanDefault = true;
  36.173 +			this.bttnCancel.CanFocus = true;
  36.174 +			this.bttnCancel.Name = "bttnCancel";
  36.175 +			this.bttnCancel.UseStock = true;
  36.176 +			this.bttnCancel.UseUnderline = true;
  36.177 +			this.bttnCancel.Label = "gtk-cancel";
  36.178 +			this.AddActionWidget(this.bttnCancel, -6);
  36.179 +			global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCancel]));
  36.180 +			w14.Expand = false;
  36.181 +			w14.Fill = false;
  36.182 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  36.183 +			this.bttnOkay = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  36.184 +			this.bttnOkay.CanDefault = true;
  36.185 +			this.bttnOkay.CanFocus = true;
  36.186 +			this.bttnOkay.Name = "bttnOkay";
  36.187 +			this.bttnOkay.UseStock = true;
  36.188 +			this.bttnOkay.UseUnderline = true;
  36.189 +			this.bttnOkay.Label = "gtk-ok";
  36.190 +			this.AddActionWidget(this.bttnOkay, -5);
  36.191 +			global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnOkay]));
  36.192 +			w15.Position = 1;
  36.193 +			w15.Expand = false;
  36.194 +			w15.Fill = false;
  36.195 +			if ((this.Child != null))
  36.196 +			{
  36.197 +				this.Child.ShowAll();
  36.198 +			}
  36.199 +			this.DefaultWidth = 280;
  36.200 +			this.DefaultHeight = 175;
  36.201 +			this.Show();
  36.202 +			this.rbEquipPercent.Clicked += new global::System.EventHandler(this.RadioButtonClicked);
  36.203 +			this.rbEquipNumeric.Clicked += new global::System.EventHandler(this.RadioButtonClicked);
  36.204 +			this.rbEquipAll.Clicked += new global::System.EventHandler(this.RadioButtonClicked);
  36.205 +			this.percentageAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
  36.206 +			this.numericAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
  36.207 +			this.bttnCancel.Clicked += new global::System.EventHandler(this.CancelButtonClicked);
  36.208 +			this.bttnOkay.Clicked += new global::System.EventHandler(this.OkayButtonClicked);
  36.209 +		}
  36.210 +	}
  36.211 +}
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs	Mon Jan 17 19:43:47 2011 +0000
    37.3 @@ -0,0 +1,220 @@
    37.4 +
    37.5 +// This file has been generated by the GUI designer. Do not modify.
    37.6 +namespace IBBoard.WarFoundry.GUI.GTK
    37.7 +{
    37.8 +	public partial class FrmMainWindow
    37.9 +	{
   37.10 +		private global::Gtk.UIManager UIManager;
   37.11 +		private global::Gtk.Action menuFile;
   37.12 +		private global::Gtk.Action miNewArmy;
   37.13 +		private global::Gtk.Action miOpenArmy;
   37.14 +		private global::Gtk.Action miSaveArmy;
   37.15 +		private global::Gtk.Action miSaveArmyAs;
   37.16 +		private global::Gtk.Action miCloseArmy;
   37.17 +		private global::Gtk.Action miReloadFiles;
   37.18 +		private global::Gtk.Action miExit;
   37.19 +		private global::Gtk.Action menuEdit;
   37.20 +		private global::Gtk.Action miUndo;
   37.21 +		private global::Gtk.Action miRedo;
   37.22 +		private global::Gtk.Action menuHelp;
   37.23 +		private global::Gtk.Action miAbout;
   37.24 +		private global::Gtk.Action miDebugInformation;
   37.25 +		private global::Gtk.Action bttnNewArmy;
   37.26 +		private global::Gtk.Action bttnOpenArmy;
   37.27 +		private global::Gtk.Action bttnSaveArmy;
   37.28 +		private global::Gtk.Action bttnUndo;
   37.29 +		private global::Gtk.Action bttnRedo;
   37.30 +		private global::Gtk.Action goDown;
   37.31 +		private global::Gtk.Action add;
   37.32 +		private global::Gtk.Action miExportArmyAs;
   37.33 +		private global::Gtk.Action miExportArmyAsBasicHTML;
   37.34 +		private global::Gtk.Action miPreferences;
   37.35 +		private global::Gtk.VBox vbox1;
   37.36 +		private global::Gtk.MenuBar menubar1;
   37.37 +		private global::Gtk.Toolbar toolbar;
   37.38 +		private global::Gtk.HPaned hpaned2;
   37.39 +		private global::Gtk.TreeView treeUnits;
   37.40 +		private global::Gtk.Notebook unitsNotebook;
   37.41 +		private global::Gtk.Statusbar statusbar1;
   37.42 +		private global::Gtk.Label lblTotalPoints;
   37.43 +
   37.44 +		protected virtual void Build()
   37.45 +		{
   37.46 +			global::Stetic.Gui.Initialize(this);
   37.47 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmMainWindow
   37.48 +			this.UIManager = new global::Gtk.UIManager();
   37.49 +			global::Gtk.ActionGroup w1 = new global::Gtk.ActionGroup("Default");
   37.50 +			this.menuFile = new global::Gtk.Action("menuFile", global::Mono.Unix.Catalog.GetString("File"), null, null);
   37.51 +			this.menuFile.ShortLabel = global::Mono.Unix.Catalog.GetString("File");
   37.52 +			w1.Add(this.menuFile, null);
   37.53 +			this.miNewArmy = new global::Gtk.Action("miNewArmy", global::Mono.Unix.Catalog.GetString("Create army"), null, "gtk-new");
   37.54 +			this.miNewArmy.ShortLabel = global::Mono.Unix.Catalog.GetString("Create army");
   37.55 +			w1.Add(this.miNewArmy, null);
   37.56 +			this.miOpenArmy = new global::Gtk.Action("miOpenArmy", global::Mono.Unix.Catalog.GetString("Open army"), null, "gtk-open");
   37.57 +			this.miOpenArmy.ShortLabel = global::Mono.Unix.Catalog.GetString("Open army");
   37.58 +			w1.Add(this.miOpenArmy, null);
   37.59 +			this.miSaveArmy = new global::Gtk.Action("miSaveArmy", global::Mono.Unix.Catalog.GetString("Save army"), null, "gtk-save");
   37.60 +			this.miSaveArmy.Sensitive = false;
   37.61 +			this.miSaveArmy.ShortLabel = global::Mono.Unix.Catalog.GetString("Save army");
   37.62 +			w1.Add(this.miSaveArmy, null);
   37.63 +			this.miSaveArmyAs = new global::Gtk.Action("miSaveArmyAs", global::Mono.Unix.Catalog.GetString("Save army as"), null, "gtk-save-as");
   37.64 +			this.miSaveArmyAs.Sensitive = false;
   37.65 +			this.miSaveArmyAs.ShortLabel = global::Mono.Unix.Catalog.GetString("Save army as");
   37.66 +			w1.Add(this.miSaveArmyAs, null);
   37.67 +			this.miCloseArmy = new global::Gtk.Action("miCloseArmy", global::Mono.Unix.Catalog.GetString("Close army"), null, "gtk-close");
   37.68 +			this.miCloseArmy.Sensitive = false;
   37.69 +			this.miCloseArmy.ShortLabel = global::Mono.Unix.Catalog.GetString("Close army");
   37.70 +			w1.Add(this.miCloseArmy, null);
   37.71 +			this.miReloadFiles = new global::Gtk.Action("miReloadFiles", global::Mono.Unix.Catalog.GetString("Reload files"), null, "gtk-refresh");
   37.72 +			this.miReloadFiles.ShortLabel = global::Mono.Unix.Catalog.GetString("Reload files");
   37.73 +			w1.Add(this.miReloadFiles, null);
   37.74 +			this.miExit = new global::Gtk.Action("miExit", global::Mono.Unix.Catalog.GetString("Exit"), null, "gtk-quit");
   37.75 +			this.miExit.ShortLabel = global::Mono.Unix.Catalog.GetString("Exit");
   37.76 +			w1.Add(this.miExit, null);
   37.77 +			this.menuEdit = new global::Gtk.Action("menuEdit", global::Mono.Unix.Catalog.GetString("Edit"), null, null);
   37.78 +			this.menuEdit.ShortLabel = global::Mono.Unix.Catalog.GetString("Edit");
   37.79 +			w1.Add(this.menuEdit, null);
   37.80 +			this.miUndo = new global::Gtk.Action("miUndo", global::Mono.Unix.Catalog.GetString("Undo"), null, "gtk-undo");
   37.81 +			this.miUndo.Sensitive = false;
   37.82 +			this.miUndo.ShortLabel = global::Mono.Unix.Catalog.GetString("Undo");
   37.83 +			w1.Add(this.miUndo, null);
   37.84 +			this.miRedo = new global::Gtk.Action("miRedo", global::Mono.Unix.Catalog.GetString("Redo"), null, "gtk-redo");
   37.85 +			this.miRedo.Sensitive = false;
   37.86 +			this.miRedo.ShortLabel = global::Mono.Unix.Catalog.GetString("Redo");
   37.87 +			w1.Add(this.miRedo, null);
   37.88 +			this.menuHelp = new global::Gtk.Action("menuHelp", global::Mono.Unix.Catalog.GetString("Help"), null, null);
   37.89 +			this.menuHelp.ShortLabel = global::Mono.Unix.Catalog.GetString("Help");
   37.90 +			w1.Add(this.menuHelp, null);
   37.91 +			this.miAbout = new global::Gtk.Action("miAbout", global::Mono.Unix.Catalog.GetString("About"), null, "gtk-about");
   37.92 +			this.miAbout.ShortLabel = global::Mono.Unix.Catalog.GetString("About");
   37.93 +			w1.Add(this.miAbout, null);
   37.94 +			this.miDebugInformation = new global::Gtk.Action("miDebugInformation", global::Mono.Unix.Catalog.GetString("Debug Information"), null, null);
   37.95 +			this.miDebugInformation.ShortLabel = global::Mono.Unix.Catalog.GetString("Debug Information");
   37.96 +			w1.Add(this.miDebugInformation, null);
   37.97 +			this.bttnNewArmy = new global::Gtk.Action("bttnNewArmy", null, null, "gtk-new");
   37.98 +			w1.Add(this.bttnNewArmy, null);
   37.99 +			this.bttnOpenArmy = new global::Gtk.Action("bttnOpenArmy", null, null, "gtk-open");
  37.100 +			w1.Add(this.bttnOpenArmy, null);
  37.101 +			this.bttnSaveArmy = new global::Gtk.Action("bttnSaveArmy", null, null, "gtk-save");
  37.102 +			this.bttnSaveArmy.Sensitive = false;
  37.103 +			w1.Add(this.bttnSaveArmy, null);
  37.104 +			this.bttnUndo = new global::Gtk.Action("bttnUndo", null, null, "gtk-undo");
  37.105 +			this.bttnUndo.Sensitive = false;
  37.106 +			w1.Add(this.bttnUndo, null);
  37.107 +			this.bttnRedo = new global::Gtk.Action("bttnRedo", null, null, "gtk-redo");
  37.108 +			this.bttnRedo.Sensitive = false;
  37.109 +			w1.Add(this.bttnRedo, null);
  37.110 +			this.goDown = new global::Gtk.Action("goDown", null, null, null);
  37.111 +			w1.Add(this.goDown, null);
  37.112 +			this.add = new global::Gtk.Action("add", null, null, "gtk-add");
  37.113 +			w1.Add(this.add, null);
  37.114 +			this.miExportArmyAs = new global::Gtk.Action("miExportArmyAs", global::Mono.Unix.Catalog.GetString("Export army as..."), null, "gtk-convert");
  37.115 +			this.miExportArmyAs.Sensitive = false;
  37.116 +			this.miExportArmyAs.ShortLabel = global::Mono.Unix.Catalog.GetString("Export army as...");
  37.117 +			w1.Add(this.miExportArmyAs, null);
  37.118 +			this.miExportArmyAsBasicHTML = new global::Gtk.Action("miExportArmyAsBasicHTML", global::Mono.Unix.Catalog.GetString("Basic HTML"), null, null);
  37.119 +			this.miExportArmyAsBasicHTML.ShortLabel = global::Mono.Unix.Catalog.GetString("Basic HTML");
  37.120 +			w1.Add(this.miExportArmyAsBasicHTML, null);
  37.121 +			this.miPreferences = new global::Gtk.Action("miPreferences", global::Mono.Unix.Catalog.GetString("preferences"), null, "gtk-preferences");
  37.122 +			this.miPreferences.ShortLabel = global::Mono.Unix.Catalog.GetString("preferences");
  37.123 +			w1.Add(this.miPreferences, null);
  37.124 +			this.UIManager.InsertActionGroup(w1, 0);
  37.125 +			this.AddAccelGroup(this.UIManager.AccelGroup);
  37.126 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmMainWindow";
  37.127 +			this.Title = global::Mono.Unix.Catalog.GetString("MainWindow");
  37.128 +			this.Icon = global::Gdk.Pixbuf.LoadFromResource("App.ico");
  37.129 +			// Container child IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.Gtk.Container+ContainerChild
  37.130 +			this.vbox1 = new global::Gtk.VBox();
  37.131 +			this.vbox1.Name = "vbox1";
  37.132 +			// Container child vbox1.Gtk.Box+BoxChild
  37.133 +			this.UIManager.AddUiFromString("<ui><menubar name='menubar1'><menu name='menuFile' action='menuFile'><menuitem name='miNewArmy' action='miNewArmy'/><menuitem name='miOpenArmy' action='miOpenArmy'/><menuitem name='miSaveArmy' action='miSaveArmy'/><menuitem name='miSaveArmyAs' action='miSaveArmyAs'/><menu name='miExportArmyAs' action='miExportArmyAs'><menuitem name='miExportArmyAsBasicHTML' action='miExportArmyAsBasicHTML'/></menu><menuitem name='miCloseArmy' action='miCloseArmy'/><separator/><menuitem name='miReloadFiles' action='miReloadFiles'/><separator/><menuitem name='miExit' action='miExit'/></menu><menu name='menuEdit' action='menuEdit'><menuitem name='miUndo' action='miUndo'/><menuitem name='miRedo' action='miRedo'/><separator/><menuitem name='miPreferences' action='miPreferences'/></menu><menu name='menuHelp' action='menuHelp'><menuitem name='miAbout' action='miAbout'/></menu></menubar></ui>");
  37.134 +			this.menubar1 = ((global::Gtk.MenuBar)(this.UIManager.GetWidget("/menubar1")));
  37.135 +			this.menubar1.Name = "menubar1";
  37.136 +			this.vbox1.Add(this.menubar1);
  37.137 +			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.menubar1]));
  37.138 +			w2.Position = 0;
  37.139 +			w2.Expand = false;
  37.140 +			w2.Fill = false;
  37.141 +			// Container child vbox1.Gtk.Box+BoxChild
  37.142 +			this.UIManager.AddUiFromString("<ui><toolbar name='toolbar'><toolitem name='bttnNewArmy' action='bttnNewArmy'/><toolitem name='bttnOpenArmy' action='bttnOpenArmy'/><toolitem name='bttnSaveArmy' action='bttnSaveArmy'/><separator/><toolitem name='bttnUndo' action='bttnUndo'/><toolitem name='bttnRedo' action='bttnRedo'/><separator/></toolbar></ui>");
  37.143 +			this.toolbar = ((global::Gtk.Toolbar)(this.UIManager.GetWidget("/toolbar")));
  37.144 +			this.toolbar.HeightRequest = 36;
  37.145 +			this.toolbar.Name = "toolbar";
  37.146 +			this.toolbar.ShowArrow = false;
  37.147 +			this.toolbar.ToolbarStyle = ((global::Gtk.ToolbarStyle)(0));
  37.148 +			this.toolbar.IconSize = ((global::Gtk.IconSize)(3));
  37.149 +			this.vbox1.Add(this.toolbar);
  37.150 +			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.toolbar]));
  37.151 +			w3.Position = 1;
  37.152 +			w3.Expand = false;
  37.153 +			w3.Fill = false;
  37.154 +			// Container child vbox1.Gtk.Box+BoxChild
  37.155 +			this.hpaned2 = new global::Gtk.HPaned();
  37.156 +			this.hpaned2.CanFocus = true;
  37.157 +			this.hpaned2.Name = "hpaned2";
  37.158 +			this.hpaned2.Position = 178;
  37.159 +			// Container child hpaned2.Gtk.Paned+PanedChild
  37.160 +			this.treeUnits = new global::Gtk.TreeView();
  37.161 +			this.treeUnits.CanFocus = true;
  37.162 +			this.treeUnits.Name = "treeUnits";
  37.163 +			this.hpaned2.Add(this.treeUnits);
  37.164 +			global::Gtk.Paned.PanedChild w4 = ((global::Gtk.Paned.PanedChild)(this.hpaned2[this.treeUnits]));
  37.165 +			w4.Resize = false;
  37.166 +			// Container child hpaned2.Gtk.Paned+PanedChild
  37.167 +			this.unitsNotebook = new global::Gtk.Notebook();
  37.168 +			this.unitsNotebook.CanFocus = true;
  37.169 +			this.unitsNotebook.Name = "unitsNotebook";
  37.170 +			this.unitsNotebook.CurrentPage = -1;
  37.171 +			this.unitsNotebook.Scrollable = true;
  37.172 +			this.hpaned2.Add(this.unitsNotebook);
  37.173 +			this.vbox1.Add(this.hpaned2);
  37.174 +			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hpaned2]));
  37.175 +			w6.Position = 2;
  37.176 +			// Container child vbox1.Gtk.Box+BoxChild
  37.177 +			this.statusbar1 = new global::Gtk.Statusbar();
  37.178 +			this.statusbar1.Name = "statusbar1";
  37.179 +			this.statusbar1.Spacing = 2;
  37.180 +			// Container child statusbar1.Gtk.Box+BoxChild
  37.181 +			this.lblTotalPoints = new global::Gtk.Label();
  37.182 +			this.lblTotalPoints.Name = "lblTotalPoints";
  37.183 +			this.statusbar1.Add(this.lblTotalPoints);
  37.184 +			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.statusbar1[this.lblTotalPoints]));
  37.185 +			w7.Position = 2;
  37.186 +			w7.Expand = false;
  37.187 +			w7.Fill = false;
  37.188 +			this.vbox1.Add(this.statusbar1);
  37.189 +			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
  37.190 +			w8.Position = 3;
  37.191 +			w8.Expand = false;
  37.192 +			w8.Fill = false;
  37.193 +			this.Add(this.vbox1);
  37.194 +			if ((this.Child != null))
  37.195 +			{
  37.196 +				this.Child.ShowAll();
  37.197 +			}
  37.198 +			this.DefaultWidth = 832;
  37.199 +			this.DefaultHeight = 659;
  37.200 +			this.hpaned2.Hide();
  37.201 +			this.Show();
  37.202 +			this.miNewArmy.Activated += new global::System.EventHandler(this.OnCreateArmyActivated);
  37.203 +			this.miOpenArmy.Activated += new global::System.EventHandler(this.OnOpenArmyActivated);
  37.204 +			this.miSaveArmy.Activated += new global::System.EventHandler(this.OnSaveArmyActivated);
  37.205 +			this.miSaveArmyAs.Activated += new global::System.EventHandler(this.OnSaveArmyAsActivated);
  37.206 +			this.miCloseArmy.Activated += new global::System.EventHandler(this.OnCloseArmyActivated);
  37.207 +			this.miReloadFiles.Activated += new global::System.EventHandler(this.OnReloadFilesActivated);
  37.208 +			this.miExit.Activated += new global::System.EventHandler(this.OnExitActivated);
  37.209 +			this.miAbout.Activated += new global::System.EventHandler(this.HelpAboutActivated);
  37.210 +			this.bttnNewArmy.Activated += new global::System.EventHandler(this.newTBButtonActivated);
  37.211 +			this.bttnOpenArmy.Activated += new global::System.EventHandler(this.openTBButtonActivated);
  37.212 +			this.bttnSaveArmy.Activated += new global::System.EventHandler(this.saveTBButtonActivated);
  37.213 +			this.bttnUndo.Activated += new global::System.EventHandler(this.undoTBButtonActivated);
  37.214 +			this.bttnRedo.Activated += new global::System.EventHandler(this.redoTBButtonActivated);
  37.215 +			this.miExportArmyAsBasicHTML.Activated += new global::System.EventHandler(this.OnMiExportAsBasicHtmlActivated);
  37.216 +			this.miPreferences.Activated += new global::System.EventHandler(this.miPreferencesClicked);
  37.217 +			this.treeUnits.RowActivated += new global::Gtk.RowActivatedHandler(this.ArmyRowActivated);
  37.218 +			this.treeUnits.PopupMenu += new global::Gtk.PopupMenuHandler(this.OnTreeUnitsPopupMenu);
  37.219 +			this.treeUnits.ButtonPressEvent += new global::Gtk.ButtonPressEventHandler(this.UnitTreeButtonPressed);
  37.220 +			this.unitsNotebook.Removed += new global::Gtk.RemovedHandler(this.NotebookPageRemoved);
  37.221 +		}
  37.222 +	}
  37.223 +}
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.cs	Mon Jan 17 19:43:47 2011 +0000
    38.3 @@ -0,0 +1,203 @@
    38.4 +
    38.5 +// This file has been generated by the GUI designer. Do not modify.
    38.6 +namespace IBBoard.WarFoundry.GUI.GTK
    38.7 +{
    38.8 +	public partial class FrmNewArmy
    38.9 +	{
   38.10 +		private global::Gtk.Table table1;
   38.11 +		private global::Gtk.ScrolledWindow GtkScrolledWindow;
   38.12 +		private global::Gtk.TreeView lstRaces;
   38.13 +		private global::Gtk.HBox hbox2;
   38.14 +		private global::Gtk.SpinButton sbPointsValue;
   38.15 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblArmyName;
   38.16 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblArmySize;
   38.17 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblGameSystem;
   38.18 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblRaceList;
   38.19 +		private global::Gtk.ComboBoxEntry systemCombo;
   38.20 +		private global::Gtk.Entry txtArmyName;
   38.21 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
   38.22 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCreate;
   38.23 +
   38.24 +		protected virtual void Build()
   38.25 +		{
   38.26 +			global::Stetic.Gui.Initialize(this);
   38.27 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmNewArmy
   38.28 +			this.Events = ((global::Gdk.EventMask)(256));
   38.29 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmNewArmy";
   38.30 +			this.Title = global::Mono.Unix.Catalog.GetString("Create new army");
   38.31 +			this.Icon = global::Stetic.IconLoader.LoadIcon(this, "gtk-new", global::Gtk.IconSize.Menu);
   38.32 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   38.33 +			this.SkipPagerHint = true;
   38.34 +			this.SkipTaskbarHint = true;
   38.35 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.VBox
   38.36 +			global::Gtk.VBox w1 = this.VBox;
   38.37 +			w1.CanFocus = true;
   38.38 +			w1.Events = ((global::Gdk.EventMask)(256));
   38.39 +			w1.Name = "dialog_VBox";
   38.40 +			w1.BorderWidth = ((uint)(2));
   38.41 +			// Container child dialog_VBox.Gtk.Box+BoxChild
   38.42 +			this.table1 = new global::Gtk.Table(((uint)(4)), ((uint)(2)), false);
   38.43 +			this.table1.Name = "table1";
   38.44 +			this.table1.RowSpacing = ((uint)(6));
   38.45 +			this.table1.ColumnSpacing = ((uint)(6));
   38.46 +			// Container child table1.Gtk.Table+TableChild
   38.47 +			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
   38.48 +			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
   38.49 +			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
   38.50 +			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
   38.51 +			this.lstRaces = new global::Gtk.TreeView();
   38.52 +			this.lstRaces.HeightRequest = 150;
   38.53 +			this.lstRaces.CanFocus = true;
   38.54 +			this.lstRaces.Name = "lstRaces";
   38.55 +			this.lstRaces.HeadersVisible = false;
   38.56 +			this.lstRaces.RulesHint = true;
   38.57 +			this.GtkScrolledWindow.Add(this.lstRaces);
   38.58 +			this.table1.Add(this.GtkScrolledWindow);
   38.59 +			global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow]));
   38.60 +			w3.TopAttach = ((uint)(1));
   38.61 +			w3.BottomAttach = ((uint)(2));
   38.62 +			w3.LeftAttach = ((uint)(1));
   38.63 +			w3.RightAttach = ((uint)(2));
   38.64 +			w3.XOptions = ((global::Gtk.AttachOptions)(4));
   38.65 +			w3.YOptions = ((global::Gtk.AttachOptions)(4));
   38.66 +			// Container child table1.Gtk.Table+TableChild
   38.67 +			this.hbox2 = new global::Gtk.HBox();
   38.68 +			this.hbox2.Name = "hbox2";
   38.69 +			// Container child hbox2.Gtk.Box+BoxChild
   38.70 +			this.sbPointsValue = new global::Gtk.SpinButton(0, 2000000000, 100);
   38.71 +			this.sbPointsValue.WidthRequest = 150;
   38.72 +			this.sbPointsValue.CanFocus = true;
   38.73 +			this.sbPointsValue.Name = "sbPointsValue";
   38.74 +			this.sbPointsValue.Adjustment.PageIncrement = 1000;
   38.75 +			this.sbPointsValue.ClimbRate = 100;
   38.76 +			this.sbPointsValue.Numeric = true;
   38.77 +			this.sbPointsValue.Value = 1000;
   38.78 +			this.hbox2.Add(this.sbPointsValue);
   38.79 +			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.sbPointsValue]));
   38.80 +			w4.Position = 0;
   38.81 +			w4.Expand = false;
   38.82 +			w4.Fill = false;
   38.83 +			this.table1.Add(this.hbox2);
   38.84 +			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.hbox2]));
   38.85 +			w5.TopAttach = ((uint)(3));
   38.86 +			w5.BottomAttach = ((uint)(4));
   38.87 +			w5.LeftAttach = ((uint)(1));
   38.88 +			w5.RightAttach = ((uint)(2));
   38.89 +			w5.XOptions = ((global::Gtk.AttachOptions)(4));
   38.90 +			w5.YOptions = ((global::Gtk.AttachOptions)(4));
   38.91 +			// Container child table1.Gtk.Table+TableChild
   38.92 +			this.lblArmyName = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   38.93 +			this.lblArmyName.Name = "lblArmyName";
   38.94 +			this.lblArmyName.LabelProp = global::Mono.Unix.Catalog.GetString("army name");
   38.95 +			this.table1.Add(this.lblArmyName);
   38.96 +			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table1[this.lblArmyName]));
   38.97 +			w6.TopAttach = ((uint)(2));
   38.98 +			w6.BottomAttach = ((uint)(3));
   38.99 +			w6.XOptions = ((global::Gtk.AttachOptions)(4));
  38.100 +			w6.YOptions = ((global::Gtk.AttachOptions)(4));
  38.101 +			// Container child table1.Gtk.Table+TableChild
  38.102 +			this.lblArmySize = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  38.103 +			this.lblArmySize.Name = "lblArmySize";
  38.104 +			this.lblArmySize.LabelProp = global::Mono.Unix.Catalog.GetString("points value");
  38.105 +			this.table1.Add(this.lblArmySize);
  38.106 +			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table1[this.lblArmySize]));
  38.107 +			w7.TopAttach = ((uint)(3));
  38.108 +			w7.BottomAttach = ((uint)(4));
  38.109 +			w7.XOptions = ((global::Gtk.AttachOptions)(4));
  38.110 +			w7.YOptions = ((global::Gtk.AttachOptions)(4));
  38.111 +			// Container child table1.Gtk.Table+TableChild
  38.112 +			this.lblGameSystem = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  38.113 +			this.lblGameSystem.Name = "lblGameSystem";
  38.114 +			this.lblGameSystem.LabelProp = global::Mono.Unix.Catalog.GetString("game system");
  38.115 +			this.table1.Add(this.lblGameSystem);
  38.116 +			global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table1[this.lblGameSystem]));
  38.117 +			w8.XOptions = ((global::Gtk.AttachOptions)(4));
  38.118 +			w8.YOptions = ((global::Gtk.AttachOptions)(4));
  38.119 +			// Container child table1.Gtk.Table+TableChild
  38.120 +			this.lblRaceList = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  38.121 +			this.lblRaceList.Name = "lblRaceList";
  38.122 +			this.lblRaceList.LabelProp = global::Mono.Unix.Catalog.GetString("race");
  38.123 +			this.table1.Add(this.lblRaceList);
  38.124 +			global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table1[this.lblRaceList]));
  38.125 +			w9.TopAttach = ((uint)(1));
  38.126 +			w9.BottomAttach = ((uint)(2));
  38.127 +			w9.XOptions = ((global::Gtk.AttachOptions)(4));
  38.128 +			w9.YOptions = ((global::Gtk.AttachOptions)(4));
  38.129 +			// Container child table1.Gtk.Table+TableChild
  38.130 +			this.systemCombo = global::Gtk.ComboBoxEntry.NewText();
  38.131 +			this.systemCombo.Name = "systemCombo";
  38.132 +			this.table1.Add(this.systemCombo);
  38.133 +			global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1[this.systemCombo]));
  38.134 +			w10.LeftAttach = ((uint)(1));
  38.135 +			w10.RightAttach = ((uint)(2));
  38.136 +			w10.YOptions = ((global::Gtk.AttachOptions)(4));
  38.137 +			// Container child table1.Gtk.Table+TableChild
  38.138 +			this.txtArmyName = new global::Gtk.Entry();
  38.139 +			this.txtArmyName.CanFocus = true;
  38.140 +			this.txtArmyName.Name = "txtArmyName";
  38.141 +			this.txtArmyName.IsEditable = true;
  38.142 +			this.txtArmyName.InvisibleChar = '•';
  38.143 +			this.table1.Add(this.txtArmyName);
  38.144 +			global::Gtk.Table.TableChild w11 = ((global::Gtk.Table.TableChild)(this.table1[this.txtArmyName]));
  38.145 +			w11.TopAttach = ((uint)(2));
  38.146 +			w11.BottomAttach = ((uint)(3));
  38.147 +			w11.LeftAttach = ((uint)(1));
  38.148 +			w11.RightAttach = ((uint)(2));
  38.149 +			w11.XOptions = ((global::Gtk.AttachOptions)(4));
  38.150 +			w11.YOptions = ((global::Gtk.AttachOptions)(4));
  38.151 +			w1.Add(this.table1);
  38.152 +			global::Gtk.Box.BoxChild w12 = ((global::Gtk.Box.BoxChild)(w1[this.table1]));
  38.153 +			w12.Position = 0;
  38.154 +			w12.Expand = false;
  38.155 +			w12.Fill = false;
  38.156 +			w12.Padding = ((uint)(6));
  38.157 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmNewArmy.ActionArea
  38.158 +			global::Gtk.HButtonBox w13 = this.ActionArea;
  38.159 +			w13.CanFocus = true;
  38.160 +			w13.Events = ((global::Gdk.EventMask)(256));
  38.161 +			w13.Name = "WarFoundrySharp.FrmNewArmy_ActionArea";
  38.162 +			w13.Spacing = 6;
  38.163 +			w13.BorderWidth = ((uint)(5));
  38.164 +			w13.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
  38.165 +			// Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  38.166 +			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  38.167 +			this.bttnCancel.CanFocus = true;
  38.168 +			this.bttnCancel.Name = "bttnCancel";
  38.169 +			this.bttnCancel.UseStock = true;
  38.170 +			this.bttnCancel.UseUnderline = true;
  38.171 +			this.bttnCancel.Label = "gtk-cancel";
  38.172 +			this.AddActionWidget(this.bttnCancel, -6);
  38.173 +			global::Gtk.ButtonBox.ButtonBoxChild w14 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCancel]));
  38.174 +			w14.Expand = false;
  38.175 +			w14.Fill = false;
  38.176 +			// Container child WarFoundrySharp.FrmNewArmy_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  38.177 +			this.bttnCreate = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  38.178 +			this.bttnCreate.Sensitive = false;
  38.179 +			this.bttnCreate.CanDefault = true;
  38.180 +			this.bttnCreate.CanFocus = true;
  38.181 +			this.bttnCreate.Name = "bttnCreate";
  38.182 +			this.bttnCreate.UseStock = true;
  38.183 +			this.bttnCreate.UseUnderline = true;
  38.184 +			this.bttnCreate.Label = "gtk-ok";
  38.185 +			this.AddActionWidget(this.bttnCreate, -5);
  38.186 +			global::Gtk.ButtonBox.ButtonBoxChild w15 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w13[this.bttnCreate]));
  38.187 +			w15.Position = 1;
  38.188 +			w15.Expand = false;
  38.189 +			w15.Fill = false;
  38.190 +			if ((this.Child != null))
  38.191 +			{
  38.192 +				this.Child.ShowAll();
  38.193 +			}
  38.194 +			this.DefaultWidth = 370;
  38.195 +			this.DefaultHeight = 348;
  38.196 +			this.Show();
  38.197 +			this.txtArmyName.Changed += new global::System.EventHandler(this.OnTextChanged);
  38.198 +			this.systemCombo.Changed += new global::System.EventHandler(this.OnSystemComboChanged);
  38.199 +			this.sbPointsValue.ChangeValue += new global::Gtk.ChangeValueHandler(this.OnSpinChangeValue);
  38.200 +			this.sbPointsValue.ValueChanged += new global::System.EventHandler(this.OnSpinValueChanged);
  38.201 +			this.sbPointsValue.Changed += new global::System.EventHandler(this.OnSpinValueChanged);
  38.202 +			this.bttnCancel.Clicked += new global::System.EventHandler(this.OnCancelClicked);
  38.203 +			this.bttnCreate.Clicked += new global::System.EventHandler(this.OnCreateClicked);
  38.204 +		}
  38.205 +	}
  38.206 +}
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs	Mon Jan 17 19:43:47 2011 +0000
    39.3 @@ -0,0 +1,122 @@
    39.4 +
    39.5 +// This file has been generated by the GUI designer. Do not modify.
    39.6 +namespace IBBoard.WarFoundry.GUI.GTK
    39.7 +{
    39.8 +	public partial class FrmNewUnit
    39.9 +	{
   39.10 +		private global::Gtk.VBox vbox2;
   39.11 +		private global::Gtk.HBox hbox1;
   39.12 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblUnitList;
   39.13 +		private global::Gtk.ScrolledWindow GtkScrolledWindow;
   39.14 +		private global::Gtk.TreeView lstUnitTypes;
   39.15 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblNewUnitWarning;
   39.16 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
   39.17 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCreate;
   39.18 +
   39.19 +		protected virtual void Build()
   39.20 +		{
   39.21 +			global::Stetic.Gui.Initialize(this);
   39.22 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmNewUnit
   39.23 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmNewUnit";
   39.24 +			this.Title = global::Mono.Unix.Catalog.GetString("Add new unit");
   39.25 +			this.Icon = global::Stetic.IconLoader.LoadIcon(this, "gtk-new", global::Gtk.IconSize.Menu);
   39.26 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   39.27 +			this.Modal = true;
   39.28 +			this.SkipPagerHint = true;
   39.29 +			this.SkipTaskbarHint = true;
   39.30 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.VBox
   39.31 +			global::Gtk.VBox w1 = this.VBox;
   39.32 +			w1.Name = "dialog1_VBox";
   39.33 +			w1.BorderWidth = ((uint)(2));
   39.34 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   39.35 +			this.vbox2 = new global::Gtk.VBox();
   39.36 +			this.vbox2.Name = "vbox2";
   39.37 +			this.vbox2.Spacing = 6;
   39.38 +			// Container child vbox2.Gtk.Box+BoxChild
   39.39 +			this.hbox1 = new global::Gtk.HBox();
   39.40 +			this.hbox1.Name = "hbox1";
   39.41 +			this.hbox1.Spacing = 6;
   39.42 +			// Container child hbox1.Gtk.Box+BoxChild
   39.43 +			this.lblUnitList = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   39.44 +			this.lblUnitList.Name = "lblUnitList";
   39.45 +			this.lblUnitList.LabelProp = global::Mono.Unix.Catalog.GetString("unit type");
   39.46 +			this.hbox1.Add(this.lblUnitList);
   39.47 +			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.lblUnitList]));
   39.48 +			w2.Position = 0;
   39.49 +			w2.Expand = false;
   39.50 +			w2.Fill = false;
   39.51 +			// Container child hbox1.Gtk.Box+BoxChild
   39.52 +			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
   39.53 +			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
   39.54 +			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
   39.55 +			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
   39.56 +			this.lstUnitTypes = new global::Gtk.TreeView();
   39.57 +			this.lstUnitTypes.HeightRequest = 150;
   39.58 +			this.lstUnitTypes.CanFocus = true;
   39.59 +			this.lstUnitTypes.Name = "lstUnitTypes";
   39.60 +			this.lstUnitTypes.HeadersVisible = false;
   39.61 +			this.GtkScrolledWindow.Add(this.lstUnitTypes);
   39.62 +			this.hbox1.Add(this.GtkScrolledWindow);
   39.63 +			global::Gtk.Box.BoxChild w4 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.GtkScrolledWindow]));
   39.64 +			w4.Position = 1;
   39.65 +			this.vbox2.Add(this.hbox1);
   39.66 +			global::Gtk.Box.BoxChild w5 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hbox1]));
   39.67 +			w5.Position = 0;
   39.68 +			w5.Expand = false;
   39.69 +			w5.Fill = false;
   39.70 +			// Container child vbox2.Gtk.Box+BoxChild
   39.71 +			this.lblNewUnitWarning = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   39.72 +			this.lblNewUnitWarning.Name = "lblNewUnitWarning";
   39.73 +			this.vbox2.Add(this.lblNewUnitWarning);
   39.74 +			global::Gtk.Box.BoxChild w6 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.lblNewUnitWarning]));
   39.75 +			w6.Position = 1;
   39.76 +			w6.Expand = false;
   39.77 +			w6.Fill = false;
   39.78 +			w1.Add(this.vbox2);
   39.79 +			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(w1[this.vbox2]));
   39.80 +			w7.Position = 0;
   39.81 +			w7.Expand = false;
   39.82 +			w7.Fill = false;
   39.83 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.ActionArea
   39.84 +			global::Gtk.HButtonBox w8 = this.ActionArea;
   39.85 +			w8.Name = "dialog1_ActionArea";
   39.86 +			w8.Spacing = 6;
   39.87 +			w8.BorderWidth = ((uint)(5));
   39.88 +			w8.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
   39.89 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
   39.90 +			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
   39.91 +			this.bttnCancel.CanFocus = true;
   39.92 +			this.bttnCancel.Name = "bttnCancel";
   39.93 +			this.bttnCancel.UseStock = true;
   39.94 +			this.bttnCancel.UseUnderline = true;
   39.95 +			this.bttnCancel.Label = "gtk-cancel";
   39.96 +			this.AddActionWidget(this.bttnCancel, -6);
   39.97 +			global::Gtk.ButtonBox.ButtonBoxChild w9 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8[this.bttnCancel]));
   39.98 +			w9.Expand = false;
   39.99 +			w9.Fill = false;
  39.100 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  39.101 +			this.bttnCreate = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  39.102 +			this.bttnCreate.CanFocus = true;
  39.103 +			this.bttnCreate.Name = "bttnCreate";
  39.104 +			this.bttnCreate.UseStock = true;
  39.105 +			this.bttnCreate.UseUnderline = true;
  39.106 +			this.bttnCreate.Label = "gtk-ok";
  39.107 +			this.AddActionWidget(this.bttnCreate, -5);
  39.108 +			global::Gtk.ButtonBox.ButtonBoxChild w10 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w8[this.bttnCreate]));
  39.109 +			w10.Position = 1;
  39.110 +			w10.Expand = false;
  39.111 +			w10.Fill = false;
  39.112 +			if ((this.Child != null))
  39.113 +			{
  39.114 +				this.Child.ShowAll();
  39.115 +			}
  39.116 +			this.DefaultWidth = 403;
  39.117 +			this.DefaultHeight = 259;
  39.118 +			this.lblNewUnitWarning.Hide();
  39.119 +			this.Show();
  39.120 +			this.lstUnitTypes.RowActivated += new global::Gtk.RowActivatedHandler(this.OnRowActivated);
  39.121 +			this.bttnCancel.Clicked += new global::System.EventHandler(this.OnButtonCancelActivated);
  39.122 +			this.bttnCreate.Clicked += new global::System.EventHandler(this.OnButtonOkClicked);
  39.123 +		}
  39.124 +	}
  39.125 +}
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmPreferences.cs	Mon Jan 17 19:43:47 2011 +0000
    40.3 @@ -0,0 +1,135 @@
    40.4 +
    40.5 +// This file has been generated by the GUI designer. Do not modify.
    40.6 +namespace IBBoard.WarFoundry.GUI.GTK
    40.7 +{
    40.8 +	public partial class FrmPreferences
    40.9 +	{
   40.10 +		private global::Gtk.HPaned hpaned1;
   40.11 +		private global::Gtk.ScrolledWindow GtkScrolledWindow;
   40.12 +		private global::Gtk.TreeView preferencesTree;
   40.13 +		private global::Gtk.Frame prefsFrame;
   40.14 +		private global::Gtk.Alignment GtkAlignment2;
   40.15 +		private global::Gtk.Table table1;
   40.16 +		private global::Gtk.ComboBox languageList;
   40.17 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblLanguage;
   40.18 +		private global::Gtk.Label frameLabel;
   40.19 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
   40.20 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnOkay;
   40.21 +
   40.22 +		protected virtual void Build()
   40.23 +		{
   40.24 +			global::Stetic.Gui.Initialize(this);
   40.25 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmPreferences
   40.26 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmPreferences";
   40.27 +			this.TypeHint = ((global::Gdk.WindowTypeHint)(1));
   40.28 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   40.29 +			this.SkipPagerHint = true;
   40.30 +			this.SkipTaskbarHint = true;
   40.31 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmPreferences.VBox
   40.32 +			global::Gtk.VBox w1 = this.VBox;
   40.33 +			w1.Name = "dialog1_VBox";
   40.34 +			w1.BorderWidth = ((uint)(2));
   40.35 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   40.36 +			this.hpaned1 = new global::Gtk.HPaned();
   40.37 +			this.hpaned1.CanFocus = true;
   40.38 +			this.hpaned1.Name = "hpaned1";
   40.39 +			this.hpaned1.Position = 164;
   40.40 +			// Container child hpaned1.Gtk.Paned+PanedChild
   40.41 +			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
   40.42 +			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
   40.43 +			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
   40.44 +			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
   40.45 +			this.preferencesTree = new global::Gtk.TreeView();
   40.46 +			this.preferencesTree.CanFocus = true;
   40.47 +			this.preferencesTree.Name = "preferencesTree";
   40.48 +			this.preferencesTree.HeadersVisible = false;
   40.49 +			this.GtkScrolledWindow.Add(this.preferencesTree);
   40.50 +			this.hpaned1.Add(this.GtkScrolledWindow);
   40.51 +			global::Gtk.Paned.PanedChild w3 = ((global::Gtk.Paned.PanedChild)(this.hpaned1[this.GtkScrolledWindow]));
   40.52 +			w3.Resize = false;
   40.53 +			// Container child hpaned1.Gtk.Paned+PanedChild
   40.54 +			this.prefsFrame = new global::Gtk.Frame();
   40.55 +			this.prefsFrame.Name = "prefsFrame";
   40.56 +			this.prefsFrame.ShadowType = ((global::Gtk.ShadowType)(1));
   40.57 +			this.prefsFrame.BorderWidth = ((uint)(2));
   40.58 +			// Container child prefsFrame.Gtk.Container+ContainerChild
   40.59 +			this.GtkAlignment2 = new global::Gtk.Alignment(0F, 0F, 1F, 1F);
   40.60 +			this.GtkAlignment2.Name = "GtkAlignment2";
   40.61 +			this.GtkAlignment2.LeftPadding = ((uint)(12));
   40.62 +			// Container child GtkAlignment2.Gtk.Container+ContainerChild
   40.63 +			this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false);
   40.64 +			this.table1.Name = "table1";
   40.65 +			this.table1.RowSpacing = ((uint)(6));
   40.66 +			this.table1.ColumnSpacing = ((uint)(6));
   40.67 +			// Container child table1.Gtk.Table+TableChild
   40.68 +			this.languageList = global::Gtk.ComboBox.NewText();
   40.69 +			this.languageList.Name = "languageList";
   40.70 +			this.table1.Add(this.languageList);
   40.71 +			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table1[this.languageList]));
   40.72 +			w4.LeftAttach = ((uint)(1));
   40.73 +			w4.RightAttach = ((uint)(2));
   40.74 +			w4.XOptions = ((global::Gtk.AttachOptions)(4));
   40.75 +			w4.YOptions = ((global::Gtk.AttachOptions)(4));
   40.76 +			// Container child table1.Gtk.Table+TableChild
   40.77 +			this.lblLanguage = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   40.78 +			this.lblLanguage.Name = "lblLanguage";
   40.79 +			this.lblLanguage.LabelProp = global::Mono.Unix.Catalog.GetString("language:");
   40.80 +			this.table1.Add(this.lblLanguage);
   40.81 +			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table1[this.lblLanguage]));
   40.82 +			w5.XOptions = ((global::Gtk.AttachOptions)(4));
   40.83 +			w5.YOptions = ((global::Gtk.AttachOptions)(4));
   40.84 +			this.GtkAlignment2.Add(this.table1);
   40.85 +			this.prefsFrame.Add(this.GtkAlignment2);
   40.86 +			this.frameLabel = new global::Gtk.Label();
   40.87 +			this.frameLabel.Name = "frameLabel";
   40.88 +			this.frameLabel.LabelProp = global::Mono.Unix.Catalog.GetString("<b>language</b>");
   40.89 +			this.frameLabel.UseMarkup = true;
   40.90 +			this.prefsFrame.LabelWidget = this.frameLabel;
   40.91 +			this.hpaned1.Add(this.prefsFrame);
   40.92 +			w1.Add(this.hpaned1);
   40.93 +			global::Gtk.Box.BoxChild w9 = ((global::Gtk.Box.BoxChild)(w1[this.hpaned1]));
   40.94 +			w9.Position = 0;
   40.95 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmPreferences.ActionArea
   40.96 +			global::Gtk.HButtonBox w10 = this.ActionArea;
   40.97 +			w10.Name = "dialog1_ActionArea";
   40.98 +			w10.Spacing = 10;
   40.99 +			w10.BorderWidth = ((uint)(5));
  40.100 +			w10.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
  40.101 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  40.102 +			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  40.103 +			this.bttnCancel.CanDefault = true;
  40.104 +			this.bttnCancel.CanFocus = true;
  40.105 +			this.bttnCancel.Name = "bttnCancel";
  40.106 +			this.bttnCancel.UseStock = true;
  40.107 +			this.bttnCancel.UseUnderline = true;
  40.108 +			this.bttnCancel.Label = "gtk-cancel";
  40.109 +			this.AddActionWidget(this.bttnCancel, -6);
  40.110 +			global::Gtk.ButtonBox.ButtonBoxChild w11 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10[this.bttnCancel]));
  40.111 +			w11.Expand = false;
  40.112 +			w11.Fill = false;
  40.113 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  40.114 +			this.bttnOkay = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  40.115 +			this.bttnOkay.CanDefault = true;
  40.116 +			this.bttnOkay.CanFocus = true;
  40.117 +			this.bttnOkay.Name = "bttnOkay";
  40.118 +			this.bttnOkay.UseStock = true;
  40.119 +			this.bttnOkay.UseUnderline = true;
  40.120 +			this.bttnOkay.Label = "gtk-ok";
  40.121 +			this.AddActionWidget(this.bttnOkay, -5);
  40.122 +			global::Gtk.ButtonBox.ButtonBoxChild w12 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w10[this.bttnOkay]));
  40.123 +			w12.Position = 1;
  40.124 +			w12.Expand = false;
  40.125 +			w12.Fill = false;
  40.126 +			if ((this.Child != null))
  40.127 +			{
  40.128 +				this.Child.ShowAll();
  40.129 +			}
  40.130 +			this.DefaultWidth = 400;
  40.131 +			this.DefaultHeight = 300;
  40.132 +			this.Show();
  40.133 +			this.languageList.Changed += new global::System.EventHandler(this.languageListChanged);
  40.134 +			this.bttnCancel.Clicked += new global::System.EventHandler(this.bttnCancelClicked);
  40.135 +			this.bttnOkay.Clicked += new global::System.EventHandler(this.bttnOkayClicked);
  40.136 +		}
  40.137 +	}
  40.138 +}
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment.cs	Mon Jan 17 19:43:47 2011 +0000
    41.3 @@ -0,0 +1,236 @@
    41.4 +
    41.5 +// This file has been generated by the GUI designer. Do not modify.
    41.6 +namespace IBBoard.WarFoundry.GUI.GTK
    41.7 +{
    41.8 +	public partial class FrmReplaceEquipment
    41.9 +	{
   41.10 +		private global::Gtk.Table table1;
   41.11 +		private global::Gtk.ScrolledWindow GtkScrolledWindow;
   41.12 +		private global::Gtk.TreeView lstEquipment;
   41.13 +		private global::Gtk.HBox hbox2;
   41.14 +		private global::Gtk.Table table2;
   41.15 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblEquipAll;
   41.16 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblPercent;
   41.17 +		private global::Gtk.SpinButton numericAmount;
   41.18 +		private global::Gtk.SpinButton percentageAmount;
   41.19 +		private global::Gtk.RadioButton rbEquipAll;
   41.20 +		private global::Gtk.RadioButton rbEquipNumeric;
   41.21 +		private global::Gtk.RadioButton rbEquipPercent;
   41.22 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblAmount;
   41.23 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblItem;
   41.24 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
   41.25 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnOkay;
   41.26 +
   41.27 +		protected virtual void Build()
   41.28 +		{
   41.29 +			global::Stetic.Gui.Initialize(this);
   41.30 +			// Widget IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment
   41.31 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment";
   41.32 +			this.Title = global::Mono.Unix.Catalog.GetString("Add equipment");
   41.33 +			this.WindowPosition = ((global::Gtk.WindowPosition)(4));
   41.34 +			this.Modal = true;
   41.35 +			this.SkipPagerHint = true;
   41.36 +			this.SkipTaskbarHint = true;
   41.37 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment.VBox
   41.38 +			global::Gtk.VBox w1 = this.VBox;
   41.39 +			w1.Name = "dialog1_VBox";
   41.40 +			w1.BorderWidth = ((uint)(2));
   41.41 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
   41.42 +			this.table1 = new global::Gtk.Table(((uint)(2)), ((uint)(2)), false);
   41.43 +			this.table1.Name = "table1";
   41.44 +			this.table1.RowSpacing = ((uint)(6));
   41.45 +			this.table1.ColumnSpacing = ((uint)(6));
   41.46 +			// Container child table1.Gtk.Table+TableChild
   41.47 +			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
   41.48 +			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
   41.49 +			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
   41.50 +			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
   41.51 +			this.lstEquipment = new global::Gtk.TreeView();
   41.52 +			this.lstEquipment.CanFocus = true;
   41.53 +			this.lstEquipment.Name = "lstEquipment";
   41.54 +			this.lstEquipment.HeadersVisible = false;
   41.55 +			this.GtkScrolledWindow.Add(this.lstEquipment);
   41.56 +			this.table1.Add(this.GtkScrolledWindow);
   41.57 +			global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow]));
   41.58 +			w3.LeftAttach = ((uint)(1));
   41.59 +			w3.RightAttach = ((uint)(2));
   41.60 +			w3.YOptions = ((global::Gtk.AttachOptions)(4));
   41.61 +			// Container child table1.Gtk.Table+TableChild
   41.62 +			this.hbox2 = new global::Gtk.HBox();
   41.63 +			this.hbox2.Name = "hbox2";
   41.64 +			this.hbox2.Spacing = 6;
   41.65 +			// Container child hbox2.Gtk.Box+BoxChild
   41.66 +			this.table2 = new global::Gtk.Table(((uint)(3)), ((uint)(3)), false);
   41.67 +			this.table2.Name = "table2";
   41.68 +			this.table2.RowSpacing = ((uint)(6));
   41.69 +			this.table2.ColumnSpacing = ((uint)(6));
   41.70 +			// Container child table2.Gtk.Table+TableChild
   41.71 +			this.lblEquipAll = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   41.72 +			this.lblEquipAll.Name = "lblEquipAll";
   41.73 +			this.lblEquipAll.LabelProp = global::Mono.Unix.Catalog.GetString("equip all");
   41.74 +			this.table2.Add(this.lblEquipAll);
   41.75 +			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2[this.lblEquipAll]));
   41.76 +			w4.TopAttach = ((uint)(2));
   41.77 +			w4.BottomAttach = ((uint)(3));
   41.78 +			w4.LeftAttach = ((uint)(1));
   41.79 +			w4.RightAttach = ((uint)(2));
   41.80 +			w4.YOptions = ((global::Gtk.AttachOptions)(4));
   41.81 +			// Container child table2.Gtk.Table+TableChild
   41.82 +			this.lblPercent = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
   41.83 +			this.lblPercent.Name = "lblPercent";
   41.84 +			this.lblPercent.LabelProp = global::Mono.Unix.Catalog.GetString("%");
   41.85 +			this.table2.Add(this.lblPercent);
   41.86 +			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2[this.lblPercent]));
   41.87 +			w5.TopAttach = ((uint)(1));
   41.88 +			w5.BottomAttach = ((uint)(2));
   41.89 +			w5.LeftAttach = ((uint)(2));
   41.90 +			w5.RightAttach = ((uint)(3));
   41.91 +			w5.XOptions = ((global::Gtk.AttachOptions)(4));
   41.92 +			w5.YOptions = ((global::Gtk.AttachOptions)(4));
   41.93 +			// Container child table2.Gtk.Table+TableChild
   41.94 +			this.numericAmount = new global::Gtk.SpinButton(0, 100, 1);
   41.95 +			this.numericAmount.CanFocus = true;
   41.96 +			this.numericAmount.Name = "numericAmount";
   41.97 +			this.numericAmount.Adjustment.PageIncrement = 10;
   41.98 +			this.numericAmount.ClimbRate = 1;
   41.99 +			this.numericAmount.Numeric = true;
  41.100 +			this.table2.Add(this.numericAmount);
  41.101 +			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2[this.numericAmount]));
  41.102 +			w6.LeftAttach = ((uint)(1));
  41.103 +			w6.RightAttach = ((uint)(2));
  41.104 +			w6.XOptions = ((global::Gtk.AttachOptions)(0));
  41.105 +			w6.YOptions = ((global::Gtk.AttachOptions)(4));
  41.106 +			// Container child table2.Gtk.Table+TableChild
  41.107 +			this.percentageAmount = new global::Gtk.SpinButton(0, 100, 1);
  41.108 +			this.percentageAmount.CanFocus = true;
  41.109 +			this.percentageAmount.Name = "percentageAmount";
  41.110 +			this.percentageAmount.Adjustment.PageIncrement = 10;
  41.111 +			this.percentageAmount.ClimbRate = 1;
  41.112 +			this.percentageAmount.Digits = ((uint)(1));
  41.113 +			this.percentageAmount.Numeric = true;
  41.114 +			this.table2.Add(this.percentageAmount);
  41.115 +			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2[this.percentageAmount]));
  41.116 +			w7.TopAttach = ((uint)(1));
  41.117 +			w7.BottomAttach = ((uint)(2));
  41.118 +			w7.LeftAttach = ((uint)(1));
  41.119 +			w7.RightAttach = ((uint)(2));
  41.120 +			w7.XOptions = ((global::Gtk.AttachOptions)(0));
  41.121 +			w7.YOptions = ((global::Gtk.AttachOptions)(4));
  41.122 +			// Container child table2.Gtk.Table+TableChild
  41.123 +			this.rbEquipAll = new global::Gtk.RadioButton("");
  41.124 +			this.rbEquipAll.CanFocus = true;
  41.125 +			this.rbEquipAll.Name = "rbEquipAll";
  41.126 +			this.rbEquipAll.DrawIndicator = true;
  41.127 +			this.rbEquipAll.UseUnderline = true;
  41.128 +			this.rbEquipAll.Group = new global::GLib.SList(global::System.IntPtr.Zero);
  41.129 +			this.table2.Add(this.rbEquipAll);
  41.130 +			global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipAll]));
  41.131 +			w8.TopAttach = ((uint)(2));
  41.132 +			w8.BottomAttach = ((uint)(3));
  41.133 +			w8.XOptions = ((global::Gtk.AttachOptions)(4));
  41.134 +			w8.YOptions = ((global::Gtk.AttachOptions)(4));
  41.135 +			// Container child table2.Gtk.Table+TableChild
  41.136 +			this.rbEquipNumeric = new global::Gtk.RadioButton("");
  41.137 +			this.rbEquipNumeric.CanFocus = true;
  41.138 +			this.rbEquipNumeric.Name = "rbEquipNumeric";
  41.139 +			this.rbEquipNumeric.DrawIndicator = true;
  41.140 +			this.rbEquipNumeric.UseUnderline = true;
  41.141 +			this.rbEquipNumeric.Group = this.rbEquipAll.Group;
  41.142 +			this.table2.Add(this.rbEquipNumeric);
  41.143 +			global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipNumeric]));
  41.144 +			w9.XOptions = ((global::Gtk.AttachOptions)(4));
  41.145 +			w9.YOptions = ((global::Gtk.AttachOptions)(4));
  41.146 +			// Container child table2.Gtk.Table+TableChild
  41.147 +			this.rbEquipPercent = new global::Gtk.RadioButton("");
  41.148 +			this.rbEquipPercent.CanFocus = true;
  41.149 +			this.rbEquipPercent.Name = "rbEquipPercent";
  41.150 +			this.rbEquipPercent.DrawIndicator = true;
  41.151 +			this.rbEquipPercent.UseUnderline = true;
  41.152 +			this.rbEquipPercent.Group = this.rbEquipAll.Group;
  41.153 +			this.table2.Add(this.rbEquipPercent);
  41.154 +			global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipPercent]));
  41.155 +			w10.TopAttach = ((uint)(1));
  41.156 +			w10.BottomAttach = ((uint)(2));
  41.157 +			w10.XOptions = ((global::Gtk.AttachOptions)(4));
  41.158 +			w10.YOptions = ((global::Gtk.AttachOptions)(4));
  41.159 +			this.hbox2.Add(this.table2);
  41.160 +			global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.table2]));
  41.161 +			w11.Position = 0;
  41.162 +			w11.Expand = false;
  41.163 +			w11.Fill = false;
  41.164 +			this.table1.Add(this.hbox2);
  41.165 +			global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.hbox2]));
  41.166 +			w12.TopAttach = ((uint)(1));
  41.167 +			w12.BottomAttach = ((uint)(2));
  41.168 +			w12.LeftAttach = ((uint)(1));
  41.169 +			w12.RightAttach = ((uint)(2));
  41.170 +			w12.YOptions = ((global::Gtk.AttachOptions)(4));
  41.171 +			// Container child table1.Gtk.Table+TableChild
  41.172 +			this.lblAmount = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  41.173 +			this.lblAmount.Name = "lblAmount";
  41.174 +			this.lblAmount.LabelProp = global::Mono.Unix.Catalog.GetString("amount:");
  41.175 +			this.table1.Add(this.lblAmount);
  41.176 +			global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.lblAmount]));
  41.177 +			w13.TopAttach = ((uint)(1));
  41.178 +			w13.BottomAttach = ((uint)(2));
  41.179 +			w13.XOptions = ((global::Gtk.AttachOptions)(4));
  41.180 +			w13.YOptions = ((global::Gtk.AttachOptions)(4));
  41.181 +			// Container child table1.Gtk.Table+TableChild
  41.182 +			this.lblItem = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  41.183 +			this.lblItem.Name = "lblItem";
  41.184 +			this.lblItem.LabelProp = global::Mono.Unix.Catalog.GetString("equipment");
  41.185 +			this.table1.Add(this.lblItem);
  41.186 +			global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.lblItem]));
  41.187 +			w14.XOptions = ((global::Gtk.AttachOptions)(4));
  41.188 +			w14.YOptions = ((global::Gtk.AttachOptions)(4));
  41.189 +			w1.Add(this.table1);
  41.190 +			global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(w1[this.table1]));
  41.191 +			w15.Position = 0;
  41.192 +			w15.Expand = false;
  41.193 +			w15.Fill = false;
  41.194 +			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment.ActionArea
  41.195 +			global::Gtk.HButtonBox w16 = this.ActionArea;
  41.196 +			w16.Name = "dialog1_ActionArea";
  41.197 +			w16.Spacing = 10;
  41.198 +			w16.BorderWidth = ((uint)(5));
  41.199 +			w16.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
  41.200 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  41.201 +			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  41.202 +			this.bttnCancel.CanDefault = true;
  41.203 +			this.bttnCancel.CanFocus = true;
  41.204 +			this.bttnCancel.Name = "bttnCancel";
  41.205 +			this.bttnCancel.UseStock = true;
  41.206 +			this.bttnCancel.UseUnderline = true;
  41.207 +			this.bttnCancel.Label = "gtk-cancel";
  41.208 +			this.AddActionWidget(this.bttnCancel, -6);
  41.209 +			global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.bttnCancel]));
  41.210 +			w17.Expand = false;
  41.211 +			w17.Fill = false;
  41.212 +			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
  41.213 +			this.bttnOkay = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  41.214 +			this.bttnOkay.CanDefault = true;
  41.215 +			this.bttnOkay.CanFocus = true;
  41.216 +			this.bttnOkay.Name = "bttnOkay";
  41.217 +			this.bttnOkay.UseStock = true;
  41.218 +			this.bttnOkay.UseUnderline = true;
  41.219 +			this.bttnOkay.Label = "gtk-ok";
  41.220 +			this.AddActionWidget(this.bttnOkay, -5);
  41.221 +			global::Gtk.ButtonBox.ButtonBoxChild w18 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.bttnOkay]));
  41.222 +			w18.Position = 1;
  41.223 +			w18.Expand = false;
  41.224 +			w18.Fill = false;
  41.225 +			if ((this.Child != null))
  41.226 +			{
  41.227 +				this.Child.ShowAll();
  41.228 +			}
  41.229 +			this.DefaultWidth = 400;
  41.230 +			this.DefaultHeight = 300;
  41.231 +			this.Show();
  41.232 +			this.rbEquipNumeric.Clicked += new global::System.EventHandler(this.RadioButtonClicked);
  41.233 +			this.percentageAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
  41.234 +			this.numericAmount.ValueChanged += new global::System.EventHandler(this.SpinButtonValueChanged);
  41.235 +			this.bttnCancel.Clicked += new global::System.EventHandler(this.CancelButtonClicked);
  41.236 +			this.bttnOkay.Clicked += new global::System.EventHandler(this.OkayButtonClicked);
  41.237 +		}
  41.238 +	}
  41.239 +}
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget.cs	Mon Jan 17 19:43:47 2011 +0000
    42.3 @@ -0,0 +1,262 @@
    42.4 +
    42.5 +// This file has been generated by the GUI designer. Do not modify.
    42.6 +namespace IBBoard.WarFoundry.GUI.GTK.Widgets
    42.7 +{
    42.8 +	public partial class UnitDisplayWidget
    42.9 +	{
   42.10 +		private global::Gtk.VBox vbox1;
   42.11 +		private global::Gtk.HBox hbox1;
   42.12 +		private global::Gtk.Entry unitName;
   42.13 +		private global::Gtk.SpinButton unitSize;
   42.14 +		private global::Gtk.ScrolledWindow statsScrollPanel;
   42.15 +		private global::Gtk.VBox statsRepeatBox;
   42.16 +		private global::Gtk.HSeparator hseparator1;
   42.17 +		private global::Gtk.HBox hbox2;
   42.18 +		private global::Gtk.Table table1;
   42.19 +		private global::Gtk.ScrolledWindow GtkScrolledWindow2;
   42.20 +		private global::Gtk.NodeView equipmentList;
   42.21 +		private global::Gtk.ScrolledWindow GtkScrolledWindow3;
   42.22 +		private global::Gtk.TextView notesView;
   42.23 +		private global::Gtk.ScrolledWindow GtkScrolledWindow4;
   42.24 +		private global::Gtk.NodeView abilitiesList;
   42.25 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblAbilities;
   42.26 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblEquip;
   42.27 +		private global::IBBoard.GtkSharp.Translatable.TranslatableLabel lblNotes;
   42.28 +		private global::Gtk.VBox vbox3;
   42.29 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnAddWeapon;
   42.30 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnEditWeapon;
   42.31 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnReplaceWeapon;
   42.32 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnRemoveWeapon;
   42.33 +
   42.34 +		protected virtual void Build()
   42.35 +		{
   42.36 +			global::Stetic.Gui.Initialize(this);
   42.37 +			// Widget IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget
   42.38 +			global::Stetic.BinContainer.Attach(this);
   42.39 +			this.Name = "IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget";
   42.40 +			// Container child IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget.Gtk.Container+ContainerChild
   42.41 +			this.vbox1 = new global::Gtk.VBox();
   42.42 +			this.vbox1.Name = "vbox1";
   42.43 +			this.vbox1.Spacing = 6;
   42.44 +			// Container child vbox1.Gtk.Box+BoxChild
   42.45 +			this.hbox1 = new global::Gtk.HBox();
   42.46 +			this.hbox1.Name = "hbox1";
   42.47 +			this.hbox1.Spacing = 6;
   42.48 +			// Container child hbox1.Gtk.Box+BoxChild
   42.49 +			this.unitName = new global::Gtk.Entry();
   42.50 +			this.unitName.CanFocus = true;
   42.51 +			this.unitName.Name = "unitName";
   42.52 +			this.unitName.IsEditable = true;
   42.53 +			this.unitName.InvisibleChar = '•';
   42.54 +			this.hbox1.Add(this.unitName);
   42.55 +			global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.unitName]));
   42.56 +			w1.Position = 0;
   42.57 +			// Container child hbox1.Gtk.Box+BoxChild
   42.58 +			this.unitSize = new global::Gtk.SpinButton(0, 100, 1);
   42.59 +			this.unitSize.CanFocus = true;
   42.60 +			this.unitSize.Name = "unitSize";
   42.61 +			this.unitSize.Adjustment.PageIncrement = 10;
   42.62 +			this.unitSize.ClimbRate = 1;
   42.63 +			this.unitSize.Numeric = true;
   42.64 +			this.hbox1.Add(this.unitSize);
   42.65 +			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.unitSize]));
   42.66 +			w2.Position = 1;
   42.67 +			w2.Expand = false;
   42.68 +			w2.Fill = false;
   42.69 +			this.vbox1.Add(this.hbox1);
   42.70 +			global::Gtk.Box.BoxChild w3 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox1]));
   42.71 +			w3.Position = 0;
   42.72 +			w3.Expand = false;
   42.73 +			w3.Fill = false;
   42.74 +			// Container child vbox1.Gtk.Box+BoxChild
   42.75 +			this.statsScrollPanel = new global::Gtk.ScrolledWindow();
   42.76 +			this.statsScrollPanel.CanFocus = true;
   42.77 +			this.statsScrollPanel.Name = "statsScrollPanel";
   42.78 +			this.statsScrollPanel.ShadowType = ((global::Gtk.ShadowType)(1));
   42.79 +			// Container child statsScrollPanel.Gtk.Container+ContainerChild
   42.80 +			global::Gtk.Viewport w4 = new global::Gtk.Viewport();
   42.81 +			w4.ShadowType = ((global::Gtk.ShadowType)(0));
   42.82 +			// Container child GtkViewport.Gtk.Container+ContainerChild
   42.83 +			this.statsRepeatBox = new global::Gtk.VBox();
   42.84 +			this.statsRepeatBox.Name = "statsRepeatBox";
   42.85 +			this.statsRepeatBox.Spacing = 6;
   42.86 +			w4.Add(this.statsRepeatBox);
   42.87 +			this.statsScrollPanel.Add(w4);
   42.88 +			this.vbox1.Add(this.statsScrollPanel);
   42.89 +			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.statsScrollPanel]));
   42.90 +			w7.Position = 1;
   42.91 +			// Container child vbox1.Gtk.Box+BoxChild
   42.92 +			this.hseparator1 = new global::Gtk.HSeparator();
   42.93 +			this.hseparator1.Name = "hseparator1";
   42.94 +			this.vbox1.Add(this.hseparator1);
   42.95 +			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hseparator1]));
   42.96 +			w8.Position = 2;
   42.97 +			w8.Expand = false;
   42.98 +			w8.Fill = false;
   42.99 +			// Container child vbox1.Gtk.Box+BoxChild
  42.100 +			this.hbox2 = new global::Gtk.HBox();
  42.101 +			this.hbox2.Name = "hbox2";
  42.102 +			this.hbox2.Spacing = 6;
  42.103 +			// Container child hbox2.Gtk.Box+BoxChild
  42.104 +			this.table1 = new global::Gtk.Table(((uint)(3)), ((uint)(2)), false);
  42.105 +			this.table1.Name = "table1";
  42.106 +			this.table1.RowSpacing = ((uint)(6));
  42.107 +			this.table1.ColumnSpacing = ((uint)(6));
  42.108 +			// Container child table1.Gtk.Table+TableChild
  42.109 +			this.GtkScrolledWindow2 = new global::Gtk.ScrolledWindow();
  42.110 +			this.GtkScrolledWindow2.Name = "GtkScrolledWindow2";
  42.111 +			this.GtkScrolledWindow2.ShadowType = ((global::Gtk.ShadowType)(1));
  42.112 +			// Container child GtkScrolledWindow2.Gtk.Container+ContainerChild
  42.113 +			this.equipmentList = new global::Gtk.NodeView();
  42.114 +			this.equipmentList.CanFocus = true;
  42.115 +			this.equipmentList.Name = "equipmentList";
  42.116 +			this.equipmentList.HeadersVisible = false;
  42.117 +			this.GtkScrolledWindow2.Add(this.equipmentList);
  42.118 +			this.table1.Add(this.GtkScrolledWindow2);
  42.119 +			global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow2]));
  42.120 +			w10.LeftAttach = ((uint)(1));
  42.121 +			w10.RightAttach = ((uint)(2));
  42.122 +			w10.YOptions = ((global::Gtk.AttachOptions)(4));
  42.123 +			// Container child table1.Gtk.Table+TableChild
  42.124 +			this.GtkScrolledWindow3 = new global::Gtk.ScrolledWindow();
  42.125 +			this.GtkScrolledWindow3.Name = "GtkScrolledWindow3";
  42.126 +			this.GtkScrolledWindow3.ShadowType = ((global::Gtk.ShadowType)(1));
  42.127 +			// Container child GtkScrolledWindow3.Gtk.Container+ContainerChild
  42.128 +			this.notesView = new global::Gtk.TextView();
  42.129 +			this.notesView.CanFocus = true;
  42.130 +			this.notesView.Name = "notesView";
  42.131 +			this.notesView.Editable = false;
  42.132 +			this.GtkScrolledWindow3.Add(this.notesView);
  42.133 +			this.table1.Add(this.GtkScrolledWindow3);
  42.134 +			global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow3]));
  42.135 +			w12.TopAttach = ((uint)(2));
  42.136 +			w12.BottomAttach = ((uint)(3));
  42.137 +			w12.LeftAttach = ((uint)(1));
  42.138 +			w12.RightAttach = ((uint)(2));
  42.139 +			w12.YOptions = ((global::Gtk.AttachOptions)(4));
  42.140 +			// Container child table1.Gtk.Table+TableChild
  42.141 +			this.GtkScrolledWindow4 = new global::Gtk.ScrolledWindow();
  42.142 +			this.GtkScrolledWindow4.Name = "GtkScrolledWindow4";
  42.143 +			this.GtkScrolledWindow4.ShadowType = ((global::Gtk.ShadowType)(1));
  42.144 +			// Container child GtkScrolledWindow4.Gtk.Container+ContainerChild
  42.145 +			this.abilitiesList = new global::Gtk.NodeView();
  42.146 +			this.abilitiesList.CanFocus = true;
  42.147 +			this.abilitiesList.Name = "abilitiesList";
  42.148 +			this.abilitiesList.HeadersVisible = false;
  42.149 +			this.GtkScrolledWindow4.Add(this.abilitiesList);
  42.150 +			this.table1.Add(this.GtkScrolledWindow4);
  42.151 +			global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow4]));
  42.152 +			w14.TopAttach = ((uint)(1));
  42.153 +			w14.BottomAttach = ((uint)(2));
  42.154 +			w14.LeftAttach = ((uint)(1));
  42.155 +			w14.RightAttach = ((uint)(2));
  42.156 +			w14.YOptions = ((global::Gtk.AttachOptions)(4));
  42.157 +			// Container child table1.Gtk.Table+TableChild
  42.158 +			this.lblAbilities = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  42.159 +			this.lblAbilities.Name = "lblAbilities";
  42.160 +			this.lblAbilities.LabelProp = global::Mono.Unix.Catalog.GetString("abilities:");
  42.161 +			this.table1.Add(this.lblAbilities);
  42.162 +			global::Gtk.Table.TableChild w15 = ((global::Gtk.Table.TableChild)(this.table1[this.lblAbilities]));
  42.163 +			w15.TopAttach = ((uint)(1));
  42.164 +			w15.BottomAttach = ((uint)(2));
  42.165 +			w15.XOptions = ((global::Gtk.AttachOptions)(4));
  42.166 +			w15.YOptions = ((global::Gtk.AttachOptions)(4));
  42.167 +			// Container child table1.Gtk.Table+TableChild
  42.168 +			this.lblEquip = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  42.169 +			this.lblEquip.Name = "lblEquip";
  42.170 +			this.lblEquip.LabelProp = global::Mono.Unix.Catalog.GetString("equipment:");
  42.171 +			this.table1.Add(this.lblEquip);
  42.172 +			global::Gtk.Table.TableChild w16 = ((global::Gtk.Table.TableChild)(this.table1[this.lblEquip]));
  42.173 +			w16.XOptions = ((global::Gtk.AttachOptions)(4));
  42.174 +			w16.YOptions = ((global::Gtk.AttachOptions)(4));
  42.175 +			// Container child table1.Gtk.Table+TableChild
  42.176 +			this.lblNotes = new global::IBBoard.GtkSharp.Translatable.TranslatableLabel();
  42.177 +			this.lblNotes.Name = "lblNotes";
  42.178 +			this.lblNotes.LabelProp = global::Mono.Unix.Catalog.GetString("notes:");
  42.179 +			this.table1.Add(this.lblNotes);
  42.180 +			global::Gtk.Table.TableChild w17 = ((global::Gtk.Table.TableChild)(this.table1[this.lblNotes]));
  42.181 +			w17.TopAttach = ((uint)(2));
  42.182 +			w17.BottomAttach = ((uint)(3));
  42.183 +			w17.XOptions = ((global::Gtk.AttachOptions)(4));
  42.184 +			w17.YOptions = ((global::Gtk.AttachOptions)(4));
  42.185 +			this.hbox2.Add(this.table1);
  42.186 +			global::Gtk.Box.BoxChild w18 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.table1]));
  42.187 +			w18.Position = 0;
  42.188 +			// Container child hbox2.Gtk.Box+BoxChild
  42.189 +			this.vbox3 = new global::Gtk.VBox();
  42.190 +			this.vbox3.Name = "vbox3";
  42.191 +			this.vbox3.Spacing = 6;
  42.192 +			// Container child vbox3.Gtk.Box+BoxChild
  42.193 +			this.bttnAddWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  42.194 +			this.bttnAddWeapon.CanFocus = true;
  42.195 +			this.bttnAddWeapon.Name = "bttnAddWeapon";
  42.196 +			this.bttnAddWeapon.UseUnderline = true;
  42.197 +			this.bttnAddWeapon.Label = global::Mono.Unix.Catalog.GetString("add");
  42.198 +			this.vbox3.Add(this.bttnAddWeapon);
  42.199 +			global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnAddWeapon]));
  42.200 +			w19.Position = 0;
  42.201 +			w19.Expand = false;
  42.202 +			w19.Fill = false;
  42.203 +			// Container child vbox3.Gtk.Box+BoxChild
  42.204 +			this.bttnEditWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  42.205 +			this.bttnEditWeapon.Sensitive = false;
  42.206 +			this.bttnEditWeapon.CanFocus = true;
  42.207 +			this.bttnEditWeapon.Name = "bttnEditWeapon";
  42.208 +			this.bttnEditWeapon.UseUnderline = true;
  42.209 +			this.bttnEditWeapon.Label = global::Mono.Unix.Catalog.GetString("edit");
  42.210 +			this.vbox3.Add(this.bttnEditWeapon);
  42.211 +			global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnEditWeapon]));
  42.212 +			w20.Position = 1;
  42.213 +			w20.Expand = false;
  42.214 +			w20.Fill = false;
  42.215 +			// Container child vbox3.Gtk.Box+BoxChild
  42.216 +			this.bttnReplaceWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  42.217 +			this.bttnReplaceWeapon.Sensitive = false;
  42.218 +			this.bttnReplaceWeapon.CanFocus = true;
  42.219 +			this.bttnReplaceWeapon.Name = "bttnReplaceWeapon";
  42.220 +			this.bttnReplaceWeapon.UseUnderline = true;
  42.221 +			this.bttnReplaceWeapon.Label = global::Mono.Unix.Catalog.GetString("replace");
  42.222 +			this.vbox3.Add(this.bttnReplaceWeapon);
  42.223 +			global::Gtk.Box.BoxChild w21 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnReplaceWeapon]));
  42.224 +			w21.Position = 2;
  42.225 +			w21.Expand = false;
  42.226 +			w21.Fill = false;
  42.227 +			// Container child vbox3.Gtk.Box+BoxChild
  42.228 +			this.bttnRemoveWeapon = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
  42.229 +			this.bttnRemoveWeapon.Sensitive = false;
  42.230 +			this.bttnRemoveWeapon.CanFocus = true;
  42.231 +			this.bttnRemoveWeapon.Name = "bttnRemoveWeapon";
  42.232 +			this.bttnRemoveWeapon.UseUnderline = true;
  42.233 +			this.bttnRemoveWeapon.Label = global::Mono.Unix.Catalog.GetString("remove");
  42.234 +			this.vbox3.Add(this.bttnRemoveWeapon);
  42.235 +			global::Gtk.Box.BoxChild w22 = ((global::Gtk.Box.BoxChild)(this.vbox3[this.bttnRemoveWeapon]));
  42.236 +			w22.Position = 3;
  42.237 +			w22.Expand = false;
  42.238 +			w22.Fill = false;
  42.239 +			this.hbox2.Add(this.vbox3);
  42.240 +			global::Gtk.Box.BoxChild w23 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.vbox3]));
  42.241 +			w23.Position = 1;
  42.242 +			w23.Expand = false;
  42.243 +			w23.Fill = false;
  42.244 +			this.vbox1.Add(this.hbox2);
  42.245 +			global::Gtk.Box.BoxChild w24 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.hbox2]));
  42.246 +			w24.Position = 3;
  42.247 +			w24.Expand = false;
  42.248 +			w24.Fill = false;
  42.249 +			this.Add(this.vbox1);
  42.250 +			if ((this.Child != null))
  42.251 +			{
  42.252 +				this.Child.ShowAll();
  42.253 +			}
  42.254 +			this.Show();
  42.255 +			this.unitName.FocusOutEvent += new global::Gtk.FocusOutEventHandler(this.OnUnitNameFocusOut);
  42.256 +			this.unitName.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitNameKeyPress);
  42.257 +			this.unitSize.FocusOutEvent += new global::Gtk.FocusOutEventHandler(this.OnUnitSizeFocusOut);
  42.258 +			this.unitSize.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitSizeKeyPress);
  42.259 +			this.bttnAddWeapon.Clicked += new global::System.EventHandler(this.OnBttnAddEquipmentClicked);
  42.260 +			this.bttnEditWeapon.Clicked += new global::System.EventHandler(this.HandleEditButtonClicked);
  42.261 +			this.bttnReplaceWeapon.Clicked += new global::System.EventHandler(this.HandleReplaceButtonClicked);
  42.262 +			this.bttnRemoveWeapon.Clicked += new global::System.EventHandler(this.HandleRemoveButtonActivated);
  42.263 +		}
  42.264 +	}
  42.265 +}
    43.1 --- a/gtk-gui/generated.cs	Sun Jan 31 20:46:06 2010 +0000
    43.2 +++ b/gtk-gui/generated.cs	Mon Jan 17 19:43:47 2011 +0000
    43.3 @@ -1,115 +1,129 @@
    43.4 -// ------------------------------------------------------------------------------
    43.5 -//  <autogenerated>
    43.6 -//      This code was generated by a tool.
    43.7 -//      
    43.8 -// 
    43.9 -//      Changes to this file may cause incorrect behavior and will be lost if 
   43.10 -//      the code is regenerated.
   43.11 -//  </autogenerated>
   43.12 -// ------------------------------------------------------------------------------
   43.13  
   43.14 -namespace Stetic {
   43.15 -    
   43.16 -    
   43.17 -    internal class Gui {
   43.18 -        
   43.19 -        private static bool initialized;
   43.20 -        
   43.21 -        internal static void Initialize(Gtk.Widget iconRenderer) {
   43.22 -            if ((Stetic.Gui.initialized == false)) {
   43.23 -                Stetic.Gui.initialized = true;
   43.24 -            }
   43.25 -        }
   43.26 -    }
   43.27 -    
   43.28 -    internal class IconLoader {
   43.29 -        
   43.30 -        public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size, int sz) {
   43.31 -            Gdk.Pixbuf res = widget.RenderIcon(name, size, null);
   43.32 -            if ((res != null)) {
   43.33 -                return res;
   43.34 -            }
   43.35 -            else {
   43.36 -                try {
   43.37 -                    return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);
   43.38 -                }
   43.39 -                catch (System.Exception ) {
   43.40 -                    if ((name != "gtk-missing-image")) {
   43.41 -                        return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size, sz);
   43.42 -                    }
   43.43 -                    else {
   43.44 -                        Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz);
   43.45 -                        Gdk.GC gc = new Gdk.GC(pmap);
   43.46 -                        gc.RgbFgColor = new Gdk.Color(255, 255, 255);
   43.47 -                        pmap.DrawRectangle(gc, true, 0, 0, sz, sz);
   43.48 -                        gc.RgbFgColor = new Gdk.Color(0, 0, 0);
   43.49 -                        pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1));
   43.50 -                        gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
   43.51 -                        gc.RgbFgColor = new Gdk.Color(255, 0, 0);
   43.52 -                        pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
   43.53 -                        pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
   43.54 -                        return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
   43.55 -                    }
   43.56 -                }
   43.57 -            }
   43.58 -        }
   43.59 -    }
   43.60 -    
   43.61 -    internal class BinContainer {
   43.62 -        
   43.63 -        private Gtk.Widget child;
   43.64 -        
   43.65 -        private Gtk.UIManager uimanager;
   43.66 -        
   43.67 -        public static BinContainer Attach(Gtk.Bin bin) {
   43.68 -            BinContainer bc = new BinContainer();
   43.69 -            bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
   43.70 -            bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
   43.71 -            bin.Added += new Gtk.AddedHandler(bc.OnAdded);
   43.72 -            return bc;
   43.73 -        }
   43.74 -        
   43.75 -        private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args) {
   43.76 -            if ((this.child != null)) {
   43.77 -                args.Requisition = this.child.SizeRequest();
   43.78 -            }
   43.79 -        }
   43.80 -        
   43.81 -        private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args) {
   43.82 -            if ((this.child != null)) {
   43.83 -                this.child.Allocation = args.Allocation;
   43.84 -            }
   43.85 -        }
   43.86 -        
   43.87 -        private void OnAdded(object sender, Gtk.AddedArgs args) {
   43.88 -            this.child = args.Widget;
   43.89 -        }
   43.90 -        
   43.91 -        public void SetUiManager(Gtk.UIManager uim) {
   43.92 -            this.uimanager = uim;
   43.93 -            this.child.Realized += new System.EventHandler(this.OnRealized);
   43.94 -        }
   43.95 -        
   43.96 -        private void OnRealized(object sender, System.EventArgs args) {
   43.97 -            if ((this.uimanager != null)) {
   43.98 -                Gtk.Widget w;
   43.99 -                w = this.child.Toplevel;
  43.100 -                if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w))) {
  43.101 -                    ((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
  43.102 -                    this.uimanager = null;
  43.103 -                }
  43.104 -            }
  43.105 -        }
  43.106 -    }
  43.107 -    
  43.108 -    internal class ActionGroups {
  43.109 -        
  43.110 -        public static Gtk.ActionGroup GetActionGroup(System.Type type) {
  43.111 -            return Stetic.ActionGroups.GetActionGroup(type.FullName);
  43.112 -        }
  43.113 -        
  43.114 -        public static Gtk.ActionGroup GetActionGroup(string name) {
  43.115 -            return null;
  43.116 -        }
  43.117 -    }
  43.118 +// This file has been generated by the GUI designer. Do not modify.
  43.119 +namespace Stetic
  43.120 +{
  43.121 +	internal class Gui
  43.122 +	{
  43.123 +		private static bool initialized;
  43.124 +
  43.125 +		internal static void Initialize(Gtk.Widget iconRenderer)
  43.126 +		{
  43.127 +			if ((Stetic.Gui.initialized == false))
  43.128 +			{
  43.129 +				Stetic.Gui.initialized = true;
  43.130 +			}
  43.131 +		}
  43.132 +	}
  43.133 +
  43.134 +	internal class IconLoader
  43.135 +	{
  43.136 +		public static Gdk.Pixbuf LoadIcon(Gtk.Widget widget, string name, Gtk.IconSize size)
  43.137 +		{
  43.138 +			Gdk.Pixbuf res = widget.RenderIcon(name, size, null);
  43.139 +			if ((res != null))
  43.140 +			{
  43.141 +				return res;
  43.142 +			}
  43.143 +			else
  43.144 +			{
  43.145 +				int sz;
  43.146 +				int sy;
  43.147 +				global::Gtk.Icon.SizeLookup(size, out  sz, out  sy);
  43.148 +				try
  43.149 +				{
  43.150 +					return Gtk.IconTheme.Default.LoadIcon(name, sz, 0);
  43.151 +				}
  43.152 +				catch (System.Exception)
  43.153 +				{
  43.154 +					if ((name != "gtk-missing-image"))
  43.155 +					{
  43.156 +						return Stetic.IconLoader.LoadIcon(widget, "gtk-missing-image", size);
  43.157 +					}
  43.158 +					else
  43.159 +					{
  43.160 +						Gdk.Pixmap pmap = new Gdk.Pixmap(Gdk.Screen.Default.RootWindow, sz, sz);
  43.161 +						Gdk.GC gc = new Gdk.GC(pmap);
  43.162 +						gc.RgbFgColor = new Gdk.Color(255, 255, 255);
  43.163 +						pmap.DrawRectangle(gc, true, 0, 0, sz, sz);
  43.164 +						gc.RgbFgColor = new Gdk.Color(0, 0, 0);
  43.165 +						pmap.DrawRectangle(gc, false, 0, 0, (sz - 1), (sz - 1));
  43.166 +						gc.SetLineAttributes(3, Gdk.LineStyle.Solid, Gdk.CapStyle.Round, Gdk.JoinStyle.Round);
  43.167 +						gc.RgbFgColor = new Gdk.Color(255, 0, 0);
  43.168 +						pmap.DrawLine(gc, (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)), ((sz - 1) - (sz / 4)));
  43.169 +						pmap.DrawLine(gc, ((sz - 1) - (sz / 4)), (sz / 4), (sz / 4), ((sz - 1) - (sz / 4)));
  43.170 +						return Gdk.Pixbuf.FromDrawable(pmap, pmap.Colormap, 0, 0, 0, 0, sz, sz);
  43.171 +					}
  43.172 +				}
  43.173 +			}
  43.174 +		}
  43.175 +	}
  43.176 +
  43.177 +	internal class BinContainer
  43.178 +	{
  43.179 +		private Gtk.Widget child;
  43.180 +		private Gtk.UIManager uimanager;
  43.181 +
  43.182 +		public static BinContainer Attach(Gtk.Bin bin)
  43.183 +		{
  43.184 +			BinContainer bc = new BinContainer();
  43.185 +			bin.SizeRequested += new Gtk.SizeRequestedHandler(bc.OnSizeRequested);
  43.186 +			bin.SizeAllocated += new Gtk.SizeAllocatedHandler(bc.OnSizeAllocated);
  43.187 +			bin.Added += new Gtk.AddedHandler(bc.OnAdded);
  43.188 +			return bc;
  43.189 +		}
  43.190 +
  43.191 +		private void OnSizeRequested(object sender, Gtk.SizeRequestedArgs args)
  43.192 +		{
  43.193 +			if ((this.child != null))
  43.194 +			{
  43.195 +				args.Requisition = this.child.SizeRequest();
  43.196 +			}
  43.197 +		}
  43.198 +
  43.199 +		private void OnSizeAllocated(object sender, Gtk.SizeAllocatedArgs args)
  43.200 +		{
  43.201 +			if ((this.child != null))
  43.202 +			{
  43.203 +				this.child.Allocation = args.Allocation;
  43.204 +			}
  43.205 +		}
  43.206 +
  43.207 +		private void OnAdded(object sender, Gtk.AddedArgs args)
  43.208 +		{
  43.209 +			this.child = args.Widget;
  43.210 +		}
  43.211 +
  43.212 +		public void SetUiManager(Gtk.UIManager uim)
  43.213 +		{
  43.214 +			this.uimanager = uim;
  43.215 +			this.child.Realized += new System.EventHandler(this.OnRealized);
  43.216 +		}
  43.217 +
  43.218 +		private void OnRealized(object sender, System.EventArgs args)
  43.219 +		{
  43.220 +			if ((this.uimanager != null))
  43.221 +			{
  43.222 +				Gtk.Widget w;
  43.223 +				w = this.child.Toplevel;
  43.224 +				if (((w != null) && typeof(Gtk.Window).IsInstanceOfType(w)))
  43.225 +				{
  43.226 +					((Gtk.Window)(w)).AddAccelGroup(this.uimanager.AccelGroup);
  43.227 +					this.uimanager = null;
  43.228 +				}
  43.229 +			}
  43.230 +		}
  43.231 +	}
  43.232 +
  43.233 +	internal class ActionGroups
  43.234 +	{
  43.235 +		public static Gtk.ActionGroup GetActionGroup(System.Type type)
  43.236 +		{
  43.237 +			return Stetic.ActionGroups.GetActionGroup(type.FullName);
  43.238 +		}
  43.239 +
  43.240 +		public static Gtk.ActionGroup GetActionGroup(string name)
  43.241 +		{
  43.242 +			return null;
  43.243 +		}
  43.244 +	}
  43.245  }
    44.1 --- a/gtk-gui/gui.stetic	Sun Jan 31 20:46:06 2010 +0000
    44.2 +++ b/gtk-gui/gui.stetic	Mon Jan 17 19:43:47 2011 +0000
    44.3 @@ -5,17 +5,17 @@
    44.4      <target-gtk-version>2.12</target-gtk-version>
    44.5    </configuration>
    44.6    <import>
    44.7 -    <widget-library name="../../IBBoard.GtkSharp/bin/Debug/IBBoard.GtkSharp.dll" />
    44.8 -    <widget-library name="../bin/Debug/WarFoundryGTK.exe" internal="true" />
    44.9 +    <widget-library name="../../IBBoard.GtkSharp/bin/Release/IBBoard.GtkSharp.dll" />
   44.10 +    <widget-library name="../bin/Release/WarFoundry-GTK.exe" internal="true" />
   44.11    </import>
   44.12 -  <widget class="Gtk.Window" id="IBBoard.WarFoundry.GTK.FrmMainWindow" design-size="832 659">
   44.13 +  <widget class="Gtk.Window" id="IBBoard.WarFoundry.GUI.GTK.FrmMainWindow" design-size="832 659">
   44.14      <action-group name="Default">
   44.15        <action id="menuFile">
   44.16          <property name="Type">Action</property>
   44.17          <property name="Label" translatable="yes">File</property>
   44.18          <property name="ShortLabel" translatable="yes">File</property>
   44.19        </action>
   44.20 -      <action id="miCreateArmy">
   44.21 +      <action id="miNewArmy">
   44.22          <property name="Type">Action</property>
   44.23          <property name="Label" translatable="yes">Create army</property>
   44.24          <property name="ShortLabel" translatable="yes">Create army</property>
   44.25 @@ -56,7 +56,6 @@
   44.26        <action id="miReloadFiles">
   44.27          <property name="Type">Action</property>
   44.28          <property name="Label" translatable="yes">Reload files</property>
   44.29 -        <property name="Sensitive">False</property>
   44.30          <property name="ShortLabel" translatable="yes">Reload files</property>
   44.31          <property name="StockId">gtk-refresh</property>
   44.32          <signal name="Activated" handler="OnReloadFilesActivated" />
   44.33 @@ -97,39 +96,40 @@
   44.34          <property name="Label" translatable="yes">About</property>
   44.35          <property name="ShortLabel" translatable="yes">About</property>
   44.36          <property name="StockId">gtk-about</property>
   44.37 +        <signal name="Activated" handler="HelpAboutActivated" />
   44.38        </action>
   44.39        <action id="miDebugInformation">
   44.40          <property name="Type">Action</property>
   44.41          <property name="Label" translatable="yes">Debug Information</property>
   44.42          <property name="ShortLabel" translatable="yes">Debug Information</property>
   44.43        </action>
   44.44 -      <action id="newArmyButton">
   44.45 +      <action id="bttnNewArmy">
   44.46          <property name="Type">Action</property>
   44.47          <property name="Label" translatable="yes" />
   44.48          <property name="StockId">gtk-new</property>
   44.49          <signal name="Activated" handler="newTBButtonActivated" />
   44.50        </action>
   44.51 -      <action id="openArmyButton">
   44.52 +      <action id="bttnOpenArmy">
   44.53          <property name="Type">Action</property>
   44.54          <property name="Label" translatable="yes" />
   44.55          <property name="StockId">gtk-open</property>
   44.56          <signal name="Activated" handler="openTBButtonActivated" />
   44.57        </action>
   44.58 -      <action id="saveArmyButton">
   44.59 +      <action id="bttnSaveArmy">
   44.60          <property name="Type">Action</property>
   44.61          <property name="Label" translatable="yes" />
   44.62          <property name="Sensitive">False</property>
   44.63          <property name="StockId">gtk-save</property>
   44.64          <signal name="Activated" handler="saveTBButtonActivated" />
   44.65        </action>
   44.66 -      <action id="undoActionButton">
   44.67 +      <action id="bttnUndo">
   44.68          <property name="Type">Action</property>
   44.69          <property name="Label" translatable="yes" />
   44.70          <property name="Sensitive">False</property>
   44.71          <property name="StockId">gtk-undo</property>
   44.72          <signal name="Activated" handler="undoTBButtonActivated" />
   44.73        </action>
   44.74 -      <action id="redoActionButton">
   44.75 +      <action id="bttnRedo">
   44.76          <property name="Type">Action</property>
   44.77          <property name="Label" translatable="yes" />
   44.78          <property name="Sensitive">False</property>
   44.79 @@ -145,19 +145,26 @@
   44.80          <property name="Label" translatable="yes" />
   44.81          <property name="StockId">gtk-add</property>
   44.82        </action>
   44.83 -      <action id="miExportArmy">
   44.84 +      <action id="miExportArmyAs">
   44.85          <property name="Type">Action</property>
   44.86          <property name="Label" translatable="yes">Export army as...</property>
   44.87          <property name="Sensitive">False</property>
   44.88 -        <property name="ShortLabel" translatable="yes">Export army</property>
   44.89 +        <property name="ShortLabel" translatable="yes">Export army as...</property>
   44.90          <property name="StockId">gtk-convert</property>
   44.91        </action>
   44.92 -      <action id="miExportAsBasicHtml">
   44.93 +      <action id="miExportArmyAsBasicHTML">
   44.94          <property name="Type">Action</property>
   44.95          <property name="Label" translatable="yes">Basic HTML</property>
   44.96          <property name="ShortLabel" translatable="yes">Basic HTML</property>
   44.97          <signal name="Activated" handler="OnMiExportAsBasicHtmlActivated" />
   44.98        </action>
   44.99 +      <action id="miPreferences">
  44.100 +        <property name="Type">Action</property>
  44.101 +        <property name="Label" translatable="yes">preferences</property>
  44.102 +        <property name="ShortLabel" translatable="yes">preferences</property>
  44.103 +        <property name="StockId">gtk-preferences</property>
  44.104 +        <signal name="Activated" handler="miPreferencesClicked" />
  44.105 +      </action>
  44.106      </action-group>
  44.107      <property name="MemberName" />
  44.108      <property name="Title" translatable="yes">MainWindow</property>
  44.109 @@ -170,12 +177,12 @@
  44.110              <property name="MemberName" />
  44.111              <node name="menubar1" type="Menubar">
  44.112                <node type="Menu" action="menuFile">
  44.113 -                <node type="Menuitem" action="miCreateArmy" />
  44.114 +                <node type="Menuitem" action="miNewArmy" />
  44.115                  <node type="Menuitem" action="miOpenArmy" />
  44.116                  <node type="Menuitem" action="miSaveArmy" />
  44.117                  <node type="Menuitem" action="miSaveArmyAs" />
  44.118 -                <node type="Menu" action="miExportArmy">
  44.119 -                  <node type="Menuitem" action="miExportAsBasicHtml" />
  44.120 +                <node type="Menu" action="miExportArmyAs">
  44.121 +                  <node type="Menuitem" action="miExportArmyAsBasicHTML" />
  44.122                  </node>
  44.123                  <node type="Menuitem" action="miCloseArmy" />
  44.124                  <node type="Separator" />
  44.125 @@ -186,10 +193,11 @@
  44.126                <node type="Menu" action="menuEdit">
  44.127                  <node type="Menuitem" action="miUndo" />
  44.128                  <node type="Menuitem" action="miRedo" />
  44.129 +                <node type="Separator" />
  44.130 +                <node type="Menuitem" action="miPreferences" />
  44.131                </node>
  44.132                <node type="Menu" action="menuHelp">
  44.133                  <node type="Menuitem" action="miAbout" />
  44.134 -                <node type="Menuitem" action="miDebugInformation" />
  44.135                </node>
  44.136              </node>
  44.137            </widget>
  44.138 @@ -208,12 +216,12 @@
  44.139              <property name="ButtonStyle">Icons</property>
  44.140              <property name="IconSize">LargeToolbar</property>
  44.141              <node name="toolbar" type="Toolbar">
  44.142 -              <node type="Toolitem" action="newArmyButton" />
  44.143 -              <node type="Toolitem" action="openArmyButton" />
  44.144 -              <node type="Toolitem" action="saveArmyButton" />
  44.145 +              <node type="Toolitem" action="bttnNewArmy" />
  44.146 +              <node type="Toolitem" action="bttnOpenArmy" />
  44.147 +              <node type="Toolitem" action="bttnSaveArmy" />
  44.148                <node type="Separator" />
  44.149 -              <node type="Toolitem" action="undoActionButton" />
  44.150 -              <node type="Toolitem" action="redoActionButton" />
  44.151 +              <node type="Toolitem" action="bttnUndo" />
  44.152 +              <node type="Toolitem" action="bttnRedo" />
  44.153                <node type="Separator" />
  44.154              </node>
  44.155            </widget>
  44.156 @@ -227,6 +235,7 @@
  44.157          <child>
  44.158            <widget class="Gtk.HPaned" id="hpaned2">
  44.159              <property name="MemberName" />
  44.160 +            <property name="Visible">False</property>
  44.161              <property name="CanFocus">True</property>
  44.162              <property name="Position">178</property>
  44.163              <child>
  44.164 @@ -246,6 +255,8 @@
  44.165                  <property name="MemberName" />
  44.166                  <property name="CanFocus">True</property>
  44.167                  <property name="CurrentPage">-1</property>
  44.168 +                <property name="Scrollable">True</property>
  44.169 +                <signal name="Removed" handler="NotebookPageRemoved" />
  44.170                </widget>
  44.171              </child>
  44.172            </widget>
  44.173 @@ -262,7 +273,15 @@
  44.174                <placeholder />
  44.175              </child>
  44.176              <child>
  44.177 -              <placeholder />
  44.178 +              <widget class="Gtk.Label" id="lblTotalPoints">
  44.179 +                <property name="MemberName" />
  44.180 +              </widget>
  44.181 +              <packing>
  44.182 +                <property name="Position">2</property>
  44.183 +                <property name="AutoSize">True</property>
  44.184 +                <property name="Expand">False</property>
  44.185 +                <property name="Fill">False</property>
  44.186 +              </packing>
  44.187              </child>
  44.188            </widget>
  44.189            <packing>
  44.190 @@ -275,7 +294,7 @@
  44.191        </widget>
  44.192      </child>
  44.193    </widget>
  44.194 -  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GTK.FrmNewArmy" design-size="370 348">
  44.195 +  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmNewArmy" design-size="370 348">
  44.196      <property name="MemberName" />
  44.197      <property name="Events">ButtonPressMask</property>
  44.198      <property name="Title" translatable="yes">Create new army</property>
  44.199 @@ -375,28 +394,9 @@
  44.200                </packing>
  44.201              </child>
  44.202              <child>
  44.203 -              <widget class="Gtk.Label" id="label1">
  44.204 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblArmyName">
  44.205                  <property name="MemberName" />
  44.206 -                <property name="LabelProp" translatable="yes">Race</property>
  44.207 -              </widget>
  44.208 -              <packing>
  44.209 -                <property name="TopAttach">1</property>
  44.210 -                <property name="BottomAttach">2</property>
  44.211 -                <property name="AutoSize">True</property>
  44.212 -                <property name="XOptions">Fill</property>
  44.213 -                <property name="YOptions">Fill</property>
  44.214 -                <property name="XExpand">False</property>
  44.215 -                <property name="XFill">True</property>
  44.216 -                <property name="XShrink">False</property>
  44.217 -                <property name="YExpand">False</property>
  44.218 -                <property name="YFill">True</property>
  44.219 -                <property name="YShrink">False</property>
  44.220 -              </packing>
  44.221 -            </child>
  44.222 -            <child>
  44.223 -              <widget class="Gtk.Label" id="label2">
  44.224 -                <property name="MemberName" />
  44.225 -                <property name="LabelProp" translatable="yes">Army name</property>
  44.226 +                <property name="LabelProp" translatable="yes">army name</property>
  44.227                </widget>
  44.228                <packing>
  44.229                  <property name="TopAttach">2</property>
  44.230 @@ -413,9 +413,9 @@
  44.231                </packing>
  44.232              </child>
  44.233              <child>
  44.234 -              <widget class="Gtk.Label" id="label3">
  44.235 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblArmySize">
  44.236                  <property name="MemberName" />
  44.237 -                <property name="LabelProp" translatable="yes">Points value</property>
  44.238 +                <property name="LabelProp" translatable="yes">points value</property>
  44.239                </widget>
  44.240                <packing>
  44.241                  <property name="TopAttach">3</property>
  44.242 @@ -432,7 +432,7 @@
  44.243                </packing>
  44.244              </child>
  44.245              <child>
  44.246 -              <widget class="Gtk.Label" id="label4">
  44.247 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblGameSystem">
  44.248                  <property name="MemberName" />
  44.249                  <property name="LabelProp" translatable="yes">game system</property>
  44.250                </widget>
  44.251 @@ -449,6 +449,25 @@
  44.252                </packing>
  44.253              </child>
  44.254              <child>
  44.255 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblRaceList">
  44.256 +                <property name="MemberName" />
  44.257 +                <property name="LabelProp" translatable="yes">race</property>
  44.258 +              </widget>
  44.259 +              <packing>
  44.260 +                <property name="TopAttach">1</property>
  44.261 +                <property name="BottomAttach">2</property>
  44.262 +                <property name="AutoSize">True</property>
  44.263 +                <property name="XOptions">Fill</property>
  44.264 +                <property name="YOptions">Fill</property>
  44.265 +                <property name="XExpand">False</property>
  44.266 +                <property name="XFill">True</property>
  44.267 +                <property name="XShrink">False</property>
  44.268 +                <property name="YExpand">False</property>
  44.269 +                <property name="YFill">True</property>
  44.270 +                <property name="YShrink">False</property>
  44.271 +              </packing>
  44.272 +            </child>
  44.273 +            <child>
  44.274                <widget class="Gtk.ComboBoxEntry" id="systemCombo">
  44.275                  <property name="MemberName" />
  44.276                  <property name="IsTextCombo">True</property>
  44.277 @@ -513,7 +532,7 @@
  44.278          <property name="Size">2</property>
  44.279          <property name="LayoutStyle">End</property>
  44.280          <child>
  44.281 -          <widget class="Gtk.Button" id="bttnCancel">
  44.282 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCancel">
  44.283              <property name="MemberName" />
  44.284              <property name="CanFocus">True</property>
  44.285              <property name="UseStock">True</property>
  44.286 @@ -529,17 +548,17 @@
  44.287            </packing>
  44.288          </child>
  44.289          <child>
  44.290 -          <widget class="Gtk.Button" id="bttnCreate">
  44.291 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCreate">
  44.292              <property name="MemberName" />
  44.293              <property name="Sensitive">False</property>
  44.294              <property name="CanDefault">True</property>
  44.295              <property name="CanFocus">True</property>
  44.296 -            <property name="Type">TextAndIcon</property>
  44.297 -            <property name="Icon">stock:gtk-ok Menu</property>
  44.298 -            <property name="Label" translatable="yes">C_reate</property>
  44.299 -            <property name="UseUnderline">True</property>
  44.300 +            <property name="UseStock">True</property>
  44.301 +            <property name="Type">StockItem</property>
  44.302 +            <property name="StockId">gtk-ok</property>
  44.303              <property name="ResponseId">-5</property>
  44.304              <signal name="Clicked" handler="OnCreateClicked" />
  44.305 +            <property name="label">gtk-ok</property>
  44.306            </widget>
  44.307            <packing>
  44.308              <property name="Position">1</property>
  44.309 @@ -550,7 +569,7 @@
  44.310        </widget>
  44.311      </child>
  44.312    </widget>
  44.313 -  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GTK.FrmNewUnit" design-size="400 318">
  44.314 +  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmNewUnit" design-size="403 259">
  44.315      <property name="MemberName" />
  44.316      <property name="Title" translatable="yes">Add new unit</property>
  44.317      <property name="Icon">stock:gtk-new Menu</property>
  44.318 @@ -573,9 +592,9 @@
  44.319                  <property name="MemberName" />
  44.320                  <property name="Spacing">6</property>
  44.321                  <child>
  44.322 -                  <widget class="Gtk.Label" id="label1">
  44.323 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblUnitList">
  44.324                      <property name="MemberName" />
  44.325 -                    <property name="LabelProp" translatable="yes">Unit Type:</property>
  44.326 +                    <property name="LabelProp" translatable="yes">unit type</property>
  44.327                    </widget>
  44.328                    <packing>
  44.329                      <property name="Position">0</property>
  44.330 @@ -613,10 +632,9 @@
  44.331                </packing>
  44.332              </child>
  44.333              <child>
  44.334 -              <widget class="Gtk.Label" id="lblNewUnitWarning">
  44.335 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblNewUnitWarning">
  44.336                  <property name="MemberName" />
  44.337 -                <property name="Xalign">0</property>
  44.338 -                <property name="Yalign">0</property>
  44.339 +                <property name="Visible">False</property>
  44.340                </widget>
  44.341                <packing>
  44.342                  <property name="Position">1</property>
  44.343 @@ -643,15 +661,14 @@
  44.344          <property name="Size">2</property>
  44.345          <property name="LayoutStyle">End</property>
  44.346          <child>
  44.347 -          <widget class="Gtk.Button" id="buttonCancel">
  44.348 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCancel">
  44.349              <property name="MemberName" />
  44.350 -            <property name="CanDefault">True</property>
  44.351              <property name="CanFocus">True</property>
  44.352              <property name="UseStock">True</property>
  44.353              <property name="Type">StockItem</property>
  44.354              <property name="StockId">gtk-cancel</property>
  44.355              <property name="ResponseId">-6</property>
  44.356 -            <signal name="Activated" handler="OnButtonCancelActivated" />
  44.357 +            <signal name="Clicked" handler="OnButtonCancelActivated" />
  44.358              <property name="label">gtk-cancel</property>
  44.359            </widget>
  44.360            <packing>
  44.361 @@ -660,10 +677,8 @@
  44.362            </packing>
  44.363          </child>
  44.364          <child>
  44.365 -          <widget class="Gtk.Button" id="buttonOk">
  44.366 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCreate">
  44.367              <property name="MemberName" />
  44.368 -            <property name="Sensitive">False</property>
  44.369 -            <property name="CanDefault">True</property>
  44.370              <property name="CanFocus">True</property>
  44.371              <property name="UseStock">True</property>
  44.372              <property name="Type">StockItem</property>
  44.373 @@ -681,7 +696,7 @@
  44.374        </widget>
  44.375      </child>
  44.376    </widget>
  44.377 -  <widget class="Gtk.Bin" id="IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget" design-size="649 422">
  44.378 +  <widget class="Gtk.Bin" id="IBBoard.WarFoundry.GUI.GTK.Widgets.UnitDisplayWidget" design-size="649 458">
  44.379      <property name="MemberName" />
  44.380      <child>
  44.381        <widget class="Gtk.VBox" id="vbox1">
  44.382 @@ -733,15 +748,23 @@
  44.383            </packing>
  44.384          </child>
  44.385          <child>
  44.386 -          <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
  44.387 +          <widget class="Gtk.ScrolledWindow" id="statsScrollPanel">
  44.388              <property name="MemberName" />
  44.389 +            <property name="CanFocus">True</property>
  44.390              <property name="ShadowType">In</property>
  44.391              <child>
  44.392 -              <widget class="Gtk.NodeView" id="unitStats">
  44.393 +              <widget class="Gtk.Viewport" id="GtkViewport">
  44.394                  <property name="MemberName" />
  44.395 -                <property name="HeightRequest">75</property>
  44.396 -                <property name="CanFocus">True</property>
  44.397 -                <property name="ShowScrollbars">True</property>
  44.398 +                <property name="ShadowType">None</property>
  44.399 +                <child>
  44.400 +                  <widget class="Gtk.VBox" id="statsRepeatBox">
  44.401 +                    <property name="MemberName" />
  44.402 +                    <property name="Spacing">6</property>
  44.403 +                    <child>
  44.404 +                      <placeholder />
  44.405 +                    </child>
  44.406 +                  </widget>
  44.407 +                </child>
  44.408                </widget>
  44.409              </child>
  44.410            </widget>
  44.411 @@ -762,25 +785,498 @@
  44.412            </packing>
  44.413          </child>
  44.414          <child>
  44.415 +          <widget class="Gtk.HBox" id="hbox2">
  44.416 +            <property name="MemberName" />
  44.417 +            <property name="Spacing">6</property>
  44.418 +            <child>
  44.419 +              <widget class="Gtk.Table" id="table1">
  44.420 +                <property name="MemberName" />
  44.421 +                <property name="NRows">3</property>
  44.422 +                <property name="NColumns">2</property>
  44.423 +                <property name="RowSpacing">6</property>
  44.424 +                <property name="ColumnSpacing">6</property>
  44.425 +                <child>
  44.426 +                  <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow2">
  44.427 +                    <property name="MemberName" />
  44.428 +                    <property name="ShadowType">In</property>
  44.429 +                    <child>
  44.430 +                      <widget class="Gtk.NodeView" id="equipmentList">
  44.431 +                        <property name="MemberName" />
  44.432 +                        <property name="CanFocus">True</property>
  44.433 +                        <property name="ShowScrollbars">True</property>
  44.434 +                        <property name="HeadersVisible">False</property>
  44.435 +                      </widget>
  44.436 +                    </child>
  44.437 +                  </widget>
  44.438 +                  <packing>
  44.439 +                    <property name="LeftAttach">1</property>
  44.440 +                    <property name="RightAttach">2</property>
  44.441 +                    <property name="AutoSize">True</property>
  44.442 +                    <property name="YOptions">Fill</property>
  44.443 +                    <property name="XExpand">True</property>
  44.444 +                    <property name="XFill">True</property>
  44.445 +                    <property name="XShrink">False</property>
  44.446 +                    <property name="YExpand">False</property>
  44.447 +                    <property name="YFill">True</property>
  44.448 +                    <property name="YShrink">False</property>
  44.449 +                  </packing>
  44.450 +                </child>
  44.451 +                <child>
  44.452 +                  <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow3">
  44.453 +                    <property name="MemberName" />
  44.454 +                    <property name="ShadowType">In</property>
  44.455 +                    <child>
  44.456 +                      <widget class="Gtk.TextView" id="notesView">
  44.457 +                        <property name="MemberName" />
  44.458 +                        <property name="CanFocus">True</property>
  44.459 +                        <property name="ShowScrollbars">True</property>
  44.460 +                        <property name="Editable">False</property>
  44.461 +                        <property name="Text" translatable="yes" />
  44.462 +                      </widget>
  44.463 +                    </child>
  44.464 +                  </widget>
  44.465 +                  <packing>
  44.466 +                    <property name="TopAttach">2</property>
  44.467 +                    <property name="BottomAttach">3</property>
  44.468 +                    <property name="LeftAttach">1</property>
  44.469 +                    <property name="RightAttach">2</property>
  44.470 +                    <property name="AutoSize">True</property>
  44.471 +                    <property name="YOptions">Fill</property>
  44.472 +                    <property name="XExpand">True</property>
  44.473 +                    <property name="XFill">True</property>
  44.474 +                    <property name="XShrink">False</property>
  44.475 +                    <property name="YExpand">False</property>
  44.476 +                    <property name="YFill">True</property>
  44.477 +                    <property name="YShrink">False</property>
  44.478 +                  </packing>
  44.479 +                </child>
  44.480 +                <child>
  44.481 +                  <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow4">
  44.482 +                    <property name="MemberName" />
  44.483 +                    <property name="ShadowType">In</property>
  44.484 +                    <child>
  44.485 +                      <widget class="Gtk.NodeView" id="abilitiesList">
  44.486 +                        <property name="MemberName" />
  44.487 +                        <property name="CanFocus">True</property>
  44.488 +                        <property name="ShowScrollbars">True</property>
  44.489 +                        <property name="HeadersVisible">False</property>
  44.490 +                      </widget>
  44.491 +                    </child>
  44.492 +                  </widget>
  44.493 +                  <packing>
  44.494 +                    <property name="TopAttach">1</property>
  44.495 +                    <property name="BottomAttach">2</property>
  44.496 +                    <property name="LeftAttach">1</property>
  44.497 +                    <property name="RightAttach">2</property>
  44.498 +                    <property name="AutoSize">True</property>
  44.499 +                    <property name="YOptions">Fill</property>
  44.500 +                    <property name="XExpand">True</property>
  44.501 +                    <property name="XFill">True</property>
  44.502 +                    <property name="XShrink">False</property>
  44.503 +                    <property name="YExpand">False</property>
  44.504 +                    <property name="YFill">True</property>
  44.505 +                    <property name="YShrink">False</property>
  44.506 +                  </packing>
  44.507 +                </child>
  44.508 +                <child>
  44.509 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblAbilities">
  44.510 +                    <property name="MemberName" />
  44.511 +                    <property name="LabelProp" translatable="yes">abilities:</property>
  44.512 +                  </widget>
  44.513 +                  <packing>
  44.514 +                    <property name="TopAttach">1</property>
  44.515 +                    <property name="BottomAttach">2</property>
  44.516 +                    <property name="AutoSize">True</property>
  44.517 +                    <property name="XOptions">Fill</property>
  44.518 +                    <property name="YOptions">Fill</property>
  44.519 +                    <property name="XExpand">False</property>
  44.520 +                    <property name="XFill">True</property>
  44.521 +                    <property name="XShrink">False</property>
  44.522 +                    <property name="YExpand">False</property>
  44.523 +                    <property name="YFill">True</property>
  44.524 +                    <property name="YShrink">False</property>
  44.525 +                  </packing>
  44.526 +                </child>
  44.527 +                <child>
  44.528 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblEquip">
  44.529 +                    <property name="MemberName" />
  44.530 +                    <property name="LabelProp" translatable="yes">equipment:</property>
  44.531 +                  </widget>
  44.532 +                  <packing>
  44.533 +                    <property name="AutoSize">True</property>
  44.534 +                    <property name="XOptions">Fill</property>
  44.535 +                    <property name="YOptions">Fill</property>
  44.536 +                    <property name="XExpand">False</property>
  44.537 +                    <property name="XFill">True</property>
  44.538 +                    <property name="XShrink">False</property>
  44.539 +                    <property name="YExpand">False</property>
  44.540 +                    <property name="YFill">True</property>
  44.541 +                    <property name="YShrink">False</property>
  44.542 +                  </packing>
  44.543 +                </child>
  44.544 +                <child>
  44.545 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblNotes">
  44.546 +                    <property name="MemberName" />
  44.547 +                    <property name="LabelProp" translatable="yes">notes:</property>
  44.548 +                  </widget>
  44.549 +                  <packing>
  44.550 +                    <property name="TopAttach">2</property>
  44.551 +                    <property name="BottomAttach">3</property>
  44.552 +                    <property name="AutoSize">True</property>
  44.553 +                    <property name="XOptions">Fill</property>
  44.554 +                    <property name="YOptions">Fill</property>
  44.555 +                    <property name="XExpand">False</property>
  44.556 +                    <property name="XFill">True</property>
  44.557 +                    <property name="XShrink">False</property>
  44.558 +                    <property name="YExpand">False</property>
  44.559 +                    <property name="YFill">True</property>
  44.560 +                    <property name="YShrink">False</property>
  44.561 +                  </packing>
  44.562 +                </child>
  44.563 +              </widget>
  44.564 +              <packing>
  44.565 +                <property name="Position">0</property>
  44.566 +                <property name="AutoSize">True</property>
  44.567 +              </packing>
  44.568 +            </child>
  44.569 +            <child>
  44.570 +              <widget class="Gtk.VBox" id="vbox3">
  44.571 +                <property name="MemberName" />
  44.572 +                <property name="Spacing">6</property>
  44.573 +                <child>
  44.574 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnAddWeapon">
  44.575 +                    <property name="MemberName" />
  44.576 +                    <property name="CanFocus">True</property>
  44.577 +                    <property name="Type">TextOnly</property>
  44.578 +                    <property name="Label" translatable="yes">add</property>
  44.579 +                    <property name="UseUnderline">True</property>
  44.580 +                    <signal name="Clicked" handler="OnBttnAddEquipmentClicked" />
  44.581 +                  </widget>
  44.582 +                  <packing>
  44.583 +                    <property name="Position">0</property>
  44.584 +                    <property name="AutoSize">True</property>
  44.585 +                    <property name="Expand">False</property>
  44.586 +                    <property name="Fill">False</property>
  44.587 +                  </packing>
  44.588 +                </child>
  44.589 +                <child>
  44.590 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnEditWeapon">
  44.591 +                    <property name="MemberName" />
  44.592 +                    <property name="Sensitive">False</property>
  44.593 +                    <property name="CanFocus">True</property>
  44.594 +                    <property name="Type">TextOnly</property>
  44.595 +                    <property name="Label" translatable="yes">edit</property>
  44.596 +                    <property name="UseUnderline">True</property>
  44.597 +                    <signal name="Clicked" handler="HandleEditButtonClicked" />
  44.598 +                  </widget>
  44.599 +                  <packing>
  44.600 +                    <property name="Position">1</property>
  44.601 +                    <property name="AutoSize">True</property>
  44.602 +                    <property name="Expand">False</property>
  44.603 +                    <property name="Fill">False</property>
  44.604 +                  </packing>
  44.605 +                </child>
  44.606 +                <child>
  44.607 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnReplaceWeapon">
  44.608 +                    <property name="MemberName" />
  44.609 +                    <property name="Sensitive">False</property>
  44.610 +                    <property name="CanFocus">True</property>
  44.611 +                    <property name="Type">TextOnly</property>
  44.612 +                    <property name="Label" translatable="yes">replace</property>
  44.613 +                    <property name="UseUnderline">True</property>
  44.614 +                    <signal name="Clicked" handler="HandleReplaceButtonClicked" />
  44.615 +                  </widget>
  44.616 +                  <packing>
  44.617 +                    <property name="Position">2</property>
  44.618 +                    <property name="AutoSize">True</property>
  44.619 +                    <property name="Expand">False</property>
  44.620 +                    <property name="Fill">False</property>
  44.621 +                  </packing>
  44.622 +                </child>
  44.623 +                <child>
  44.624 +                  <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnRemoveWeapon">
  44.625 +                    <property name="MemberName" />
  44.626 +                    <property name="Sensitive">False</property>
  44.627 +                    <property name="CanFocus">True</property>
  44.628 +                    <property name="Type">TextOnly</property>
  44.629 +                    <property name="Label" translatable="yes">remove</property>
  44.630 +                    <property name="UseUnderline">True</property>
  44.631 +                    <signal name="Clicked" handler="HandleRemoveButtonActivated" />
  44.632 +                  </widget>
  44.633 +                  <packing>
  44.634 +                    <property name="Position">3</property>
  44.635 +                    <property name="AutoSize">True</property>
  44.636 +                    <property name="Expand">False</property>
  44.637 +                    <property name="Fill">False</property>
  44.638 +                  </packing>
  44.639 +                </child>
  44.640 +              </widget>
  44.641 +              <packing>
  44.642 +                <property name="Position">1</property>
  44.643 +                <property name="AutoSize">True</property>
  44.644 +                <property name="Expand">False</property>
  44.645 +                <property name="Fill">False</property>
  44.646 +              </packing>
  44.647 +            </child>
  44.648 +          </widget>
  44.649 +          <packing>
  44.650 +            <property name="Position">3</property>
  44.651 +            <property name="AutoSize">True</property>
  44.652 +            <property name="Expand">False</property>
  44.653 +            <property name="Fill">False</property>
  44.654 +          </packing>
  44.655 +        </child>
  44.656 +        <child>
  44.657 +          <placeholder />
  44.658 +        </child>
  44.659 +        <child>
  44.660 +          <placeholder />
  44.661 +        </child>
  44.662 +      </widget>
  44.663 +    </child>
  44.664 +  </widget>
  44.665 +  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment" design-size="400 300">
  44.666 +    <property name="MemberName" />
  44.667 +    <property name="Title" translatable="yes">Add equipment</property>
  44.668 +    <property name="WindowPosition">CenterOnParent</property>
  44.669 +    <property name="Modal">True</property>
  44.670 +    <property name="SkipPagerHint">True</property>
  44.671 +    <property name="SkipTaskbarHint">True</property>
  44.672 +    <property name="Buttons">2</property>
  44.673 +    <property name="HelpButton">False</property>
  44.674 +    <child internal-child="VBox">
  44.675 +      <widget class="Gtk.VBox" id="dialog1_VBox">
  44.676 +        <property name="MemberName" />
  44.677 +        <property name="BorderWidth">2</property>
  44.678 +        <child>
  44.679            <widget class="Gtk.Table" id="table1">
  44.680              <property name="MemberName" />
  44.681              <property name="NRows">2</property>
  44.682 -            <property name="NColumns">3</property>
  44.683 +            <property name="NColumns">2</property>
  44.684              <property name="RowSpacing">6</property>
  44.685              <property name="ColumnSpacing">6</property>
  44.686              <child>
  44.687 -              <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow1">
  44.688 +              <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
  44.689                  <property name="MemberName" />
  44.690                  <property name="ShadowType">In</property>
  44.691                  <child>
  44.692 -                  <widget class="Gtk.NodeView" id="optionalEquipment">
  44.693 +                  <widget class="Gtk.TreeView" id="lstEquipment">
  44.694                      <property name="MemberName" />
  44.695                      <property name="CanFocus">True</property>
  44.696                      <property name="ShowScrollbars">True</property>
  44.697 +                    <property name="HeadersVisible">False</property>
  44.698                    </widget>
  44.699                  </child>
  44.700                </widget>
  44.701                <packing>
  44.702 +                <property name="LeftAttach">1</property>
  44.703 +                <property name="RightAttach">2</property>
  44.704 +                <property name="AutoSize">True</property>
  44.705 +                <property name="YOptions">Fill</property>
  44.706 +                <property name="XExpand">True</property>
  44.707 +                <property name="XFill">True</property>
  44.708 +                <property name="XShrink">False</property>
  44.709 +                <property name="YExpand">False</property>
  44.710 +                <property name="YFill">True</property>
  44.711 +                <property name="YShrink">False</property>
  44.712 +              </packing>
  44.713 +            </child>
  44.714 +            <child>
  44.715 +              <widget class="Gtk.HBox" id="hbox2">
  44.716 +                <property name="MemberName" />
  44.717 +                <property name="Spacing">6</property>
  44.718 +                <child>
  44.719 +                  <widget class="Gtk.Table" id="table2">
  44.720 +                    <property name="MemberName" />
  44.721 +                    <property name="NRows">3</property>
  44.722 +                    <property name="NColumns">3</property>
  44.723 +                    <property name="RowSpacing">6</property>
  44.724 +                    <property name="ColumnSpacing">6</property>
  44.725 +                    <child>
  44.726 +                      <placeholder />
  44.727 +                    </child>
  44.728 +                    <child>
  44.729 +                      <placeholder />
  44.730 +                    </child>
  44.731 +                    <child>
  44.732 +                      <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblEquipAll">
  44.733 +                        <property name="MemberName" />
  44.734 +                        <property name="LabelProp" translatable="yes">equip all</property>
  44.735 +                      </widget>
  44.736 +                      <packing>
  44.737 +                        <property name="TopAttach">2</property>
  44.738 +                        <property name="BottomAttach">3</property>
  44.739 +                        <property name="LeftAttach">1</property>
  44.740 +                        <property name="RightAttach">2</property>
  44.741 +                        <property name="AutoSize">False</property>
  44.742 +                        <property name="YOptions">Fill</property>
  44.743 +                        <property name="XExpand">True</property>
  44.744 +                        <property name="XFill">True</property>
  44.745 +                        <property name="XShrink">False</property>
  44.746 +                        <property name="YExpand">False</property>
  44.747 +                        <property name="YFill">True</property>
  44.748 +                        <property name="YShrink">False</property>
  44.749 +                      </packing>
  44.750 +                    </child>
  44.751 +                    <child>
  44.752 +                      <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblPercent">
  44.753 +                        <property name="MemberName" />
  44.754 +                        <property name="LabelProp" translatable="yes">%</property>
  44.755 +                      </widget>
  44.756 +                      <packing>
  44.757 +                        <property name="TopAttach">1</property>
  44.758 +                        <property name="BottomAttach">2</property>
  44.759 +                        <property name="LeftAttach">2</property>
  44.760 +                        <property name="RightAttach">3</property>
  44.761 +                        <property name="AutoSize">True</property>
  44.762 +                        <property name="XOptions">Fill</property>
  44.763 +                        <property name="YOptions">Fill</property>
  44.764 +                        <property name="XExpand">False</property>
  44.765 +                        <property name="XFill">True</property>
  44.766 +                        <property name="XShrink">False</property>
  44.767 +                        <property name="YExpand">False</property>
  44.768 +                        <property name="YFill">True</property>
  44.769 +                        <property name="YShrink">False</property>
  44.770 +                      </packing>
  44.771 +                    </child>
  44.772 +                    <child>
  44.773 +                      <widget class="Gtk.SpinButton" id="numericAmount">
  44.774 +                        <property name="MemberName" />
  44.775 +                        <property name="CanFocus">True</property>
  44.776 +                        <property name="Upper">100</property>
  44.777 +                        <property name="PageIncrement">10</property>
  44.778 +                        <property name="StepIncrement">1</property>
  44.779 +                        <property name="ClimbRate">1</property>
  44.780 +                        <property name="Numeric">True</property>
  44.781 +                        <signal name="ValueChanged" handler="SpinButtonValueChanged" />
  44.782 +                      </widget>
  44.783 +                      <packing>
  44.784 +                        <property name="LeftAttach">1</property>
  44.785 +                        <property name="RightAttach">2</property>
  44.786 +                        <property name="AutoSize">False</property>
  44.787 +                        <property name="XOptions">0</property>
  44.788 +                        <property name="YOptions">Fill</property>
  44.789 +                        <property name="XExpand">False</property>
  44.790 +                        <property name="XFill">False</property>
  44.791 +                        <property name="XShrink">False</property>
  44.792 +                        <property name="YExpand">False</property>
  44.793 +                        <property name="YFill">True</property>
  44.794 +                        <property name="YShrink">False</property>
  44.795 +                      </packing>
  44.796 +                    </child>
  44.797 +                    <child>
  44.798 +                      <widget class="Gtk.SpinButton" id="percentageAmount">
  44.799 +                        <property name="MemberName" />
  44.800 +                        <property name="CanFocus">True</property>
  44.801 +                        <property name="Upper">100</property>
  44.802 +                        <property name="PageIncrement">10</property>
  44.803 +                        <property name="StepIncrement">1</property>
  44.804 +                        <property name="ClimbRate">1</property>
  44.805 +                        <property name="Digits">1</property>
  44.806 +                        <property name="Numeric">True</property>
  44.807 +                        <signal name="ValueChanged" handler="SpinButtonValueChanged" />
  44.808 +                      </widget>
  44.809 +                      <packing>
  44.810 +                        <property name="TopAttach">1</property>
  44.811 +                        <property name="BottomAttach">2</property>
  44.812 +                        <property name="LeftAttach">1</property>
  44.813 +                        <property name="RightAttach">2</property>
  44.814 +                        <property name="AutoSize">False</property>
  44.815 +                        <property name="XOptions">0</property>
  44.816 +                        <property name="YOptions">Fill</property>
  44.817 +                        <property name="XExpand">False</property>
  44.818 +                        <property name="XFill">False</property>
  44.819 +                        <property name="XShrink">False</property>
  44.820 +                        <property name="YExpand">False</property>
  44.821 +                        <property name="YFill">True</property>
  44.822 +                        <property name="YShrink">False</property>
  44.823 +                      </packing>
  44.824 +                    </child>
  44.825 +                    <child>
  44.826 +                      <widget class="Gtk.RadioButton" id="rbEquipAll">
  44.827 +                        <property name="MemberName" />
  44.828 +                        <property name="CanFocus">True</property>
  44.829 +                        <property name="Label" translatable="yes" />
  44.830 +                        <property name="Active">True</property>
  44.831 +                        <property name="DrawIndicator">True</property>
  44.832 +                        <property name="HasLabel">True</property>
  44.833 +                        <property name="UseUnderline">True</property>
  44.834 +                        <property name="Group">group1</property>
  44.835 +                      </widget>
  44.836 +                      <packing>
  44.837 +                        <property name="TopAttach">2</property>
  44.838 +                        <property name="BottomAttach">3</property>
  44.839 +                        <property name="AutoSize">True</property>
  44.840 +                        <property name="XOptions">Fill</property>
  44.841 +                        <property name="YOptions">Fill</property>
  44.842 +                        <property name="XExpand">False</property>
  44.843 +                        <property name="XFill">True</property>
  44.844 +                        <property name="XShrink">False</property>
  44.845 +                        <property name="YExpand">False</property>
  44.846 +                        <property name="YFill">True</property>
  44.847 +                        <property name="YShrink">False</property>
  44.848 +                      </packing>
  44.849 +                    </child>
  44.850 +                    <child>
  44.851 +                      <widget class="Gtk.RadioButton" id="rbEquipNumeric">
  44.852 +                        <property name="MemberName" />
  44.853 +                        <property name="CanFocus">True</property>
  44.854 +                        <property name="Label" translatable="yes" />
  44.855 +                        <property name="DrawIndicator">True</property>
  44.856 +                        <property name="HasLabel">True</property>
  44.857 +                        <property name="UseUnderline">True</property>
  44.858 +                        <property name="Group">group1</property>
  44.859 +                        <signal name="Clicked" handler="RadioButtonClicked" />
  44.860 +                      </widget>
  44.861 +                      <packing>
  44.862 +                        <property name="AutoSize">False</property>
  44.863 +                        <property name="XOptions">Fill</property>
  44.864 +                        <property name="YOptions">Fill</property>
  44.865 +                        <property name="XExpand">False</property>
  44.866 +                        <property name="XFill">True</property>
  44.867 +                        <property name="XShrink">False</property>
  44.868 +                        <property name="YExpand">False</property>
  44.869 +                        <property name="YFill">True</property>
  44.870 +                        <property name="YShrink">False</property>
  44.871 +                      </packing>
  44.872 +                    </child>
  44.873 +                    <child>
  44.874 +                      <widget class="Gtk.RadioButton" id="rbEquipPercent">
  44.875 +                        <property name="MemberName" />
  44.876 +                        <property name="CanFocus">True</property>
  44.877 +                        <property name="Label" translatable="yes" />
  44.878 +                        <property name="DrawIndicator">True</property>
  44.879 +                        <property name="HasLabel">True</property>
  44.880 +                        <property name="UseUnderline">True</property>
  44.881 +                        <property name="Group">group1</property>
  44.882 +                      </widget>
  44.883 +                      <packing>
  44.884 +                        <property name="TopAttach">1</property>
  44.885 +                        <property name="BottomAttach">2</property>
  44.886 +                        <property name="AutoSize">True</property>
  44.887 +                        <property name="XOptions">Fill</property>
  44.888 +                        <property name="YOptions">Fill</property>
  44.889 +                        <property name="XExpand">False</property>
  44.890 +                        <property name="XFill">True</property>
  44.891 +                        <property name="XShrink">False</property>
  44.892 +                        <property name="YExpand">False</property>
  44.893 +                        <property name="YFill">True</property>
  44.894 +                        <property name="YShrink">False</property>
  44.895 +                      </packing>
  44.896 +                    </child>
  44.897 +                  </widget>
  44.898 +                  <packing>
  44.899 +                    <property name="Position">0</property>
  44.900 +                    <property name="AutoSize">True</property>
  44.901 +                    <property name="Expand">False</property>
  44.902 +                    <property name="Fill">False</property>
  44.903 +                  </packing>
  44.904 +                </child>
  44.905 +                <child>
  44.906 +                  <placeholder />
  44.907 +                </child>
  44.908 +              </widget>
  44.909 +              <packing>
  44.910                  <property name="TopAttach">1</property>
  44.911                  <property name="BottomAttach">2</property>
  44.912                  <property name="LeftAttach">1</property>
  44.913 @@ -796,14 +1292,426 @@
  44.914                </packing>
  44.915              </child>
  44.916              <child>
  44.917 -              <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow2">
  44.918 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblAmount">
  44.919 +                <property name="MemberName" />
  44.920 +                <property name="LabelProp" translatable="yes">amount:</property>
  44.921 +              </widget>
  44.922 +              <packing>
  44.923 +                <property name="TopAttach">1</property>
  44.924 +                <property name="BottomAttach">2</property>
  44.925 +                <property name="AutoSize">True</property>
  44.926 +                <property name="XOptions">Fill</property>
  44.927 +                <property name="YOptions">Fill</property>
  44.928 +                <property name="XExpand">False</property>
  44.929 +                <property name="XFill">True</property>
  44.930 +                <property name="XShrink">False</property>
  44.931 +                <property name="YExpand">False</property>
  44.932 +                <property name="YFill">True</property>
  44.933 +                <property name="YShrink">False</property>
  44.934 +              </packing>
  44.935 +            </child>
  44.936 +            <child>
  44.937 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblItem">
  44.938 +                <property name="MemberName" />
  44.939 +                <property name="LabelProp" translatable="yes">equipment</property>
  44.940 +              </widget>
  44.941 +              <packing>
  44.942 +                <property name="AutoSize">True</property>
  44.943 +                <property name="XOptions">Fill</property>
  44.944 +                <property name="YOptions">Fill</property>
  44.945 +                <property name="XExpand">False</property>
  44.946 +                <property name="XFill">True</property>
  44.947 +                <property name="XShrink">False</property>
  44.948 +                <property name="YExpand">False</property>
  44.949 +                <property name="YFill">True</property>
  44.950 +                <property name="YShrink">False</property>
  44.951 +              </packing>
  44.952 +            </child>
  44.953 +          </widget>
  44.954 +          <packing>
  44.955 +            <property name="Position">0</property>
  44.956 +            <property name="AutoSize">True</property>
  44.957 +            <property name="Expand">False</property>
  44.958 +            <property name="Fill">False</property>
  44.959 +          </packing>
  44.960 +        </child>
  44.961 +      </widget>
  44.962 +    </child>
  44.963 +    <child internal-child="ActionArea">
  44.964 +      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
  44.965 +        <property name="MemberName" />
  44.966 +        <property name="Spacing">10</property>
  44.967 +        <property name="BorderWidth">5</property>
  44.968 +        <property name="Size">2</property>
  44.969 +        <property name="LayoutStyle">End</property>
  44.970 +        <child>
  44.971 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCancel">
  44.972 +            <property name="MemberName" />
  44.973 +            <property name="CanDefault">True</property>
  44.974 +            <property name="CanFocus">True</property>
  44.975 +            <property name="UseStock">True</property>
  44.976 +            <property name="Type">StockItem</property>
  44.977 +            <property name="StockId">gtk-cancel</property>
  44.978 +            <property name="ResponseId">-6</property>
  44.979 +            <signal name="Clicked" handler="CancelButtonClicked" />
  44.980 +            <property name="label">gtk-cancel</property>
  44.981 +          </widget>
  44.982 +          <packing>
  44.983 +            <property name="Expand">False</property>
  44.984 +            <property name="Fill">False</property>
  44.985 +          </packing>
  44.986 +        </child>
  44.987 +        <child>
  44.988 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnOkay">
  44.989 +            <property name="MemberName" />
  44.990 +            <property name="CanDefault">True</property>
  44.991 +            <property name="CanFocus">True</property>
  44.992 +            <property name="UseStock">True</property>
  44.993 +            <property name="Type">StockItem</property>
  44.994 +            <property name="StockId">gtk-ok</property>
  44.995 +            <property name="ResponseId">-5</property>
  44.996 +            <signal name="Clicked" handler="OkayButtonClicked" />
  44.997 +            <property name="label">gtk-ok</property>
  44.998 +          </widget>
  44.999 +          <packing>
 44.1000 +            <property name="Position">1</property>
 44.1001 +            <property name="Expand">False</property>
 44.1002 +            <property name="Fill">False</property>
 44.1003 +          </packing>
 44.1004 +        </child>
 44.1005 +      </widget>
 44.1006 +    </child>
 44.1007 +  </widget>
 44.1008 +  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmEditEquipment" design-size="280 175">
 44.1009 +    <property name="MemberName" />
 44.1010 +    <property name="Title" translatable="yes">Edit equipment</property>
 44.1011 +    <property name="WindowPosition">CenterOnParent</property>
 44.1012 +    <property name="Modal">True</property>
 44.1013 +    <property name="SkipPagerHint">True</property>
 44.1014 +    <property name="SkipTaskbarHint">True</property>
 44.1015 +    <property name="Buttons">2</property>
 44.1016 +    <property name="HelpButton">False</property>
 44.1017 +    <child internal-child="VBox">
 44.1018 +      <widget class="Gtk.VBox" id="dialog1_VBox">
 44.1019 +        <property name="MemberName" />
 44.1020 +        <property name="BorderWidth">2</property>
 44.1021 +        <child>
 44.1022 +          <widget class="Gtk.Table" id="table1">
 44.1023 +            <property name="MemberName" />
 44.1024 +            <property name="NColumns">2</property>
 44.1025 +            <property name="RowSpacing">6</property>
 44.1026 +            <property name="ColumnSpacing">6</property>
 44.1027 +            <child>
 44.1028 +              <widget class="Gtk.HBox" id="hbox2">
 44.1029 +                <property name="MemberName" />
 44.1030 +                <property name="Spacing">6</property>
 44.1031 +                <child>
 44.1032 +                  <widget class="Gtk.Table" id="table2">
 44.1033 +                    <property name="MemberName" />
 44.1034 +                    <property name="NRows">3</property>
 44.1035 +                    <property name="NColumns">3</property>
 44.1036 +                    <property name="RowSpacing">6</property>
 44.1037 +                    <property name="ColumnSpacing">6</property>
 44.1038 +                    <child>
 44.1039 +                      <placeholder />
 44.1040 +                    </child>
 44.1041 +                    <child>
 44.1042 +                      <placeholder />
 44.1043 +                    </child>
 44.1044 +                    <child>
 44.1045 +                      <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblEquipAll">
 44.1046 +                        <property name="MemberName" />
 44.1047 +                        <property name="LabelProp" translatable="yes">equip all</property>
 44.1048 +                      </widget>
 44.1049 +                      <packing>
 44.1050 +                        <property name="TopAttach">2</property>
 44.1051 +                        <property name="BottomAttach">3</property>
 44.1052 +                        <property name="LeftAttach">1</property>
 44.1053 +                        <property name="RightAttach">2</property>
 44.1054 +                        <property name="AutoSize">False</property>
 44.1055 +                        <property name="YOptions">Fill</property>
 44.1056 +                        <property name="XExpand">True</property>
 44.1057 +                        <property name="XFill">True</property>
 44.1058 +                        <property name="XShrink">False</property>
 44.1059 +                        <property name="YExpand">False</property>
 44.1060 +                        <property name="YFill">True</property>
 44.1061 +                        <property name="YShrink">False</property>
 44.1062 +                      </packing>
 44.1063 +                    </child>
 44.1064 +                    <child>
 44.1065 +                      <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblPercent">
 44.1066 +                        <property name="MemberName" />
 44.1067 +                        <property name="LabelProp" translatable="yes">%</property>
 44.1068 +                      </widget>
 44.1069 +                      <packing>
 44.1070 +                        <property name="TopAttach">1</property>
 44.1071 +                        <property name="BottomAttach">2</property>
 44.1072 +                        <property name="LeftAttach">2</property>
 44.1073 +                        <property name="RightAttach">3</property>
 44.1074 +                        <property name="AutoSize">True</property>
 44.1075 +                        <property name="XOptions">Fill</property>
 44.1076 +                        <property name="YOptions">Fill</property>
 44.1077 +                        <property name="XExpand">False</property>
 44.1078 +                        <property name="XFill">True</property>
 44.1079 +                        <property name="XShrink">False</property>
 44.1080 +                        <property name="YExpand">False</property>
 44.1081 +                        <property name="YFill">True</property>
 44.1082 +                        <property name="YShrink">False</property>
 44.1083 +                      </packing>
 44.1084 +                    </child>
 44.1085 +                    <child>
 44.1086 +                      <widget class="Gtk.SpinButton" id="numericAmount">
 44.1087 +                        <property name="MemberName" />
 44.1088 +                        <property name="CanFocus">True</property>
 44.1089 +                        <property name="Upper">100</property>
 44.1090 +                        <property name="PageIncrement">10</property>
 44.1091 +                        <property name="StepIncrement">1</property>
 44.1092 +                        <property name="ClimbRate">1</property>
 44.1093 +                        <property name="Numeric">True</property>
 44.1094 +                        <signal name="ValueChanged" handler="SpinButtonValueChanged" />
 44.1095 +                      </widget>
 44.1096 +                      <packing>
 44.1097 +                        <property name="LeftAttach">1</property>
 44.1098 +                        <property name="RightAttach">2</property>
 44.1099 +                        <property name="AutoSize">False</property>
 44.1100 +                        <property name="XOptions">0</property>
 44.1101 +                        <property name="YOptions">Fill</property>
 44.1102 +                        <property name="XExpand">False</property>
 44.1103 +                        <property name="XFill">False</property>
 44.1104 +                        <property name="XShrink">False</property>
 44.1105 +                        <property name="YExpand">False</property>
 44.1106 +                        <property name="YFill">True</property>
 44.1107 +                        <property name="YShrink">False</property>
 44.1108 +                      </packing>
 44.1109 +                    </child>
 44.1110 +                    <child>
 44.1111 +                      <widget class="Gtk.SpinButton" id="percentageAmount">
 44.1112 +                        <property name="MemberName" />
 44.1113 +                        <property name="CanFocus">True</property>
 44.1114 +                        <property name="Upper">100</property>
 44.1115 +                        <property name="PageIncrement">10</property>
 44.1116 +                        <property name="StepIncrement">1</property>
 44.1117 +                        <property name="ClimbRate">1</property>
 44.1118 +                        <property name="Digits">1</property>
 44.1119 +                        <property name="Numeric">True</property>
 44.1120 +                        <signal name="ValueChanged" handler="SpinButtonValueChanged" />
 44.1121 +                      </widget>
 44.1122 +                      <packing>
 44.1123 +                        <property name="TopAttach">1</property>
 44.1124 +                        <property name="BottomAttach">2</property>
 44.1125 +                        <property name="LeftAttach">1</property>
 44.1126 +                        <property name="RightAttach">2</property>
 44.1127 +                        <property name="AutoSize">False</property>
 44.1128 +                        <property name="XOptions">0</property>
 44.1129 +                        <property name="YOptions">Fill</property>
 44.1130 +                        <property name="XExpand">False</property>
 44.1131 +                        <property name="XFill">False</property>
 44.1132 +                        <property name="XShrink">False</property>
 44.1133 +                        <property name="YExpand">False</property>
 44.1134 +                        <property name="YFill">True</property>
 44.1135 +                        <property name="YShrink">False</property>
 44.1136 +                      </packing>
 44.1137 +                    </child>
 44.1138 +                    <child>
 44.1139 +                      <widget class="Gtk.RadioButton" id="rbEquipAll">
 44.1140 +                        <property name="MemberName" />
 44.1141 +                        <property name="CanFocus">True</property>
 44.1142 +                        <property name="Label" translatable="yes" />
 44.1143 +                        <property name="DrawIndicator">True</property>
 44.1144 +                        <property name="HasLabel">True</property>
 44.1145 +                        <property name="UseUnderline">True</property>
 44.1146 +                        <property name="Group">group1</property>
 44.1147 +                        <signal name="Clicked" handler="RadioButtonClicked" />
 44.1148 +                      </widget>
 44.1149 +                      <packing>
 44.1150 +                        <property name="TopAttach">2</property>
 44.1151 +                        <property name="BottomAttach">3</property>
 44.1152 +                        <property name="AutoSize">True</property>
 44.1153 +                        <property name="XOptions">Fill</property>
 44.1154 +                        <property name="YOptions">Fill</property>
 44.1155 +                        <property name="XExpand">False</property>
 44.1156 +                        <property name="XFill">True</property>
 44.1157 +                        <property name="XShrink">False</property>
 44.1158 +                        <property name="YExpand">False</property>
 44.1159 +                        <property name="YFill">True</property>
 44.1160 +                        <property name="YShrink">False</property>
 44.1161 +                      </packing>
 44.1162 +                    </child>
 44.1163 +                    <child>
 44.1164 +                      <widget class="Gtk.RadioButton" id="rbEquipNumeric">
 44.1165 +                        <property name="MemberName" />
 44.1166 +                        <property name="CanFocus">True</property>
 44.1167 +                        <property name="Label" translatable="yes" />
 44.1168 +                        <property name="DrawIndicator">True</property>
 44.1169 +                        <property name="HasLabel">True</property>
 44.1170 +                        <property name="UseUnderline">True</property>
 44.1171 +                        <property name="Group">group1</property>
 44.1172 +                        <signal name="Clicked" handler="RadioButtonClicked" />
 44.1173 +                      </widget>
 44.1174 +                      <packing>
 44.1175 +                        <property name="AutoSize">False</property>
 44.1176 +                        <property name="XOptions">Fill</property>
 44.1177 +                        <property name="YOptions">Fill</property>
 44.1178 +                        <property name="XExpand">False</property>
 44.1179 +                        <property name="XFill">True</property>
 44.1180 +                        <property name="XShrink">False</property>
 44.1181 +                        <property name="YExpand">False</property>
 44.1182 +                        <property name="YFill">True</property>
 44.1183 +                        <property name="YShrink">False</property>
 44.1184 +                      </packing>
 44.1185 +                    </child>
 44.1186 +                    <child>
 44.1187 +                      <widget class="Gtk.RadioButton" id="rbEquipPercent">
 44.1188 +                        <property name="MemberName" />
 44.1189 +                        <property name="CanFocus">True</property>
 44.1190 +                        <property name="Label" translatable="yes" />
 44.1191 +                        <property name="DrawIndicator">True</property>
 44.1192 +                        <property name="HasLabel">True</property>
 44.1193 +                        <property name="UseUnderline">True</property>
 44.1194 +                        <property name="Group">group1</property>
 44.1195 +                        <signal name="Clicked" handler="RadioButtonClicked" />
 44.1196 +                      </widget>
 44.1197 +                      <packing>
 44.1198 +                        <property name="TopAttach">1</property>
 44.1199 +                        <property name="BottomAttach">2</property>
 44.1200 +                        <property name="AutoSize">True</property>
 44.1201 +                        <property name="XOptions">Fill</property>
 44.1202 +                        <property name="YOptions">Fill</property>
 44.1203 +                        <property name="XExpand">False</property>
 44.1204 +                        <property name="XFill">True</property>
 44.1205 +                        <property name="XShrink">False</property>
 44.1206 +                        <property name="YExpand">False</property>
 44.1207 +                        <property name="YFill">True</property>
 44.1208 +                        <property name="YShrink">False</property>
 44.1209 +                      </packing>
 44.1210 +                    </child>
 44.1211 +                  </widget>
 44.1212 +                  <packing>
 44.1213 +                    <property name="Position">0</property>
 44.1214 +                    <property name="AutoSize">True</property>
 44.1215 +                    <property name="Expand">False</property>
 44.1216 +                    <property name="Fill">False</property>
 44.1217 +                  </packing>
 44.1218 +                </child>
 44.1219 +                <child>
 44.1220 +                  <placeholder />
 44.1221 +                </child>
 44.1222 +              </widget>
 44.1223 +              <packing>
 44.1224 +                <property name="LeftAttach">1</property>
 44.1225 +                <property name="RightAttach">2</property>
 44.1226 +                <property name="AutoSize">True</property>
 44.1227 +                <property name="YOptions">Fill</property>
 44.1228 +                <property name="XExpand">True</property>
 44.1229 +                <property name="XFill">True</property>
 44.1230 +                <property name="XShrink">False</property>
 44.1231 +                <property name="YExpand">False</property>
 44.1232 +                <property name="YFill">True</property>
 44.1233 +                <property name="YShrink">False</property>
 44.1234 +              </packing>
 44.1235 +            </child>
 44.1236 +            <child>
 44.1237 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblAmount">
 44.1238 +                <property name="MemberName" />
 44.1239 +                <property name="LabelProp" translatable="yes">amount:</property>
 44.1240 +                <property name="Justify">Right</property>
 44.1241 +              </widget>
 44.1242 +              <packing>
 44.1243 +                <property name="AutoSize">False</property>
 44.1244 +                <property name="YOptions">Fill</property>
 44.1245 +                <property name="XExpand">True</property>
 44.1246 +                <property name="XFill">True</property>
 44.1247 +                <property name="XShrink">False</property>
 44.1248 +                <property name="YExpand">False</property>
 44.1249 +                <property name="YFill">True</property>
 44.1250 +                <property name="YShrink">False</property>
 44.1251 +              </packing>
 44.1252 +            </child>
 44.1253 +          </widget>
 44.1254 +          <packing>
 44.1255 +            <property name="Position">0</property>
 44.1256 +            <property name="AutoSize">True</property>
 44.1257 +            <property name="Expand">False</property>
 44.1258 +            <property name="Fill">False</property>
 44.1259 +          </packing>
 44.1260 +        </child>
 44.1261 +      </widget>
 44.1262 +    </child>
 44.1263 +    <child internal-child="ActionArea">
 44.1264 +      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
 44.1265 +        <property name="MemberName" />
 44.1266 +        <property name="Spacing">10</property>
 44.1267 +        <property name="BorderWidth">5</property>
 44.1268 +        <property name="Size">2</property>
 44.1269 +        <property name="LayoutStyle">End</property>
 44.1270 +        <child>
 44.1271 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCancel">
 44.1272 +            <property name="MemberName" />
 44.1273 +            <property name="CanDefault">True</property>
 44.1274 +            <property name="CanFocus">True</property>
 44.1275 +            <property name="UseStock">True</property>
 44.1276 +            <property name="Type">StockItem</property>
 44.1277 +            <property name="StockId">gtk-cancel</property>
 44.1278 +            <property name="ResponseId">-6</property>
 44.1279 +            <signal name="Clicked" handler="CancelButtonClicked" />
 44.1280 +            <property name="label">gtk-cancel</property>
 44.1281 +          </widget>
 44.1282 +          <packing>
 44.1283 +            <property name="Expand">False</property>
 44.1284 +            <property name="Fill">False</property>
 44.1285 +          </packing>
 44.1286 +        </child>
 44.1287 +        <child>
 44.1288 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnOkay">
 44.1289 +            <property name="MemberName" />
 44.1290 +            <property name="CanDefault">True</property>
 44.1291 +            <property name="CanFocus">True</property>
 44.1292 +            <property name="UseStock">True</property>
 44.1293 +            <property name="Type">StockItem</property>
 44.1294 +            <property name="StockId">gtk-ok</property>
 44.1295 +            <property name="ResponseId">-5</property>
 44.1296 +            <signal name="Clicked" handler="OkayButtonClicked" />
 44.1297 +            <property name="label">gtk-ok</property>
 44.1298 +          </widget>
 44.1299 +          <packing>
 44.1300 +            <property name="Position">1</property>
 44.1301 +            <property name="Expand">False</property>
 44.1302 +            <property name="Fill">False</property>
 44.1303 +          </packing>
 44.1304 +        </child>
 44.1305 +      </widget>
 44.1306 +    </child>
 44.1307 +  </widget>
 44.1308 +  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmReplaceEquipment" design-size="400 300">
 44.1309 +    <property name="MemberName" />
 44.1310 +    <property name="Title" translatable="yes">Add equipment</property>
 44.1311 +    <property name="WindowPosition">CenterOnParent</property>
 44.1312 +    <property name="Modal">True</property>
 44.1313 +    <property name="SkipPagerHint">True</property>
 44.1314 +    <property name="SkipTaskbarHint">True</property>
 44.1315 +    <property name="Buttons">2</property>
 44.1316 +    <property name="HelpButton">False</property>
 44.1317 +    <child internal-child="VBox">
 44.1318 +      <widget class="Gtk.VBox" id="dialog1_VBox">
 44.1319 +        <property name="MemberName" />
 44.1320 +        <property name="BorderWidth">2</property>
 44.1321 +        <child>
 44.1322 +          <widget class="Gtk.Table" id="table1">
 44.1323 +            <property name="MemberName" />
 44.1324 +            <property name="NRows">2</property>
 44.1325 +            <property name="NColumns">2</property>
 44.1326 +            <property name="RowSpacing">6</property>
 44.1327 +            <property name="ColumnSpacing">6</property>
 44.1328 +            <child>
 44.1329 +              <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
 44.1330                  <property name="MemberName" />
 44.1331                  <property name="ShadowType">In</property>
 44.1332                  <child>
 44.1333 -                  <widget class="Gtk.NodeView" id="requiredEquipment">
 44.1334 +                  <widget class="Gtk.TreeView" id="lstEquipment">
 44.1335                      <property name="MemberName" />
 44.1336                      <property name="CanFocus">True</property>
 44.1337                      <property name="ShowScrollbars">True</property>
 44.1338 +                    <property name="HeadersVisible">False</property>
 44.1339                    </widget>
 44.1340                  </child>
 44.1341                </widget>
 44.1342 @@ -821,9 +1729,218 @@
 44.1343                </packing>
 44.1344              </child>
 44.1345              <child>
 44.1346 -              <widget class="Gtk.Label" id="optionalEquipmentLabel">
 44.1347 +              <widget class="Gtk.HBox" id="hbox2">
 44.1348                  <property name="MemberName" />
 44.1349 -                <property name="LabelProp" translatable="yes">Optional Equipment:</property>
 44.1350 +                <property name="Spacing">6</property>
 44.1351 +                <child>
 44.1352 +                  <widget class="Gtk.Table" id="table2">
 44.1353 +                    <property name="MemberName" />
 44.1354 +                    <property name="NRows">3</property>
 44.1355 +                    <property name="NColumns">3</property>
 44.1356 +                    <property name="RowSpacing">6</property>
 44.1357 +                    <property name="ColumnSpacing">6</property>
 44.1358 +                    <child>
 44.1359 +                      <placeholder />
 44.1360 +                    </child>
 44.1361 +                    <child>
 44.1362 +                      <placeholder />
 44.1363 +                    </child>
 44.1364 +                    <child>
 44.1365 +                      <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblEquipAll">
 44.1366 +                        <property name="MemberName" />
 44.1367 +                        <property name="LabelProp" translatable="yes">equip all</property>
 44.1368 +                      </widget>
 44.1369 +                      <packing>
 44.1370 +                        <property name="TopAttach">2</property>
 44.1371 +                        <property name="BottomAttach">3</property>
 44.1372 +                        <property name="LeftAttach">1</property>
 44.1373 +                        <property name="RightAttach">2</property>
 44.1374 +                        <property name="AutoSize">False</property>
 44.1375 +                        <property name="YOptions">Fill</property>
 44.1376 +                        <property name="XExpand">True</property>
 44.1377 +                        <property name="XFill">True</property>
 44.1378 +                        <property name="XShrink">False</property>
 44.1379 +                        <property name="YExpand">False</property>
 44.1380 +                        <property name="YFill">True</property>
 44.1381 +                        <property name="YShrink">False</property>
 44.1382 +                      </packing>
 44.1383 +                    </child>
 44.1384 +                    <child>
 44.1385 +                      <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblPercent">
 44.1386 +                        <property name="MemberName" />
 44.1387 +                        <property name="LabelProp" translatable="yes">%</property>
 44.1388 +                      </widget>
 44.1389 +                      <packing>
 44.1390 +                        <property name="TopAttach">1</property>
 44.1391 +                        <property name="BottomAttach">2</property>
 44.1392 +                        <property name="LeftAttach">2</property>
 44.1393 +                        <property name="RightAttach">3</property>
 44.1394 +                        <property name="AutoSize">True</property>
 44.1395 +                        <property name="XOptions">Fill</property>
 44.1396 +                        <property name="YOptions">Fill</property>
 44.1397 +                        <property name="XExpand">False</property>
 44.1398 +                        <property name="XFill">True</property>
 44.1399 +                        <property name="XShrink">False</property>
 44.1400 +                        <property name="YExpand">False</property>
 44.1401 +                        <property name="YFill">True</property>
 44.1402 +                        <property name="YShrink">False</property>
 44.1403 +                      </packing>
 44.1404 +                    </child>
 44.1405 +                    <child>
 44.1406 +                      <widget class="Gtk.SpinButton" id="numericAmount">
 44.1407 +                        <property name="MemberName" />
 44.1408 +                        <property name="CanFocus">True</property>
 44.1409 +                        <property name="Upper">100</property>
 44.1410 +                        <property name="PageIncrement">10</property>
 44.1411 +                        <property name="StepIncrement">1</property>
 44.1412 +                        <property name="ClimbRate">1</property>
 44.1413 +                        <property name="Numeric">True</property>
 44.1414 +                        <signal name="ValueChanged" handler="SpinButtonValueChanged" />
 44.1415 +                      </widget>
 44.1416 +                      <packing>
 44.1417 +                        <property name="LeftAttach">1</property>
 44.1418 +                        <property name="RightAttach">2</property>
 44.1419 +                        <property name="AutoSize">False</property>
 44.1420 +                        <property name="XOptions">0</property>
 44.1421 +                        <property name="YOptions">Fill</property>
 44.1422 +                        <property name="XExpand">False</property>
 44.1423 +                        <property name="XFill">False</property>
 44.1424 +                        <property name="XShrink">False</property>
 44.1425 +                        <property name="YExpand">False</property>
 44.1426 +                        <property name="YFill">True</property>
 44.1427 +                        <property name="YShrink">False</property>
 44.1428 +                      </packing>
 44.1429 +                    </child>
 44.1430 +                    <child>
 44.1431 +                      <widget class="Gtk.SpinButton" id="percentageAmount">
 44.1432 +                        <property name="MemberName" />
 44.1433 +                        <property name="CanFocus">True</property>
 44.1434 +                        <property name="Upper">100</property>
 44.1435 +                        <property name="PageIncrement">10</property>
 44.1436 +                        <property name="StepIncrement">1</property>
 44.1437 +                        <property name="ClimbRate">1</property>
 44.1438 +                        <property name="Digits">1</property>
 44.1439 +                        <property name="Numeric">True</property>
 44.1440 +                        <signal name="ValueChanged" handler="SpinButtonValueChanged" />
 44.1441 +                      </widget>
 44.1442 +                      <packing>
 44.1443 +                        <property name="TopAttach">1</property>
 44.1444 +                        <property name="BottomAttach">2</property>
 44.1445 +                        <property name="LeftAttach">1</property>
 44.1446 +                        <property name="RightAttach">2</property>
 44.1447 +                        <property name="AutoSize">False</property>
 44.1448 +                        <property name="XOptions">0</property>
 44.1449 +                        <property name="YOptions">Fill</property>
 44.1450 +                        <property name="XExpand">False</property>
 44.1451 +                        <property name="XFill">False</property>
 44.1452 +                        <property name="XShrink">False</property>
 44.1453 +                        <property name="YExpand">False</property>
 44.1454 +                        <property name="YFill">True</property>
 44.1455 +                        <property name="YShrink">False</property>
 44.1456 +                      </packing>
 44.1457 +                    </child>
 44.1458 +                    <child>
 44.1459 +                      <widget class="Gtk.RadioButton" id="rbEquipAll">
 44.1460 +                        <property name="MemberName" />
 44.1461 +                        <property name="CanFocus">True</property>
 44.1462 +                        <property name="Label" translatable="yes" />
 44.1463 +                        <property name="DrawIndicator">True</property>
 44.1464 +                        <property name="HasLabel">True</property>
 44.1465 +                        <property name="UseUnderline">True</property>
 44.1466 +                        <property name="Group">group1</property>
 44.1467 +                      </widget>
 44.1468 +                      <packing>
 44.1469 +                        <property name="TopAttach">2</property>
 44.1470 +                        <property name="BottomAttach">3</property>
 44.1471 +                        <property name="AutoSize">True</property>
 44.1472 +                        <property name="XOptions">Fill</property>
 44.1473 +                        <property name="YOptions">Fill</property>
 44.1474 +                        <property name="XExpand">False</property>
 44.1475 +                        <property name="XFill">True</property>
 44.1476 +                        <property name="XShrink">False</property>
 44.1477 +                        <property name="YExpand">False</property>
 44.1478 +                        <property name="YFill">True</property>
 44.1479 +                        <property name="YShrink">False</property>
 44.1480 +                      </packing>
 44.1481 +                    </child>
 44.1482 +                    <child>
 44.1483 +                      <widget class="Gtk.RadioButton" id="rbEquipNumeric">
 44.1484 +                        <property name="MemberName" />
 44.1485 +                        <property name="CanFocus">True</property>
 44.1486 +                        <property name="Label" translatable="yes" />
 44.1487 +                        <property name="DrawIndicator">True</property>
 44.1488 +                        <property name="HasLabel">True</property>
 44.1489 +                        <property name="UseUnderline">True</property>
 44.1490 +                        <property name="Group">group1</property>
 44.1491 +                        <signal name="Clicked" handler="RadioButtonClicked" />
 44.1492 +                      </widget>
 44.1493 +                      <packing>
 44.1494 +                        <property name="AutoSize">False</property>
 44.1495 +                        <property name="XOptions">Fill</property>
 44.1496 +                        <property name="YOptions">Fill</property>
 44.1497 +                        <property name="XExpand">False</property>
 44.1498 +                        <property name="XFill">True</property>
 44.1499 +                        <property name="XShrink">False</property>
 44.1500 +                        <property name="YExpand">False</property>
 44.1501 +                        <property name="YFill">True</property>
 44.1502 +                        <property name="YShrink">False</property>
 44.1503 +                      </packing>
 44.1504 +                    </child>
 44.1505 +                    <child>
 44.1506 +                      <widget class="Gtk.RadioButton" id="rbEquipPercent">
 44.1507 +                        <property name="MemberName" />
 44.1508 +                        <property name="CanFocus">True</property>
 44.1509 +                        <property name="Label" translatable="yes" />
 44.1510 +                        <property name="DrawIndicator">True</property>
 44.1511 +                        <property name="HasLabel">True</property>
 44.1512 +                        <property name="UseUnderline">True</property>
 44.1513 +                        <property name="Group">group1</property>
 44.1514 +                      </widget>
 44.1515 +                      <packing>
 44.1516 +                        <property name="TopAttach">1</property>
 44.1517 +                        <property name="BottomAttach">2</property>
 44.1518 +                        <property name="AutoSize">True</property>
 44.1519 +                        <property name="XOptions">Fill</property>
 44.1520 +                        <property name="YOptions">Fill</property>
 44.1521 +                        <property name="XExpand">False</property>
 44.1522 +                        <property name="XFill">True</property>
 44.1523 +                        <property name="XShrink">False</property>
 44.1524 +                        <property name="YExpand">False</property>
 44.1525 +                        <property name="YFill">True</property>
 44.1526 +                        <property name="YShrink">False</property>
 44.1527 +                      </packing>
 44.1528 +                    </child>
 44.1529 +                  </widget>
 44.1530 +                  <packing>
 44.1531 +                    <property name="Position">0</property>
 44.1532 +                    <property name="AutoSize">True</property>
 44.1533 +                    <property name="Expand">False</property>
 44.1534 +                    <property name="Fill">False</property>
 44.1535 +                  </packing>
 44.1536 +                </child>
 44.1537 +                <child>
 44.1538 +                  <placeholder />
 44.1539 +                </child>
 44.1540 +              </widget>
 44.1541 +              <packing>
 44.1542 +                <property name="TopAttach">1</property>
 44.1543 +                <property name="BottomAttach">2</property>
 44.1544 +                <property name="LeftAttach">1</property>
 44.1545 +                <property name="RightAttach">2</property>
 44.1546 +                <property name="AutoSize">True</property>
 44.1547 +                <property name="YOptions">Fill</property>
 44.1548 +                <property name="XExpand">True</property>
 44.1549 +                <property name="XFill">True</property>
 44.1550 +                <property name="XShrink">False</property>
 44.1551 +                <property name="YExpand">False</property>
 44.1552 +                <property name="YFill">True</property>
 44.1553 +                <property name="YShrink">False</property>
 44.1554 +              </packing>
 44.1555 +            </child>
 44.1556 +            <child>
 44.1557 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblAmount">
 44.1558 +                <property name="MemberName" />
 44.1559 +                <property name="LabelProp" translatable="yes">amount:</property>
 44.1560                </widget>
 44.1561                <packing>
 44.1562                  <property name="TopAttach">1</property>
 44.1563 @@ -840,9 +1957,309 @@
 44.1564                </packing>
 44.1565              </child>
 44.1566              <child>
 44.1567 -              <widget class="Gtk.Label" id="requiredEquipmentLabel">
 44.1568 +              <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblItem">
 44.1569                  <property name="MemberName" />
 44.1570 -                <property name="LabelProp" translatable="yes">Required Equipment:</property>
 44.1571 +                <property name="LabelProp" translatable="yes">equipment</property>
 44.1572 +              </widget>
 44.1573 +              <packing>
 44.1574 +                <property name="AutoSize">True</property>
 44.1575 +                <property name="XOptions">Fill</property>
 44.1576 +                <property name="YOptions">Fill</property>
 44.1577 +                <property name="XExpand">False</property>
 44.1578 +                <property name="XFill">True</property>
 44.1579 +                <property name="XShrink">False</property>
 44.1580 +                <property name="YExpand">False</property>
 44.1581 +                <property name="YFill">True</property>
 44.1582 +                <property name="YShrink">False</property>
 44.1583 +              </packing>
 44.1584 +            </child>
 44.1585 +          </widget>
 44.1586 +          <packing>
 44.1587 +            <property name="Position">0</property>
 44.1588 +            <property name="AutoSize">True</property>
 44.1589 +            <property name="Expand">False</property>
 44.1590 +            <property name="Fill">False</property>
 44.1591 +          </packing>
 44.1592 +        </child>
 44.1593 +      </widget>
 44.1594 +    </child>
 44.1595 +    <child internal-child="ActionArea">
 44.1596 +      <widget class="Gtk.HButtonBox" id="dialog1_ActionArea">
 44.1597 +        <property name="MemberName" />
 44.1598 +        <property name="Spacing">10</property>
 44.1599 +        <property name="BorderWidth">5</property>
 44.1600 +        <property name="Size">2</property>
 44.1601 +        <property name="LayoutStyle">End</property>
 44.1602 +        <child>
 44.1603 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCancel">
 44.1604 +            <property name="MemberName" />
 44.1605 +            <property name="CanDefault">True</property>
 44.1606 +            <property name="CanFocus">True</property>
 44.1607 +            <property name="UseStock">True</property>
 44.1608 +            <property name="Type">StockItem</property>
 44.1609 +            <property name="StockId">gtk-cancel</property>
 44.1610 +            <property name="ResponseId">-6</property>
 44.1611 +            <signal name="Clicked" handler="CancelButtonClicked" />
 44.1612 +            <property name="label">gtk-cancel</property>
 44.1613 +          </widget>
 44.1614 +          <packing>
 44.1615 +            <property name="Expand">False</property>
 44.1616 +            <property name="Fill">False</property>
 44.1617 +          </packing>
 44.1618 +        </child>
 44.1619 +        <child>
 44.1620 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnOkay">
 44.1621 +            <property name="MemberName" />
 44.1622 +            <property name="CanDefault">True</property>
 44.1623 +            <property name="CanFocus">True</property>
 44.1624 +            <property name="UseStock">True</property>
 44.1625 +            <property name="Type">StockItem</property>
 44.1626 +            <property name="StockId">gtk-ok</property>
 44.1627 +            <property name="ResponseId">-5</property>
 44.1628 +            <signal name="Clicked" handler="OkayButtonClicked" />
 44.1629 +            <property name="label">gtk-ok</property>
 44.1630 +          </widget>
 44.1631 +          <packing>
 44.1632 +            <property name="Position">1</property>
 44.1633 +            <property name="Expand">False</property>
 44.1634 +            <property name="Fill">False</property>
 44.1635 +          </packing>
 44.1636 +        </child>
 44.1637 +      </widget>
 44.1638 +    </child>
 44.1639 +  </widget>
 44.1640 +  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmAbout" design-size="330 300">
 44.1641 +    <property name="MemberName" />
 44.1642 +    <property name="Title" translatable="yes">About WF</property>
 44.1643 +    <property name="Icon">resource:App.ico</property>
 44.1644 +    <property name="TypeHint">Dialog</property>
 44.1645 +    <property name="WindowPosition">CenterOnParent</property>
 44.1646 +    <property name="Resizable">False</property>
 44.1647 +    <property name="AllowGrow">False</property>
 44.1648 +    <property name="SkipPagerHint">True</property>
 44.1649 +    <property name="SkipTaskbarHint">True</property>
 44.1650 +    <property name="Buttons">2</property>
 44.1651 +    <property name="HelpButton">False</property>
 44.1652 +    <child internal-child="VBox">
 44.1653 +      <widget class="Gtk.VBox" id="dialog1_VBox">
 44.1654 +        <property name="MemberName" />
 44.1655 +        <property name="BorderWidth">2</property>
 44.1656 +        <child>
 44.1657 +          <widget class="Gtk.Image" id="logoImage">
 44.1658 +            <property name="MemberName" />
 44.1659 +            <property name="Pixbuf">resource:IBBoard.WarFoundry.GUI.GTK.App-lrg.png</property>
 44.1660 +          </widget>
 44.1661 +          <packing>
 44.1662 +            <property name="Position">0</property>
 44.1663 +            <property name="AutoSize">True</property>
 44.1664 +            <property name="Expand">False</property>
 44.1665 +            <property name="Fill">False</property>
 44.1666 +          </packing>
 44.1667 +        </child>
 44.1668 +        <child>
 44.1669 +          <widget class="Gtk.Label" id="label1">
 44.1670 +            <property name="MemberName" />
 44.1671 +            <property name="LabelProp" translatable="yes">&lt;span font_size="x-large" weight="bold"&gt;WarFoundry v0.1 RC 1&lt;/span&gt;</property>
 44.1672 +            <property name="UseMarkup">True</property>
 44.1673 +          </widget>
 44.1674 +          <packing>
 44.1675 +            <property name="Position">1</property>
 44.1676 +            <property name="AutoSize">True</property>
 44.1677 +            <property name="Expand">False</property>
 44.1678 +            <property name="Fill">False</property>
 44.1679 +          </packing>
 44.1680 +        </child>
 44.1681 +        <child>
 44.1682 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblWarFoundryDesc">
 44.1683 +            <property name="MemberName" />
 44.1684 +            <property name="LabelProp" translatable="yes">WarFoundry is an open-source army creation tool that lets you create rosters for multiple game systems.</property>
 44.1685 +            <property name="Wrap">True</property>
 44.1686 +            <property name="Justify">Center</property>
 44.1687 +          </widget>
 44.1688 +          <packing>
 44.1689 +            <property name="Position">2</property>
 44.1690 +            <property name="AutoSize">True</property>
 44.1691 +            <property name="Expand">False</property>
 44.1692 +            <property name="Fill">False</property>
 44.1693 +          </packing>
 44.1694 +        </child>
 44.1695 +        <child>
 44.1696 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableLabel" id="lblWarFoundryCopyright">
 44.1697 +            <property name="MemberName" />
 44.1698 +            <property name="LabelProp" translatable="yes">© 2007-2010, IBBoard and others</property>