# HG changeset patch # User IBBoard # Date 1293742800 0 # Node ID 31d54f67d50dcb7ba4ca14ea88316b9a9b060705 # Parent b0089e8757544d48c7ff44ebc8b7f4cbefcfee79 Re #308: Make GTK# UI translatable * Start to make use of TranslatableButtons now that we've finally got them working and usable diff -r b0089e875754 -r 31d54f67d50d FrmNewUnit.cs --- 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) diff -r b0089e875754 -r 31d54f67d50d gtk-gui/IBBoard.WarFoundry.GUI.GTK.FrmNewUnit.cs --- 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); } } } diff -r b0089e875754 -r 31d54f67d50d gtk-gui/gui.stetic --- 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 @@ - + Add new unit stock:gtk-new Menu @@ -645,15 +645,13 @@ 2 End - + - True True True StockItem gtk-cancel -6 - gtk-cancel @@ -662,16 +660,13 @@ - + - False - True True True StockItem gtk-ok -5 - gtk-ok