changeset 52:4bad8cb3f889

Re #60: Add UI to add/remove/edit weapons in GTK * Remove "not implemented" exceptions and add first implementation of setting equipment list * Add widgets to add equipment form * Subscribe to Clicked instead of Activated to hook on to correct event * Extract tree rendering method into helper class Also: * Improve exception handling of unhandled exceptions (print full stack trace with "caused by" hierarchy)
author IBBoard <dev@ibboard.co.uk>
date Sun, 22 Aug 2010 14:32:16 +0000
parents dafbd432ca23
children 28b242612ad7
files FrmAddEquipment.cs FrmMainWindow.cs FrmNewArmy.cs IBBoard.WarFoundry.GUI.GTK.csproj Util/GtkWarFoundryUtil.cs Widgets/UnitDisplayWidget.cs gtk-gui/IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs gtk-gui/gui.stetic
diffstat 9 files changed, 532 insertions(+), 29 deletions(-) [+]
line diff
     1.1 --- a/FrmAddEquipment.cs	Sat Aug 21 20:00:03 2010 +0000
     1.2 +++ b/FrmAddEquipment.cs	Sun Aug 22 14:32:16 2010 +0000
     1.3 @@ -4,6 +4,8 @@
     1.4  using System;
     1.5  using IBBoard.WarFoundry.GUI.GTK.UIControl.Interfaces;
     1.6  using IBBoard.WarFoundry.API.Objects;
     1.7 +using Gtk;
     1.8 +using IBBoard.WarFoundry.GUI.GTK.Util;
     1.9  namespace IBBoard.WarFoundry.GUI.GTK
    1.10  {
    1.11  	public partial class FrmAddEquipment : Gtk.Dialog, IAddEquipmentUI
    1.12 @@ -11,28 +13,42 @@
    1.13  		public FrmAddEquipment()
    1.14  		{
    1.15  			this.Build();
    1.16 +			
    1.17 +			TreeViewColumn equipColumn = new TreeViewColumn();
    1.18 +			equipColumn.Title = "Equipment";
    1.19 +			CellRendererText equipCell = new CellRendererText();
    1.20 +			equipColumn.PackStart(equipCell, true);
    1.21 +			equipColumn.SetCellDataFunc(equipCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);
    1.22 +			lstEquipment.AppendColumn(equipColumn);
    1.23  		}
    1.24  
    1.25  		public event SingleArgMethodInvoker<UnitEquipmentItem> UnitEquipmentItemChoiceChanged;
    1.26  
    1.27  		public void SetUnitEquipmentItems(UnitEquipmentItem[] items)
    1.28  		{
    1.29 -			throw new NotImplementedException();
    1.30 +			ListStore store = new ListStore(typeof(UnitEquipmentItem));
    1.31 +			
    1.32 +			foreach (UnitEquipmentItem equipItem in items)
    1.33 +			{
    1.34 +				store.AppendValues(equipItem);
    1.35 +			}
    1.36 +			
    1.37 +			lstEquipment.Model = store;
    1.38  		}
    1.39  
    1.40  		public void SetUnitEquipmentLimits(bool isRatioLimit, double minPercent, double maxPercent, int minNumber, int maxNumber)
    1.41  		{
    1.42 -			throw new NotImplementedException();
    1.43 +			
    1.44  		}
    1.45  
    1.46  		public void SetUnitEquipmentLimitsEnabled(bool isEnabled)
    1.47  		{
    1.48 -			throw new NotImplementedException();
    1.49 +			
    1.50  		}
    1.51  
    1.52  		public void ShowControl()
    1.53  		{
    1.54 -			throw new NotImplementedException();
    1.55 +			
    1.56  		}
    1.57  	}
    1.58  }
     2.1 --- a/FrmMainWindow.cs	Sat Aug 21 20:00:03 2010 +0000
     2.2 +++ b/FrmMainWindow.cs	Sun Aug 22 14:32:16 2010 +0000
     2.3 @@ -90,10 +90,22 @@
     2.4  
     2.5  		private static void HandleUnhandledException(Exception ex)
     2.6  		{
     2.7 -			LogManager.GetLogger(typeof(FrmMainWindow)).Fatal("(" + ex.GetType().Name + ") " + ex.Message + Environment.NewLine + ex.StackTrace);
     2.8 +			LogManager.GetLogger(typeof(FrmMainWindow)).FatalFormat("({0}) {1} {2} {3}", ex.GetType().FullName, ex.Message, Environment.NewLine, GetStackTrace(ex));
     2.9  			MessageDialog dialog = new MessageDialog(null, DialogFlags.Modal, MessageType.Error, ButtonsType.Ok, false, "An unhandled exception occurred. Please check the log for more details.");
    2.10  			dialog.Show();
    2.11  		}
    2.12 +		
    2.13 +		private static string GetStackTrace(Exception ex)
    2.14 +		{
    2.15 +			string message = "";
    2.16 +			
    2.17 +			if (ex != null)
    2.18 +			{
    2.19 +				message  = "Caused by: " + ex.GetType().FullName + Environment.NewLine + ex.StackTrace + Environment.NewLine + GetStackTrace(ex.InnerException);
    2.20 +			}
    2.21 +			
    2.22 +			return message;
    2.23 +		}
    2.24  
    2.25  		public FrmMainWindow() : this(new string[0])
    2.26  		{
     3.1 --- a/FrmNewArmy.cs	Sat Aug 21 20:00:03 2010 +0000
     3.2 +++ b/FrmNewArmy.cs	Sun Aug 22 14:32:16 2010 +0000
     3.3 @@ -9,6 +9,7 @@
     3.4  using IBBoard.WarFoundry.API.Objects;
     3.5  using IBBoard.GtkSharp;
     3.6  using log4net;
     3.7 +using IBBoard.WarFoundry.GUI.GTK.Util;
     3.8  
     3.9  namespace IBBoard.WarFoundry.GTK
    3.10  {	
    3.11 @@ -42,7 +43,7 @@
    3.12  			CellRendererText raceCell = new CellRendererText ();
    3.13  			raceColumn.PackStart (raceCell, true);
    3.14  			lstRaces.AppendColumn(raceColumn);
    3.15 -			raceColumn.SetCellDataFunc(raceCell, new TreeCellDataFunc(RenderRaceName));
    3.16 +			raceColumn.SetCellDataFunc(raceCell, GtkWarFoundryUtil.RenderWarFoundryObjectName);
    3.17  
    3.18  			
    3.19  			if (gameSystem!=null)
    3.20 @@ -56,12 +57,6 @@
    3.21  			get { return Title; }
    3.22  			set { Title = value; }
    3.23  		}
    3.24 -		
    3.25 -		private void RenderRaceName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
    3.26 -		{
    3.27 -			Race r = (Race)model.GetValue(iter, 0);
    3.28 -			(cell as CellRendererText).Text = r.Name;
    3.29 -		}
    3.30  
    3.31  		protected virtual void OnSelectionChanged(object o, EventArgs e)
    3.32  		{
     4.1 --- a/IBBoard.WarFoundry.GUI.GTK.csproj	Sat Aug 21 20:00:03 2010 +0000
     4.2 +++ b/IBBoard.WarFoundry.GUI.GTK.csproj	Sun Aug 22 14:32:16 2010 +0000
     4.3 @@ -54,6 +54,7 @@
     4.4      <Compile Include="UIControl\Interfaces\IAddEquipmentUI.cs" />
     4.5      <Compile Include="FrmAddEquipment.cs" />
     4.6      <Compile Include="gtk-gui\IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs" />
     4.7 +    <Compile Include="Util\GtkWarFoundryUtil.cs" />
     4.8    </ItemGroup>
     4.9    <ItemGroup>
    4.10      <Content Include="App.png" />
    4.11 @@ -110,5 +111,6 @@
    4.12    <ItemGroup>
    4.13      <Folder Include="UIControl\" />
    4.14      <Folder Include="UIControl\Interfaces\" />
    4.15 +    <Folder Include="Util\" />
    4.16    </ItemGroup>
    4.17  </Project>
    4.18 \ No newline at end of file
     5.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.2 +++ b/Util/GtkWarFoundryUtil.cs	Sun Aug 22 14:32:16 2010 +0000
     5.3 @@ -0,0 +1,18 @@
     5.4 +//  This file (GtkWarFoundryUtil.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 +using System;
     5.8 +using IBBoard.WarFoundry.API.Objects;
     5.9 +using Gtk;
    5.10 +namespace IBBoard.WarFoundry.GUI.GTK.Util
    5.11 +{
    5.12 +	public class GtkWarFoundryUtil
    5.13 +	{
    5.14 +		public static void RenderWarFoundryObjectName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
    5.15 +		{
    5.16 +			WarFoundryObject equip = (WarFoundryObject)model.GetValue(iter, 0);
    5.17 +			(cell as CellRendererText).Text = equip.Name;
    5.18 +		}
    5.19 +	}
    5.20 +}
    5.21 +
     6.1 --- a/Widgets/UnitDisplayWidget.cs	Sat Aug 21 20:00:03 2010 +0000
     6.2 +++ b/Widgets/UnitDisplayWidget.cs	Sun Aug 22 14:32:16 2010 +0000
     6.3 @@ -146,9 +146,8 @@
     6.4  			}
     6.5  		}
     6.6  		
     6.7 -		private void OnBttnAddEquipmentActivated(object sender, System.EventArgs e)
     6.8 +		private void OnBttnAddEquipmentClicked(object sender, System.EventArgs e)
     6.9  		{
    6.10 -			Console.WriteLine("Add button clicked");
    6.11  			AddEquipment();
    6.12  		}
    6.13  		
     7.1 --- a/gtk-gui/IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget.cs	Sat Aug 21 20:00:03 2010 +0000
     7.2 +++ b/gtk-gui/IBBoard.WarFoundry.GTK.Widgets.UnitDisplayWidget.cs	Sun Aug 22 14:32:16 2010 +0000
     7.3 @@ -226,7 +226,7 @@
     7.4  			this.unitName.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitNameKeyPress);
     7.5  			this.unitSize.FocusOutEvent += new global::Gtk.FocusOutEventHandler(this.OnUnitSizeFocusOut);
     7.6  			this.unitSize.KeyPressEvent += new global::Gtk.KeyPressEventHandler(this.OnUnitSizeKeyPress);
     7.7 -			this.bttnAddEquipment.Activated += new global::System.EventHandler(this.OnBttnAddEquipmentActivated);
     7.8 +			this.bttnAddEquipment.Clicked += new global::System.EventHandler(this.OnBttnAddEquipmentClicked);
     7.9  		}
    7.10  	}
    7.11  }
     8.1 --- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs	Sat Aug 21 20:00:03 2010 +0000
     8.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.cs	Sun Aug 22 14:32:16 2010 +0000
     8.3 @@ -4,6 +4,34 @@
     8.4  {
     8.5  	public partial class FrmAddEquipment
     8.6  	{
     8.7 +		private global::Gtk.Table table1;
     8.8 +
     8.9 +		private global::Gtk.ScrolledWindow GtkScrolledWindow;
    8.10 +
    8.11 +		private global::Gtk.TreeView lstEquipment;
    8.12 +
    8.13 +		private global::Gtk.HBox hbox2;
    8.14 +
    8.15 +		private global::Gtk.Table table2;
    8.16 +
    8.17 +		private global::Gtk.Label lblEquipAll;
    8.18 +
    8.19 +		private global::Gtk.Label lblPercent;
    8.20 +
    8.21 +		private global::Gtk.RadioButton rbEquipAll;
    8.22 +
    8.23 +		private global::Gtk.RadioButton rbEquipNumeric;
    8.24 +
    8.25 +		private global::Gtk.RadioButton rbEquipPercent;
    8.26 +
    8.27 +		private global::Gtk.SpinButton spinbutton1;
    8.28 +
    8.29 +		private global::Gtk.SpinButton spinbutton2;
    8.30 +
    8.31 +		private global::Gtk.Label lblEquipAmount;
    8.32 +
    8.33 +		private global::Gtk.Label lblEquipment;
    8.34 +
    8.35  		private global::Gtk.Button buttonCancel;
    8.36  
    8.37  		private global::Gtk.Button buttonOk;
    8.38 @@ -18,12 +46,164 @@
    8.39  			global::Gtk.VBox w1 = this.VBox;
    8.40  			w1.Name = "dialog1_VBox";
    8.41  			w1.BorderWidth = ((uint)(2));
    8.42 +			// Container child dialog1_VBox.Gtk.Box+BoxChild
    8.43 +			this.table1 = new global::Gtk.Table(((uint)(2)), ((uint)(2)), false);
    8.44 +			this.table1.Name = "table1";
    8.45 +			this.table1.RowSpacing = ((uint)(6));
    8.46 +			this.table1.ColumnSpacing = ((uint)(6));
    8.47 +			// Container child table1.Gtk.Table+TableChild
    8.48 +			this.GtkScrolledWindow = new global::Gtk.ScrolledWindow();
    8.49 +			this.GtkScrolledWindow.Name = "GtkScrolledWindow";
    8.50 +			this.GtkScrolledWindow.ShadowType = ((global::Gtk.ShadowType)(1));
    8.51 +			// Container child GtkScrolledWindow.Gtk.Container+ContainerChild
    8.52 +			this.lstEquipment = new global::Gtk.TreeView();
    8.53 +			this.lstEquipment.CanFocus = true;
    8.54 +			this.lstEquipment.Name = "lstEquipment";
    8.55 +			this.GtkScrolledWindow.Add(this.lstEquipment);
    8.56 +			this.table1.Add(this.GtkScrolledWindow);
    8.57 +			global::Gtk.Table.TableChild w3 = ((global::Gtk.Table.TableChild)(this.table1[this.GtkScrolledWindow]));
    8.58 +			w3.LeftAttach = ((uint)(1));
    8.59 +			w3.RightAttach = ((uint)(2));
    8.60 +			w3.YOptions = ((global::Gtk.AttachOptions)(4));
    8.61 +			// Container child table1.Gtk.Table+TableChild
    8.62 +			this.hbox2 = new global::Gtk.HBox();
    8.63 +			this.hbox2.Name = "hbox2";
    8.64 +			this.hbox2.Spacing = 6;
    8.65 +			// Container child hbox2.Gtk.Box+BoxChild
    8.66 +			this.table2 = new global::Gtk.Table(((uint)(3)), ((uint)(3)), false);
    8.67 +			this.table2.Name = "table2";
    8.68 +			this.table2.RowSpacing = ((uint)(6));
    8.69 +			this.table2.ColumnSpacing = ((uint)(6));
    8.70 +			// Container child table2.Gtk.Table+TableChild
    8.71 +			this.lblEquipAll = new global::Gtk.Label();
    8.72 +			this.lblEquipAll.Name = "lblEquipAll";
    8.73 +			this.lblEquipAll.LabelProp = global::Mono.Unix.Catalog.GetString("equip all");
    8.74 +			this.table2.Add(this.lblEquipAll);
    8.75 +			global::Gtk.Table.TableChild w4 = ((global::Gtk.Table.TableChild)(this.table2[this.lblEquipAll]));
    8.76 +			w4.TopAttach = ((uint)(2));
    8.77 +			w4.BottomAttach = ((uint)(3));
    8.78 +			w4.LeftAttach = ((uint)(1));
    8.79 +			w4.RightAttach = ((uint)(2));
    8.80 +			w4.YOptions = ((global::Gtk.AttachOptions)(4));
    8.81 +			// Container child table2.Gtk.Table+TableChild
    8.82 +			this.lblPercent = new global::Gtk.Label();
    8.83 +			this.lblPercent.Name = "lblPercent";
    8.84 +			this.lblPercent.LabelProp = global::Mono.Unix.Catalog.GetString("%");
    8.85 +			this.table2.Add(this.lblPercent);
    8.86 +			global::Gtk.Table.TableChild w5 = ((global::Gtk.Table.TableChild)(this.table2[this.lblPercent]));
    8.87 +			w5.TopAttach = ((uint)(1));
    8.88 +			w5.BottomAttach = ((uint)(2));
    8.89 +			w5.LeftAttach = ((uint)(2));
    8.90 +			w5.RightAttach = ((uint)(3));
    8.91 +			w5.XOptions = ((global::Gtk.AttachOptions)(4));
    8.92 +			w5.YOptions = ((global::Gtk.AttachOptions)(4));
    8.93 +			// Container child table2.Gtk.Table+TableChild
    8.94 +			this.rbEquipAll = new global::Gtk.RadioButton("");
    8.95 +			this.rbEquipAll.CanFocus = true;
    8.96 +			this.rbEquipAll.Name = "rbEquipAll";
    8.97 +			this.rbEquipAll.DrawIndicator = true;
    8.98 +			this.rbEquipAll.UseUnderline = true;
    8.99 +			this.rbEquipAll.Group = new global::GLib.SList(global::System.IntPtr.Zero);
   8.100 +			this.table2.Add(this.rbEquipAll);
   8.101 +			global::Gtk.Table.TableChild w6 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipAll]));
   8.102 +			w6.TopAttach = ((uint)(2));
   8.103 +			w6.BottomAttach = ((uint)(3));
   8.104 +			w6.XOptions = ((global::Gtk.AttachOptions)(4));
   8.105 +			w6.YOptions = ((global::Gtk.AttachOptions)(4));
   8.106 +			// Container child table2.Gtk.Table+TableChild
   8.107 +			this.rbEquipNumeric = new global::Gtk.RadioButton("");
   8.108 +			this.rbEquipNumeric.CanFocus = true;
   8.109 +			this.rbEquipNumeric.Name = "rbEquipNumeric";
   8.110 +			this.rbEquipNumeric.DrawIndicator = true;
   8.111 +			this.rbEquipNumeric.UseUnderline = true;
   8.112 +			this.rbEquipNumeric.Group = this.rbEquipAll.Group;
   8.113 +			this.table2.Add(this.rbEquipNumeric);
   8.114 +			global::Gtk.Table.TableChild w7 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipNumeric]));
   8.115 +			w7.XOptions = ((global::Gtk.AttachOptions)(4));
   8.116 +			w7.YOptions = ((global::Gtk.AttachOptions)(4));
   8.117 +			// Container child table2.Gtk.Table+TableChild
   8.118 +			this.rbEquipPercent = new global::Gtk.RadioButton("");
   8.119 +			this.rbEquipPercent.CanFocus = true;
   8.120 +			this.rbEquipPercent.Name = "rbEquipPercent";
   8.121 +			this.rbEquipPercent.DrawIndicator = true;
   8.122 +			this.rbEquipPercent.UseUnderline = true;
   8.123 +			this.rbEquipPercent.Group = this.rbEquipAll.Group;
   8.124 +			this.table2.Add(this.rbEquipPercent);
   8.125 +			global::Gtk.Table.TableChild w8 = ((global::Gtk.Table.TableChild)(this.table2[this.rbEquipPercent]));
   8.126 +			w8.TopAttach = ((uint)(1));
   8.127 +			w8.BottomAttach = ((uint)(2));
   8.128 +			w8.XOptions = ((global::Gtk.AttachOptions)(4));
   8.129 +			w8.YOptions = ((global::Gtk.AttachOptions)(4));
   8.130 +			// Container child table2.Gtk.Table+TableChild
   8.131 +			this.spinbutton1 = new global::Gtk.SpinButton(0, 100, 1);
   8.132 +			this.spinbutton1.CanFocus = true;
   8.133 +			this.spinbutton1.Name = "spinbutton1";
   8.134 +			this.spinbutton1.Adjustment.PageIncrement = 10;
   8.135 +			this.spinbutton1.ClimbRate = 1;
   8.136 +			this.spinbutton1.Numeric = true;
   8.137 +			this.table2.Add(this.spinbutton1);
   8.138 +			global::Gtk.Table.TableChild w9 = ((global::Gtk.Table.TableChild)(this.table2[this.spinbutton1]));
   8.139 +			w9.LeftAttach = ((uint)(1));
   8.140 +			w9.RightAttach = ((uint)(2));
   8.141 +			w9.XOptions = ((global::Gtk.AttachOptions)(0));
   8.142 +			w9.YOptions = ((global::Gtk.AttachOptions)(4));
   8.143 +			// Container child table2.Gtk.Table+TableChild
   8.144 +			this.spinbutton2 = new global::Gtk.SpinButton(0, 100, 1);
   8.145 +			this.spinbutton2.CanFocus = true;
   8.146 +			this.spinbutton2.Name = "spinbutton2";
   8.147 +			this.spinbutton2.Adjustment.PageIncrement = 10;
   8.148 +			this.spinbutton2.ClimbRate = 1;
   8.149 +			this.spinbutton2.Digits = ((uint)(1));
   8.150 +			this.spinbutton2.Numeric = true;
   8.151 +			this.table2.Add(this.spinbutton2);
   8.152 +			global::Gtk.Table.TableChild w10 = ((global::Gtk.Table.TableChild)(this.table2[this.spinbutton2]));
   8.153 +			w10.TopAttach = ((uint)(1));
   8.154 +			w10.BottomAttach = ((uint)(2));
   8.155 +			w10.LeftAttach = ((uint)(1));
   8.156 +			w10.RightAttach = ((uint)(2));
   8.157 +			w10.XOptions = ((global::Gtk.AttachOptions)(0));
   8.158 +			w10.YOptions = ((global::Gtk.AttachOptions)(4));
   8.159 +			this.hbox2.Add(this.table2);
   8.160 +			global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.hbox2[this.table2]));
   8.161 +			w11.Position = 0;
   8.162 +			w11.Expand = false;
   8.163 +			w11.Fill = false;
   8.164 +			this.table1.Add(this.hbox2);
   8.165 +			global::Gtk.Table.TableChild w12 = ((global::Gtk.Table.TableChild)(this.table1[this.hbox2]));
   8.166 +			w12.TopAttach = ((uint)(1));
   8.167 +			w12.BottomAttach = ((uint)(2));
   8.168 +			w12.LeftAttach = ((uint)(1));
   8.169 +			w12.RightAttach = ((uint)(2));
   8.170 +			w12.YOptions = ((global::Gtk.AttachOptions)(4));
   8.171 +			// Container child table1.Gtk.Table+TableChild
   8.172 +			this.lblEquipAmount = new global::Gtk.Label();
   8.173 +			this.lblEquipAmount.Name = "lblEquipAmount";
   8.174 +			this.lblEquipAmount.LabelProp = global::Mono.Unix.Catalog.GetString("amount:");
   8.175 +			this.table1.Add(this.lblEquipAmount);
   8.176 +			global::Gtk.Table.TableChild w13 = ((global::Gtk.Table.TableChild)(this.table1[this.lblEquipAmount]));
   8.177 +			w13.TopAttach = ((uint)(1));
   8.178 +			w13.BottomAttach = ((uint)(2));
   8.179 +			w13.XOptions = ((global::Gtk.AttachOptions)(4));
   8.180 +			w13.YOptions = ((global::Gtk.AttachOptions)(4));
   8.181 +			// Container child table1.Gtk.Table+TableChild
   8.182 +			this.lblEquipment = new global::Gtk.Label();
   8.183 +			this.lblEquipment.Name = "lblEquipment";
   8.184 +			this.lblEquipment.LabelProp = global::Mono.Unix.Catalog.GetString("equipment");
   8.185 +			this.table1.Add(this.lblEquipment);
   8.186 +			global::Gtk.Table.TableChild w14 = ((global::Gtk.Table.TableChild)(this.table1[this.lblEquipment]));
   8.187 +			w14.XOptions = ((global::Gtk.AttachOptions)(4));
   8.188 +			w14.YOptions = ((global::Gtk.AttachOptions)(4));
   8.189 +			w1.Add(this.table1);
   8.190 +			global::Gtk.Box.BoxChild w15 = ((global::Gtk.Box.BoxChild)(w1[this.table1]));
   8.191 +			w15.Position = 0;
   8.192 +			w15.Expand = false;
   8.193 +			w15.Fill = false;
   8.194  			// Internal child IBBoard.WarFoundry.GUI.GTK.FrmAddEquipment.ActionArea
   8.195 -			global::Gtk.HButtonBox w2 = this.ActionArea;
   8.196 -			w2.Name = "dialog1_ActionArea";
   8.197 -			w2.Spacing = 10;
   8.198 -			w2.BorderWidth = ((uint)(5));
   8.199 -			w2.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
   8.200 +			global::Gtk.HButtonBox w16 = this.ActionArea;
   8.201 +			w16.Name = "dialog1_ActionArea";
   8.202 +			w16.Spacing = 10;
   8.203 +			w16.BorderWidth = ((uint)(5));
   8.204 +			w16.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
   8.205  			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
   8.206  			this.buttonCancel = new global::Gtk.Button();
   8.207  			this.buttonCancel.CanDefault = true;
   8.208 @@ -33,9 +213,9 @@
   8.209  			this.buttonCancel.UseUnderline = true;
   8.210  			this.buttonCancel.Label = "gtk-cancel";
   8.211  			this.AddActionWidget(this.buttonCancel, -6);
   8.212 -			global::Gtk.ButtonBox.ButtonBoxChild w3 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2[this.buttonCancel]));
   8.213 -			w3.Expand = false;
   8.214 -			w3.Fill = false;
   8.215 +			global::Gtk.ButtonBox.ButtonBoxChild w17 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.buttonCancel]));
   8.216 +			w17.Expand = false;
   8.217 +			w17.Fill = false;
   8.218  			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
   8.219  			this.buttonOk = new global::Gtk.Button();
   8.220  			this.buttonOk.CanDefault = true;
   8.221 @@ -45,10 +225,10 @@
   8.222  			this.buttonOk.UseUnderline = true;
   8.223  			this.buttonOk.Label = "gtk-ok";
   8.224  			this.AddActionWidget(this.buttonOk, -5);
   8.225 -			global::Gtk.ButtonBox.ButtonBoxChild w4 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w2[this.buttonOk]));
   8.226 -			w4.Position = 1;
   8.227 -			w4.Expand = false;
   8.228 -			w4.Fill = false;
   8.229 +			global::Gtk.ButtonBox.ButtonBoxChild w18 = ((global::Gtk.ButtonBox.ButtonBoxChild)(w16[this.buttonOk]));
   8.230 +			w18.Position = 1;
   8.231 +			w18.Expand = false;
   8.232 +			w18.Fill = false;
   8.233  			if ((this.Child != null))
   8.234  			{
   8.235  				this.Child.ShowAll();
     9.1 --- a/gtk-gui/gui.stetic	Sat Aug 21 20:00:03 2010 +0000
     9.2 +++ b/gtk-gui/gui.stetic	Sun Aug 22 14:32:16 2010 +0000
     9.3 @@ -874,7 +874,7 @@
     9.4                      <property name="Type">TextOnly</property>
     9.5                      <property name="Label" translatable="yes">Add</property>
     9.6                      <property name="UseUnderline">True</property>
     9.7 -                    <signal name="Activated" handler="OnBttnAddEquipmentActivated" />
     9.8 +                    <signal name="Clicked" handler="OnBttnAddEquipmentClicked" />
     9.9                    </widget>
    9.10                    <packing>
    9.11                      <property name="Position">0</property>
    9.12 @@ -967,7 +967,288 @@
    9.13          <property name="MemberName" />
    9.14          <property name="BorderWidth">2</property>
    9.15          <child>
    9.16 -          <placeholder />
    9.17 +          <widget class="Gtk.Table" id="table1">
    9.18 +            <property name="MemberName" />
    9.19 +            <property name="NRows">2</property>
    9.20 +            <property name="NColumns">2</property>
    9.21 +            <property name="RowSpacing">6</property>
    9.22 +            <property name="ColumnSpacing">6</property>
    9.23 +            <child>
    9.24 +              <widget class="Gtk.ScrolledWindow" id="GtkScrolledWindow">
    9.25 +                <property name="MemberName" />
    9.26 +                <property name="ShadowType">In</property>
    9.27 +                <child>
    9.28 +                  <widget class="Gtk.TreeView" id="lstEquipment">
    9.29 +                    <property name="MemberName" />
    9.30 +                    <property name="CanFocus">True</property>
    9.31 +                    <property name="ShowScrollbars">True</property>
    9.32 +                    <property name="HeadersVisible">False</property>
    9.33 +                  </widget>
    9.34 +                </child>
    9.35 +              </widget>
    9.36 +              <packing>
    9.37 +                <property name="LeftAttach">1</property>
    9.38 +                <property name="RightAttach">2</property>
    9.39 +                <property name="AutoSize">True</property>
    9.40 +                <property name="YOptions">Fill</property>
    9.41 +                <property name="XExpand">True</property>
    9.42 +                <property name="XFill">True</property>
    9.43 +                <property name="XShrink">False</property>
    9.44 +                <property name="YExpand">False</property>
    9.45 +                <property name="YFill">True</property>
    9.46 +                <property name="YShrink">False</property>
    9.47 +              </packing>
    9.48 +            </child>
    9.49 +            <child>
    9.50 +              <widget class="Gtk.HBox" id="hbox2">
    9.51 +                <property name="MemberName" />
    9.52 +                <property name="Spacing">6</property>
    9.53 +                <child>
    9.54 +                  <widget class="Gtk.Table" id="table2">
    9.55 +                    <property name="MemberName" />
    9.56 +                    <property name="NRows">3</property>
    9.57 +                    <property name="NColumns">3</property>
    9.58 +                    <property name="RowSpacing">6</property>
    9.59 +                    <property name="ColumnSpacing">6</property>
    9.60 +                    <child>
    9.61 +                      <placeholder />
    9.62 +                    </child>
    9.63 +                    <child>
    9.64 +                      <placeholder />
    9.65 +                    </child>
    9.66 +                    <child>
    9.67 +                      <widget class="Gtk.Label" id="lblEquipAll">
    9.68 +                        <property name="MemberName" />
    9.69 +                        <property name="LabelProp" translatable="yes">equip all</property>
    9.70 +                      </widget>
    9.71 +                      <packing>
    9.72 +                        <property name="TopAttach">2</property>
    9.73 +                        <property name="BottomAttach">3</property>
    9.74 +                        <property name="LeftAttach">1</property>
    9.75 +                        <property name="RightAttach">2</property>
    9.76 +                        <property name="AutoSize">False</property>
    9.77 +                        <property name="YOptions">Fill</property>
    9.78 +                        <property name="XExpand">True</property>
    9.79 +                        <property name="XFill">True</property>
    9.80 +                        <property name="XShrink">False</property>
    9.81 +                        <property name="YExpand">False</property>
    9.82 +                        <property name="YFill">True</property>
    9.83 +                        <property name="YShrink">False</property>
    9.84 +                      </packing>
    9.85 +                    </child>
    9.86 +                    <child>
    9.87 +                      <widget class="Gtk.Label" id="lblPercent">
    9.88 +                        <property name="MemberName" />
    9.89 +                        <property name="LabelProp" translatable="yes">%</property>
    9.90 +                      </widget>
    9.91 +                      <packing>
    9.92 +                        <property name="TopAttach">1</property>
    9.93 +                        <property name="BottomAttach">2</property>
    9.94 +                        <property name="LeftAttach">2</property>
    9.95 +                        <property name="RightAttach">3</property>
    9.96 +                        <property name="AutoSize">True</property>
    9.97 +                        <property name="XOptions">Fill</property>
    9.98 +                        <property name="YOptions">Fill</property>
    9.99 +                        <property name="XExpand">False</property>
   9.100 +                        <property name="XFill">True</property>
   9.101 +                        <property name="XShrink">False</property>
   9.102 +                        <property name="YExpand">False</property>
   9.103 +                        <property name="YFill">True</property>
   9.104 +                        <property name="YShrink">False</property>
   9.105 +                      </packing>
   9.106 +                    </child>
   9.107 +                    <child>
   9.108 +                      <widget class="Gtk.RadioButton" id="rbEquipAll">
   9.109 +                        <property name="MemberName" />
   9.110 +                        <property name="CanFocus">True</property>
   9.111 +                        <property name="Label" translatable="yes" />
   9.112 +                        <property name="Active">True</property>
   9.113 +                        <property name="DrawIndicator">True</property>
   9.114 +                        <property name="HasLabel">True</property>
   9.115 +                        <property name="UseUnderline">True</property>
   9.116 +                        <property name="Group">group1</property>
   9.117 +                      </widget>
   9.118 +                      <packing>
   9.119 +                        <property name="TopAttach">2</property>
   9.120 +                        <property name="BottomAttach">3</property>
   9.121 +                        <property name="AutoSize">True</property>
   9.122 +                        <property name="XOptions">Fill</property>
   9.123 +                        <property name="YOptions">Fill</property>
   9.124 +                        <property name="XExpand">False</property>
   9.125 +                        <property name="XFill">True</property>
   9.126 +                        <property name="XShrink">False</property>
   9.127 +                        <property name="YExpand">False</property>
   9.128 +                        <property name="YFill">True</property>
   9.129 +                        <property name="YShrink">False</property>
   9.130 +                      </packing>
   9.131 +                    </child>
   9.132 +                    <child>
   9.133 +                      <widget class="Gtk.RadioButton" id="rbEquipNumeric">
   9.134 +                        <property name="MemberName" />
   9.135 +                        <property name="CanFocus">True</property>
   9.136 +                        <property name="Label" translatable="yes" />
   9.137 +                        <property name="DrawIndicator">True</property>
   9.138 +                        <property name="HasLabel">True</property>
   9.139 +                        <property name="UseUnderline">True</property>
   9.140 +                        <property name="Group">group1</property>
   9.141 +                      </widget>
   9.142 +                      <packing>
   9.143 +                        <property name="AutoSize">False</property>
   9.144 +                        <property name="XOptions">Fill</property>
   9.145 +                        <property name="YOptions">Fill</property>
   9.146 +                        <property name="XExpand">False</property>
   9.147 +                        <property name="XFill">True</property>
   9.148 +                        <property name="XShrink">False</property>
   9.149 +                        <property name="YExpand">False</property>
   9.150 +                        <property name="YFill">True</property>
   9.151 +                        <property name="YShrink">False</property>
   9.152 +                      </packing>
   9.153 +                    </child>
   9.154 +                    <child>
   9.155 +                      <widget class="Gtk.RadioButton" id="rbEquipPercent">
   9.156 +                        <property name="MemberName" />
   9.157 +                        <property name="CanFocus">True</property>
   9.158 +                        <property name="Label" translatable="yes" />
   9.159 +                        <property name="DrawIndicator">True</property>
   9.160 +                        <property name="HasLabel">True</property>
   9.161 +                        <property name="UseUnderline">True</property>
   9.162 +                        <property name="Group">group1</property>
   9.163 +                      </widget>
   9.164 +                      <packing>
   9.165 +                        <property name="TopAttach">1</property>
   9.166 +                        <property name="BottomAttach">2</property>
   9.167 +                        <property name="AutoSize">True</property>
   9.168 +                        <property name="XOptions">Fill</property>
   9.169 +                        <property name="YOptions">Fill</property>
   9.170 +                        <property name="XExpand">False</property>
   9.171 +                        <property name="XFill">True</property>
   9.172 +                        <property name="XShrink">False</property>
   9.173 +                        <property name="YExpand">False</property>
   9.174 +                        <property name="YFill">True</property>
   9.175 +                        <property name="YShrink">False</property>
   9.176 +                      </packing>
   9.177 +                    </child>
   9.178 +                    <child>
   9.179 +                      <widget class="Gtk.SpinButton" id="spinbutton1">
   9.180 +                        <property name="MemberName" />
   9.181 +                        <property name="CanFocus">True</property>
   9.182 +                        <property name="Upper">100</property>
   9.183 +                        <property name="PageIncrement">10</property>
   9.184 +                        <property name="StepIncrement">1</property>
   9.185 +                        <property name="ClimbRate">1</property>
   9.186 +                        <property name="Numeric">True</property>
   9.187 +                      </widget>
   9.188 +                      <packing>
   9.189 +                        <property name="LeftAttach">1</property>
   9.190 +                        <property name="RightAttach">2</property>
   9.191 +                        <property name="AutoSize">False</property>
   9.192 +                        <property name="XOptions">0</property>
   9.193 +                        <property name="YOptions">Fill</property>
   9.194 +                        <property name="XExpand">False</property>
   9.195 +                        <property name="XFill">False</property>
   9.196 +                        <property name="XShrink">False</property>
   9.197 +                        <property name="YExpand">False</property>
   9.198 +                        <property name="YFill">True</property>
   9.199 +                        <property name="YShrink">False</property>
   9.200 +                      </packing>
   9.201 +                    </child>
   9.202 +                    <child>
   9.203 +                      <widget class="Gtk.SpinButton" id="spinbutton2">
   9.204 +                        <property name="MemberName" />
   9.205 +                        <property name="CanFocus">True</property>
   9.206 +                        <property name="Upper">100</property>
   9.207 +                        <property name="PageIncrement">10</property>
   9.208 +                        <property name="StepIncrement">1</property>
   9.209 +                        <property name="ClimbRate">1</property>
   9.210 +                        <property name="Digits">1</property>
   9.211 +                        <property name="Numeric">True</property>
   9.212 +                      </widget>
   9.213 +                      <packing>
   9.214 +                        <property name="TopAttach">1</property>
   9.215 +                        <property name="BottomAttach">2</property>
   9.216 +                        <property name="LeftAttach">1</property>
   9.217 +                        <property name="RightAttach">2</property>
   9.218 +                        <property name="AutoSize">False</property>
   9.219 +                        <property name="XOptions">0</property>
   9.220 +                        <property name="YOptions">Fill</property>
   9.221 +                        <property name="XExpand">False</property>
   9.222 +                        <property name="XFill">False</property>
   9.223 +                        <property name="XShrink">False</property>
   9.224 +                        <property name="YExpand">False</property>
   9.225 +                        <property name="YFill">True</property>
   9.226 +                        <property name="YShrink">False</property>
   9.227 +                      </packing>
   9.228 +                    </child>
   9.229 +                  </widget>
   9.230 +                  <packing>
   9.231 +                    <property name="Position">0</property>
   9.232 +                    <property name="AutoSize">True</property>
   9.233 +                    <property name="Expand">False</property>
   9.234 +                    <property name="Fill">False</property>
   9.235 +                  </packing>
   9.236 +                </child>
   9.237 +                <child>
   9.238 +                  <placeholder />
   9.239 +                </child>
   9.240 +              </widget>
   9.241 +              <packing>
   9.242 +                <property name="TopAttach">1</property>
   9.243 +                <property name="BottomAttach">2</property>
   9.244 +                <property name="LeftAttach">1</property>
   9.245 +                <property name="RightAttach">2</property>
   9.246 +                <property name="AutoSize">True</property>
   9.247 +                <property name="YOptions">Fill</property>
   9.248 +                <property name="XExpand">True</property>
   9.249 +                <property name="XFill">True</property>
   9.250 +                <property name="XShrink">False</property>
   9.251 +                <property name="YExpand">False</property>
   9.252 +                <property name="YFill">True</property>
   9.253 +                <property name="YShrink">False</property>
   9.254 +              </packing>
   9.255 +            </child>
   9.256 +            <child>
   9.257 +              <widget class="Gtk.Label" id="lblEquipAmount">
   9.258 +                <property name="MemberName" />
   9.259 +                <property name="LabelProp" translatable="yes">amount:</property>
   9.260 +              </widget>
   9.261 +              <packing>
   9.262 +                <property name="TopAttach">1</property>
   9.263 +                <property name="BottomAttach">2</property>
   9.264 +                <property name="AutoSize">True</property>
   9.265 +                <property name="XOptions">Fill</property>
   9.266 +                <property name="YOptions">Fill</property>
   9.267 +                <property name="XExpand">False</property>
   9.268 +                <property name="XFill">True</property>
   9.269 +                <property name="XShrink">False</property>
   9.270 +                <property name="YExpand">False</property>
   9.271 +                <property name="YFill">True</property>
   9.272 +                <property name="YShrink">False</property>
   9.273 +              </packing>
   9.274 +            </child>
   9.275 +            <child>
   9.276 +              <widget class="Gtk.Label" id="lblEquipment">
   9.277 +                <property name="MemberName" />
   9.278 +                <property name="LabelProp" translatable="yes">equipment</property>
   9.279 +              </widget>
   9.280 +              <packing>
   9.281 +                <property name="AutoSize">True</property>
   9.282 +                <property name="XOptions">Fill</property>
   9.283 +                <property name="YOptions">Fill</property>
   9.284 +                <property name="XExpand">False</property>
   9.285 +                <property name="XFill">True</property>
   9.286 +                <property name="XShrink">False</property>
   9.287 +                <property name="YExpand">False</property>
   9.288 +                <property name="YFill">True</property>
   9.289 +                <property name="YShrink">False</property>
   9.290 +              </packing>
   9.291 +            </child>
   9.292 +          </widget>
   9.293 +          <packing>
   9.294 +            <property name="Position">0</property>
   9.295 +            <property name="AutoSize">True</property>
   9.296 +            <property name="Expand">False</property>
   9.297 +            <property name="Fill">False</property>
   9.298 +          </packing>
   9.299          </child>
   9.300        </widget>
   9.301      </child>