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 diff
     1.1 --- a/FrmNewUnit.cs	Wed Dec 29 20:56:03 2010 +0000
     1.2 +++ b/FrmNewUnit.cs	Thu Dec 30 21:00:00 2010 +0000
     1.3 @@ -51,7 +51,6 @@
     1.4  			base.Translate();
     1.5  			lstUnitTypes.Columns[0].Title = Translation.GetTranslation("frmNewUnitNewUnitColumn", "unit type");
     1.6  			Title = Translation.GetTranslation(Name, "Create new unit", cat.Name);
     1.7 -			ControlTranslator.TranslateButtons(bttnCreate, bttnCancel);
     1.8  		}
     1.9  
    1.10  		private void RenderUnitTypeName(TreeViewColumn column, CellRenderer cell, TreeModel model, TreeIter iter)
     2.1 --- a/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs	Wed Dec 29 20:56:03 2010 +0000
     2.2 +++ b/gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs	Thu Dec 30 21:00:00 2010 +0000
     2.3 @@ -10,8 +10,8 @@
     2.4  		private global::Gtk.ScrolledWindow GtkScrolledWindow;
     2.5  		private global::Gtk.TreeView lstUnitTypes;
     2.6  		private global::Gtk.Label lblNewUnitWarning;
     2.7 -		private global::Gtk.Button bttnCancel;
     2.8 -		private global::Gtk.Button bttnCreate;
     2.9 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCancel;
    2.10 +		private global::IBBoard.GtkSharp.Translatable.TranslatableButton bttnCreate;
    2.11  
    2.12  		protected virtual void Build()
    2.13  		{
    2.14 @@ -86,8 +86,7 @@
    2.15  			w8.BorderWidth = ((uint)(5));
    2.16  			w8.LayoutStyle = ((global::Gtk.ButtonBoxStyle)(4));
    2.17  			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
    2.18 -			this.bttnCancel = new global::Gtk.Button();
    2.19 -			this.bttnCancel.CanDefault = true;
    2.20 +			this.bttnCancel = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
    2.21  			this.bttnCancel.CanFocus = true;
    2.22  			this.bttnCancel.Name = "bttnCancel";
    2.23  			this.bttnCancel.UseStock = true;
    2.24 @@ -98,9 +97,7 @@
    2.25  			w9.Expand = false;
    2.26  			w9.Fill = false;
    2.27  			// Container child dialog1_ActionArea.Gtk.ButtonBox+ButtonBoxChild
    2.28 -			this.bttnCreate = new global::Gtk.Button();
    2.29 -			this.bttnCreate.Sensitive = false;
    2.30 -			this.bttnCreate.CanDefault = true;
    2.31 +			this.bttnCreate = new global::IBBoard.GtkSharp.Translatable.TranslatableButton();
    2.32  			this.bttnCreate.CanFocus = true;
    2.33  			this.bttnCreate.Name = "bttnCreate";
    2.34  			this.bttnCreate.UseStock = true;
    2.35 @@ -115,12 +112,10 @@
    2.36  			{
    2.37  				this.Child.ShowAll();
    2.38  			}
    2.39 -			this.DefaultWidth = 400;
    2.40 -			this.DefaultHeight = 318;
    2.41 +			this.DefaultWidth = 403;
    2.42 +			this.DefaultHeight = 259;
    2.43  			this.Show();
    2.44  			this.lstUnitTypes.RowActivated += new global::Gtk.RowActivatedHandler(this.OnRowActivated);
    2.45 -			this.bttnCancel.Activated += new global::System.EventHandler(this.OnButtonCancelActivated);
    2.46 -			this.bttnCreate.Clicked += new global::System.EventHandler(this.OnButtonOkClicked);
    2.47  		}
    2.48  	}
    2.49  }
     3.1 --- a/gtk-gui/gui.stetic	Wed Dec 29 20:56:03 2010 +0000
     3.2 +++ b/gtk-gui/gui.stetic	Thu Dec 30 21:00:00 2010 +0000
     3.3 @@ -552,7 +552,7 @@
     3.4        </widget>
     3.5      </child>
     3.6    </widget>
     3.7 -  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmNewUnit" design-size="400 318">
     3.8 +  <widget class="Gtk.Dialog" id="IBBoard.WarFoundry.GUI.GTK.FrmNewUnit" design-size="403 259">
     3.9      <property name="MemberName" />
    3.10      <property name="Title" translatable="yes">Add new unit</property>
    3.11      <property name="Icon">stock:gtk-new Menu</property>
    3.12 @@ -645,15 +645,13 @@
    3.13          <property name="Size">2</property>
    3.14          <property name="LayoutStyle">End</property>
    3.15          <child>
    3.16 -          <widget class="Gtk.Button" id="bttnCancel">
    3.17 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCancel">
    3.18              <property name="MemberName" />
    3.19 -            <property name="CanDefault">True</property>
    3.20              <property name="CanFocus">True</property>
    3.21              <property name="UseStock">True</property>
    3.22              <property name="Type">StockItem</property>
    3.23              <property name="StockId">gtk-cancel</property>
    3.24              <property name="ResponseId">-6</property>
    3.25 -            <signal name="Activated" handler="OnButtonCancelActivated" />
    3.26              <property name="label">gtk-cancel</property>
    3.27            </widget>
    3.28            <packing>
    3.29 @@ -662,16 +660,13 @@
    3.30            </packing>
    3.31          </child>
    3.32          <child>
    3.33 -          <widget class="Gtk.Button" id="bttnCreate">
    3.34 +          <widget class="IBBoard.GtkSharp.Translatable.TranslatableButton" id="bttnCreate">
    3.35              <property name="MemberName" />
    3.36 -            <property name="Sensitive">False</property>
    3.37 -            <property name="CanDefault">True</property>
    3.38              <property name="CanFocus">True</property>
    3.39              <property name="UseStock">True</property>
    3.40              <property name="Type">StockItem</property>
    3.41              <property name="StockId">gtk-ok</property>
    3.42              <property name="ResponseId">-5</property>
    3.43 -            <signal name="Clicked" handler="OnButtonOkClicked" />
    3.44              <property name="label">gtk-ok</property>
    3.45            </widget>
    3.46            <packing>