changeset 89:31d54f67d50d

Re #308: Make GTK# UI translatable * Start to make use of TranslatableButtons now that we've finally got them working and usable
author IBBoard <dev@ibboard.co.uk>
date Thu, 30 Dec 2010 21:00:00 +0000
parents b0089e875754
children a754a2d1881c
files FrmNewUnit.cs gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs gtk-gui/gui.stetic
diffstat 3 files changed, 9 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/FrmNewUnit.cs	Wed Dec 29 20:56:03 2010 +0000
+++ b/FrmNewUnit.cs	Thu Dec 30 21:00:00 2010 +0000
@@ -51,7 +51,6 @@
 			base.Translate();
 			lstUnitTypes.Columns[0].Title = Translation.GetTranslation("frmNewUnitNewUnitColumn", "unit type");
 			Title = Translation.GetTranslation(Name, "Create new unit", cat.Name);
-			ControlTranslator.TranslateButtons(bttnCreate, bttnCancel);
 		}
 
 		private void RenderUnitTypeName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
--- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs	Wed Dec 29 20:56:03 2010 +0000
+++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs	Thu Dec 30 21:00:00 2010 +0000
@@ -10,8 +10,8 @@
 		private global::Gtk.ScrolledWindow GtkScrolledWindow;
 		private global::Gtk.TreeView lstUnitTypes;
 		private global::Gtk.Label lblNewUnitWarning;
-		private global::Gtk.Button bttnCancel;
-		private global::Gtk.Button bttnCreate;
+		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
+		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCreate;
 
 		protected virtual void Build()
 		{
@@ -86,8 +86,7 @@
 			w8.BorderWidth = ((uint)(5));
 			w8.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
 			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
-			this.bttnCancel = new global::Gtk.Button();
-			this.bttnCancel.CanDefault = true;
+			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
 			this.bttnCancel.CanFocus = true;
 			this.bttnCancel.Name = "bttnCancel";
 			this.bttnCancel.UseStock = true;
@@ -98,9 +97,7 @@
 			w9.Expand = false;
 			w9.Fill = false;
 			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
-			this.bttnCreate = new global::Gtk.Button();
-			this.bttnCreate.Sensitive = false;
-			this.bttnCreate.CanDefault = true;
+			this.bttnCreate = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
 			this.bttnCreate.CanFocus = true;
 			this.bttnCreate.Name = "bttnCreate";
 			this.bttnCreate.UseStock = true;
@@ -115,12 +112,10 @@
 			{
 				this.Child.ShowAll();
 			}
-			this.DefaultWidth = 400;
-			this.DefaultHeight = 318;
+			this.DefaultWidth = 403;
+			this.DefaultHeight = 259;
 			this.Show();
 			this.lstUnitTypes.RowActivated += new global::Gtk.RowActivatedHandler(this.OnRowActivated);
-			this.bttnCancel.Activated += new global::System.EventHandler(this.OnButtonCancelActivated);
-			this.bttnCreate.Clicked += new global::System.EventHandler(this.OnButtonOkClicked);
 		}
 	}
 }
--- a/gtk-gui/gui.stetic	Wed Dec 29 20:56:03 2010 +0000
+++ b/gtk-gui/gui.stetic	Thu Dec 30 21:00:00 2010 +0000
@@ -552,7 +552,7 @@
       </widget>
     </child>
   </widget>
-  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmNewUnit" design-size="400 318">
+  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmNewUnit" design-size="403 259">
     <property name="MemberName" />
     <property name="Title" translatable="yes">Add new unit</property>
     <property name="Icon">stock:gtk-new Menu</property>
@@ -645,15 +645,13 @@
         <property name="Size">2</property>
         <property name="LayoutStyle">End</property>
         <child>
-          <widget class="Gtk.Button" id="bttnCancel">
+          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCancel">
             <property name="MemberName" />
-            <property name="CanDefault">True</property>
             <property name="CanFocus">True</property>
             <property name="UseStock">True</property>
             <property name="Type">StockItem</property>
             <property name="StockId">gtk-cancel</property>
             <property name="ResponseId">-6</property>
-            <signal name="Activated" handler="OnButtonCancelActivated" />
             <property name="label">gtk-cancel</property>
           </widget>
           <packing>
@@ -662,16 +660,13 @@
           </packing>
         </child>
         <child>
-          <widget class="Gtk.Button" id="bttnCreate">
+          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCreate">
             <property name="MemberName" />
-            <property name="Sensitive">False</property>
-            <property name="CanDefault">True</property>
             <property name="CanFocus">True</property>
             <property name="UseStock">True</property>
             <property name="Type">StockItem</property>
             <property name="StockId">gtk-ok</property>
             <property name="ResponseId">-5</property>
-            <signal name="Clicked" handler="OnButtonOkClicked" />
             <property name="label">gtk-ok</property>
           </widget>
           <packing>