changeset 99:8777e4f64d8e

Fixes #335: Show current points total in status bar * Add label to status bar and set the text on points value change
author IBBoard <dev@ibboard.co.uk>
date Sun, 16 Jan 2011 19:50:48 +0000
parents fac0636ae13b
children 23b1c3bdc525
files FrmMainWindow.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs gtk-gui/gui.stetic
diffstat 3 files changed, 30 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/FrmMainWindow.cs	Sun Jan 02 21:03:15 2011 +0000
+++ b/FrmMainWindow.cs	Sun Jan 16 19:50:48 2011 +0000
@@ -400,7 +400,7 @@
 
 		private void OnPointsValueChanged(WarFoundryObject obj, double before, double after)
 		{
-			//Set points in panel
+			SetPointsPanelText();
 		}
 
 		private void OnFailedUnitRequirement(List<FailedUnitRequirement> failedRequirement)
@@ -655,7 +655,14 @@
 
 		private void SetPointsPanelText()
 		{
-			//TODO: Set the points value in the status bar
+			if (WarFoundryCore.CurrentArmy != null)
+			{
+				lblTotalPoints.Text = Translation.GetTranslation("statusPanelPoints", "{0}pts of {1} pts", WarFoundryCore.CurrentArmy.Points, WarFoundryCore.CurrentArmy.MaxPoints);
+			}
+			else
+			{
+				lblTotalPoints.Text = "";
+			}
 		}
 
 		private void commandStack_CommandStackUpdated()
--- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs	Sun Jan 02 21:03:15 2011 +0000
+++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmMainWindow.cs	Sun Jan 16 19:50:48 2011 +0000
@@ -36,6 +36,7 @@
 		private global::Gtk.TreeView treeUnits;
 		private global::Gtk.Notebook unitsNotebook;
 		private global::Gtk.Statusbar statusbar1;
+		private global::Gtk.Label lblTotalPoints;
 
 		protected virtual void Build()
 		{
@@ -173,11 +174,19 @@
 			this.statusbar1 = new global::Gtk.Statusbar();
 			this.statusbar1.Name = "statusbar1";
 			this.statusbar1.Spacing = 2;
-			this.vbox1.Add(this.statusbar1);
-			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
-			w7.Position = 3;
+			// Container child statusbar1.Gtk.Box+BoxChild
+			this.lblTotalPoints = new global::Gtk.Label();
+			this.lblTotalPoints.Name = "lblTotalPoints";
+			this.statusbar1.Add(this.lblTotalPoints);
+			global::Gtk.Box.BoxChild w7 = ((global::Gtk.Box.BoxChild)(this.statusbar1[this.lblTotalPoints]));
+			w7.Position = 2;
 			w7.Expand = false;
 			w7.Fill = false;
+			this.vbox1.Add(this.statusbar1);
+			global::Gtk.Box.BoxChild w8 = ((global::Gtk.Box.BoxChild)(this.vbox1[this.statusbar1]));
+			w8.Position = 3;
+			w8.Expand = false;
+			w8.Fill = false;
 			this.Add(this.vbox1);
 			if ((this.Child != null))
 			{
--- a/gtk-gui/gui.stetic	Sun Jan 02 21:03:15 2011 +0000
+++ b/gtk-gui/gui.stetic	Sun Jan 16 19:50:48 2011 +0000
@@ -273,7 +273,15 @@
               <placeholder />
             </child>
             <child>
-              <placeholder />
+              <widget class="Gtk.Label" id="lblTotalPoints">
+                <property name="MemberName" />
+              </widget>
+              <packing>
+                <property name="Position">2</property>
+                <property name="AutoSize">True</property>
+                <property name="Expand">False</property>
+                <property name="Fill">False</property>
+              </packing>
             </child>
           </widget>
           <packing>