[longomatch/redesign2: 109/159] Add a base class for templates editors



commit abdb9239c2ab7c01729742749ce08f3359cb23a4
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Wed Mar 30 22:15:53 2011 +0200

    Add  a base class for templates editors

 LongoMatch/Gui/Component/ProjectTemplateWidget.cs  |  245 --------------
 LongoMatch/Gui/Component/TemplatesEditorBase.cs    |  333 ++++++++++++++++++++
 LongoMatch/Gui/Dialog/TeamTemplateEditor.cs        |   42 ---
 LongoMatch/Gui/Dialog/TemplatesEditor.cs           |  289 -----------------
 .../LongoMatch.Gui.Component.TeamTemplateWidget.cs |   45 ---
 ...ongoMatch.Gui.Component.TemplatesEditorBase.cs} |  195 ++++++------
 6 files changed, 427 insertions(+), 722 deletions(-)
---
diff --git a/LongoMatch/Gui/Component/TemplatesEditorBase.cs b/LongoMatch/Gui/Component/TemplatesEditorBase.cs
new file mode 100644
index 0000000..3b6a25b
--- /dev/null
+++ b/LongoMatch/Gui/Component/TemplatesEditorBase.cs
@@ -0,0 +1,333 @@
+// CategoriesPropertiesWidget.cs
+//  Copyright (C) 2007-2009 Andoni Morales Alastruey
+//
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation; either version 2 of the License, or
+// (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
+//
+//
+using System;
+using System.Collections.Generic;
+using System.IO;
+using Gdk;
+using Gtk;
+
+using LongoMatch.Gui.Dialog;
+using LongoMatch.Interfaces;
+using LongoMatch.IO;
+using LongoMatch.Store;
+using LongoMatch.Store.Templates;
+using Mono.Unix;
+
+
+namespace LongoMatch.Gui.Component
+{
+
+
+	[System.ComponentModel.Category("LongoMatch")]
+	[System.ComponentModel.ToolboxItem(true)]
+	public partial class TemplatesEditorBase : Gtk.Bin
+	{
+		public TemplatesEditorBase()
+		{
+			this.Build();
+		}
+		
+		public bool CanExport {
+			get {
+				return hseparator1.Visible;
+			}
+			set {
+				hseparator1.Visible = value;
+				exportbutton.Visible = value;
+			}
+		}
+		public bool Edited {
+			get;
+			set;
+		}
+		
+		public bool InProject {
+			get;
+			set;
+		}
+		
+		protected void AddTreeView (Widget w) {
+			scrolledwindow2.Add(w);
+			w.Show();
+		}
+		
+		protected bool ButtonsSensitive {
+			set {
+				newprevbutton.Sensitive = value;
+				newafterbutton.Sensitive = value;
+				removebutton.Sensitive = value;
+				editbutton.Sensitive = value;
+			}
+		}
+		
+		protected void MultipleSelection() {
+			newprevbutton.Sensitive = false;
+			newafterbutton.Sensitive = false;
+			removebutton.Sensitive = true;
+			editbutton.Sensitive = false;
+		}
+
+		protected virtual void OnNewAfter(object sender, EventArgs args) {}
+
+		protected virtual void OnNewBefore(object sender, EventArgs args) {}
+
+		protected virtual void OnRemove(object sender, EventArgs args) {}
+
+		protected virtual void OnEdit(object sender, EventArgs args) {}
+
+		protected virtual void OnKeyPressEvent(object o, Gtk.KeyPressEventArgs args) {}
+		
+		protected virtual void OnExportbuttonClicked(object sender, System.EventArgs e) {}
+	}
+	
+	public abstract class TemplatesEditorWidget<T, U> : TemplatesEditorBase, ITemplateWidget<T, U> where T: ITemplate<U>
+	{
+		protected T template;
+		protected List<U> selected;
+		protected ITemplateProvider<T, U> provider;
+		
+		public TemplatesEditorWidget (): base()
+		{
+			provider = MainClass.ts.GetTemplateProvider<T, U>();
+		}
+		
+		public abstract T Template {get; set;}
+		
+		protected void UpdateModel() {
+			Template = Template;
+		}
+
+		protected virtual void RemoveSelected() {
+			UpdateModel();
+			Edited = true;
+			selected = null;
+			ButtonsSensitive=false;
+		}
+
+		protected abstract void EditSelected();
+		
+		protected abstract void AddItem(int item);
+
+		protected override void OnNewAfter(object sender, EventArgs args) {
+			AddItem(template.IndexOf(selected[0])+1);
+		}
+
+		protected override void OnNewBefore(object sender, EventArgs args) {
+			AddItem(template.IndexOf(selected[0]));
+		}
+
+		protected override void OnRemove(object sender, EventArgs args) {
+			RemoveSelected();
+		}
+
+		protected override void OnEdit(object sender, EventArgs args) {
+			EditSelected();
+		}
+
+		protected override  void OnKeyPressEvent(object o, Gtk.KeyPressEventArgs args)
+		{
+			if(args.Event.Key == Gdk.Key.Delete && selected != null)
+				RemoveSelected();
+		}
+
+		protected override void OnExportbuttonClicked(object sender, System.EventArgs e)
+		{
+			EntryDialog dialog = new EntryDialog();
+			dialog.TransientFor = (Gtk.Window)this.Toplevel;
+			dialog.ShowCount = false;
+			dialog.Text = Catalog.GetString("New template");
+			if(dialog.Run() == (int)ResponseType.Ok) {
+				if(dialog.Text == "")
+					MessagePopup.PopupMessage(dialog, MessageType.Error,
+					                          Catalog.GetString("The template name is void."));
+				else if(provider.Exists(dialog.Text)) {
+					MessageDialog md = new MessageDialog(null,
+					                                     DialogFlags.Modal,
+					                                     MessageType.Question,
+					                                     Gtk.ButtonsType.YesNo,
+					                                     Catalog.GetString("The template already exists. " +
+					                                                     "Do you want to overwrite it ?")
+					                                    );
+					if(md.Run() == (int)ResponseType.Yes){
+						Template.Name = dialog.Text;
+						provider.Save (Template);
+					}
+					md.Destroy();
+				}
+				else {
+					Template.Name = dialog.Text;
+					provider.Save (Template);
+				}
+			}
+			dialog.Destroy();
+		}
+	}
+	
+	public class CategoriesTemplateEditorWidget: TemplatesEditorWidget<Categories, Category> 
+	{
+		private CategoriesTreeView categoriestreeview;
+		private List<HotKey> hkList;
+
+		public CategoriesTemplateEditorWidget (): base()
+		{
+			hkList = new List<HotKey>();
+			categoriestreeview = new CategoriesTreeView();
+			categoriestreeview.CategoryClicked += this.OnCategoryClicked;
+			categoriestreeview.CategoriesSelected += this.OnCategoriesSelected;
+			AddTreeView(categoriestreeview);
+		}
+		
+		public override Categories Template {
+			get {
+				return template;
+			}
+			set {
+				template = value;
+				Edited = false;
+				Gtk.TreeStore categoriesListStore = new Gtk.TreeStore(typeof(Category));
+				hkList.Clear();
+
+				foreach(var cat in template) {
+					categoriesListStore.AppendValues(cat);
+					try {
+						hkList.Add(cat.HotKey);
+					} catch {}; //Do not add duplicated hotkeys
+				}
+				categoriestreeview.Model = categoriesListStore;
+				ButtonsSensitive = false;
+			}
+		}
+		
+		protected override void AddItem(int index) {
+			UpdateModel();
+			Edited = true;
+		}
+
+
+		protected override void RemoveSelected (){
+			if(InProject) {
+				MessageDialog dialog = new MessageDialog((Gtk.Window)this.Toplevel,DialogFlags.Modal,MessageType.Question,
+				                                         ButtonsType.YesNo,true,
+				                                         Catalog.GetString("You are about to delete a category and all the plays added to this category. Do you want to proceed?"));
+				if(dialog.Run() == (int)ResponseType.Yes) {
+					try {
+						foreach(var item in selected)
+							template.Remove(item);
+					} catch {
+						MessagePopup.PopupMessage(this,MessageType.Warning,
+						                          Catalog.GetString("A template needs at least one category"));
+					}
+				}
+				dialog.Destroy();
+			} else {
+				foreach(Category cat in selected) {
+					if(template.Count == 1) {
+						MessagePopup.PopupMessage(this,MessageType.Warning,
+						                          Catalog.GetString("A template needs at least one category"));
+					} else
+						template.Remove(cat);
+				}
+			}	
+			base.RemoveSelected();
+		}
+		
+		protected override void EditSelected() {
+			EditCategoryDialog dialog = new EditCategoryDialog();
+			dialog.Category = selected[0];
+			dialog.HotKeysList = hkList;
+			dialog.TransientFor = (Gtk.Window) Toplevel;
+			dialog.Run();
+			dialog.Destroy();
+			Edited = true;
+		}
+		private void OnCategoryClicked(Category cat)
+		{
+			selected = new List<Category> ();
+			selected.Add (cat);
+			EditSelected();
+		}
+
+		private void OnCategoriesSelected(List<Category> catList)
+		{
+			selected = catList;
+			if(catList.Count == 0)
+				ButtonsSensitive = false;
+			else if(catList.Count == 1) {
+				ButtonsSensitive = true;
+			}
+			else {
+				MultipleSelection();
+			}
+		}
+	}
+	
+	
+	public class TeamTemplateEditorWidget: TemplatesEditorWidget<TeamTemplate, Player>
+	{	
+		private PlayerPropertiesTreeView treeview;
+		
+		public TeamTemplateEditorWidget () {
+			treeview = new PlayerPropertiesTreeView(); 
+			treeview.PlayerClicked += this.OnPlayerClicked;
+			treeview.PlayerSelected += this.OnPlayersSelected;
+			AddTreeView(treeview);
+		}
+		
+		public override  TeamTemplate Template {
+			get {
+				return template;
+			}
+			set {
+				template= value;
+				Edited = false;
+				Gtk.TreeStore playersListStore = new Gtk.TreeStore(typeof(Player));
+				foreach(Player player in template)
+					playersListStore.AppendValues(player);
+				treeview.Model=playersListStore;
+			}
+		}
+		
+		protected override void AddItem(int index) {
+			UpdateModel();
+			Edited = true;
+		}
+
+		protected override void EditSelected() {
+			LongoMatch.Gui.Dialog.EditPlayerDialog dialog = new LongoMatch.Gui.Dialog.EditPlayerDialog();
+			dialog.Player=selected[0];
+			dialog.TransientFor = (Gtk.Window) Toplevel;
+			dialog.Run();
+			dialog.Destroy();
+			Edited = true;
+		}
+
+		protected virtual void OnPlayerClicked(LongoMatch.Store.Player player)
+		{
+			selected = new List<Player>();
+			selected.Add(player);
+			EditSelected();
+		}
+
+		protected virtual void OnPlayersSelected(LongoMatch.Store.Player player)
+		{
+			selected = new List<Player>();
+			selected.Add(player);
+		}
+	}
+}
diff --git a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.ProjectTemplateWidget.cs b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TemplatesEditorBase.cs
similarity index 61%
rename from LongoMatch/gtk-gui/LongoMatch.Gui.Component.ProjectTemplateWidget.cs
rename to LongoMatch/gtk-gui/LongoMatch.Gui.Component.TemplatesEditorBase.cs
index 3c8de3f..e3e885a 100644
--- a/LongoMatch/gtk-gui/LongoMatch.Gui.Component.ProjectTemplateWidget.cs
+++ b/LongoMatch/gtk-gui/LongoMatch.Gui.Component.TemplatesEditorBase.cs
@@ -2,14 +2,12 @@
 // This file has been generated by the GUI designer. Do not modify.
 namespace LongoMatch.Gui.Component
 {
-	public partial class ProjectTemplateWidget
+	public partial class TemplatesEditorBase
 	{
 		private global::Gtk.HBox hbox1;
 
 		private global::Gtk.ScrolledWindow scrolledwindow2;
 
-		private global::LongoMatch.Gui.Component.CategoriesTreeView categoriestreeview;
-
 		private global::Gtk.VBox vbox2;
 
 		private global::Gtk.Button newprevbutton;
@@ -27,10 +25,10 @@ namespace LongoMatch.Gui.Component
 		protected virtual void Build ()
 		{
 			global::Stetic.Gui.Initialize (this);
-			// Widget LongoMatch.Gui.Component.ProjectTemplateWidget
+			// Widget LongoMatch.Gui.Component.TemplatesEditorBase
 			global::Stetic.BinContainer.Attach (this);
-			this.Name = "LongoMatch.Gui.Component.ProjectTemplateWidget";
-			// Container child LongoMatch.Gui.Component.ProjectTemplateWidget.Gtk.Container+ContainerChild
+			this.Name = "LongoMatch.Gui.Component.TemplatesEditorBase";
+			// Container child LongoMatch.Gui.Component.TemplatesEditorBase.Gtk.Container+ContainerChild
 			this.hbox1 = new global::Gtk.HBox ();
 			this.hbox1.Name = "hbox1";
 			this.hbox1.Spacing = 6;
@@ -39,14 +37,9 @@ namespace LongoMatch.Gui.Component
 			this.scrolledwindow2.CanFocus = true;
 			this.scrolledwindow2.Name = "scrolledwindow2";
 			this.scrolledwindow2.ShadowType = ((global::Gtk.ShadowType)(1));
-			// Container child scrolledwindow2.Gtk.Container+ContainerChild
-			this.categoriestreeview = new global::LongoMatch.Gui.Component.CategoriesTreeView ();
-			this.categoriestreeview.CanFocus = true;
-			this.categoriestreeview.Name = "categoriestreeview";
-			this.scrolledwindow2.Add (this.categoriestreeview);
 			this.hbox1.Add (this.scrolledwindow2);
-			global::Gtk.Box.BoxChild w2 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.scrolledwindow2]));
-			w2.Position = 0;
+			global::Gtk.Box.BoxChild w1 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.scrolledwindow2]));
+			w1.Position = 0;
 			// Container child hbox1.Gtk.Box+BoxChild
 			this.vbox2 = new global::Gtk.VBox ();
 			this.vbox2.Name = "vbox2";
@@ -59,26 +52,26 @@ namespace LongoMatch.Gui.Component
 			this.newprevbutton.Name = "newprevbutton";
 			this.newprevbutton.UseUnderline = true;
 			// Container child newprevbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w3 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
+			global::Gtk.Alignment w2 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w4 = new global::Gtk.HBox ();
-			w4.Spacing = 2;
-			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w5 = new global::Gtk.Image ();
-			w5.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-top", global::Gtk.IconSize.Menu);
-			w4.Add (w5);
+			global::Gtk.HBox w3 = new global::Gtk.HBox ();
+			w3.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w7 = new global::Gtk.Label ();
-			w7.LabelProp = global::Mono.Unix.Catalog.GetString ("New Before");
-			w7.UseUnderline = true;
-			w4.Add (w7);
+			global::Gtk.Image w4 = new global::Gtk.Image ();
+			w4.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-top", global::Gtk.IconSize.Menu);
 			w3.Add (w4);
-			this.newprevbutton.Add (w3);
+			// Container child GtkHBox.Gtk.Container+ContainerChild
+			global::Gtk.Label w6 = new global::Gtk.Label ();
+			w6.LabelProp = global::Mono.Unix.Catalog.GetString ("New Before");
+			w6.UseUnderline = true;
+			w3.Add (w6);
+			w2.Add (w3);
+			this.newprevbutton.Add (w2);
 			this.vbox2.Add (this.newprevbutton);
-			global::Gtk.Box.BoxChild w11 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.newprevbutton]));
-			w11.Position = 0;
-			w11.Expand = false;
-			w11.Fill = false;
+			global::Gtk.Box.BoxChild w10 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.newprevbutton]));
+			w10.Position = 0;
+			w10.Expand = false;
+			w10.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.newafterbutton = new global::Gtk.Button ();
 			this.newafterbutton.TooltipMarkup = "Insert a new category after the selected one";
@@ -87,26 +80,26 @@ namespace LongoMatch.Gui.Component
 			this.newafterbutton.Name = "newafterbutton";
 			this.newafterbutton.UseUnderline = true;
 			// Container child newafterbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w12 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
+			global::Gtk.Alignment w11 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w13 = new global::Gtk.HBox ();
-			w13.Spacing = 2;
+			global::Gtk.HBox w12 = new global::Gtk.HBox ();
+			w12.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w14 = new global::Gtk.Image ();
-			w14.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-bottom", global::Gtk.IconSize.Menu);
-			w13.Add (w14);
-			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w16 = new global::Gtk.Label ();
-			w16.LabelProp = global::Mono.Unix.Catalog.GetString ("New After");
-			w16.UseUnderline = true;
-			w13.Add (w16);
+			global::Gtk.Image w13 = new global::Gtk.Image ();
+			w13.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-goto-bottom", global::Gtk.IconSize.Menu);
 			w12.Add (w13);
-			this.newafterbutton.Add (w12);
+			// Container child GtkHBox.Gtk.Container+ContainerChild
+			global::Gtk.Label w15 = new global::Gtk.Label ();
+			w15.LabelProp = global::Mono.Unix.Catalog.GetString ("New After");
+			w15.UseUnderline = true;
+			w12.Add (w15);
+			w11.Add (w12);
+			this.newafterbutton.Add (w11);
 			this.vbox2.Add (this.newafterbutton);
-			global::Gtk.Box.BoxChild w20 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.newafterbutton]));
-			w20.Position = 1;
-			w20.Expand = false;
-			w20.Fill = false;
+			global::Gtk.Box.BoxChild w19 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.newafterbutton]));
+			w19.Position = 1;
+			w19.Expand = false;
+			w19.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.removebutton = new global::Gtk.Button ();
 			this.removebutton.TooltipMarkup = "Remove the selected category";
@@ -115,26 +108,26 @@ namespace LongoMatch.Gui.Component
 			this.removebutton.Name = "removebutton";
 			this.removebutton.UseUnderline = true;
 			// Container child removebutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w21 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
+			global::Gtk.Alignment w20 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w22 = new global::Gtk.HBox ();
-			w22.Spacing = 2;
+			global::Gtk.HBox w21 = new global::Gtk.HBox ();
+			w21.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w23 = new global::Gtk.Image ();
-			w23.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Menu);
-			w22.Add (w23);
-			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w25 = new global::Gtk.Label ();
-			w25.LabelProp = global::Mono.Unix.Catalog.GetString ("Remove");
-			w25.UseUnderline = true;
-			w22.Add (w25);
+			global::Gtk.Image w22 = new global::Gtk.Image ();
+			w22.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-remove", global::Gtk.IconSize.Menu);
 			w21.Add (w22);
-			this.removebutton.Add (w21);
+			// Container child GtkHBox.Gtk.Container+ContainerChild
+			global::Gtk.Label w24 = new global::Gtk.Label ();
+			w24.LabelProp = global::Mono.Unix.Catalog.GetString ("Remove");
+			w24.UseUnderline = true;
+			w21.Add (w24);
+			w20.Add (w21);
+			this.removebutton.Add (w20);
 			this.vbox2.Add (this.removebutton);
-			global::Gtk.Box.BoxChild w29 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.removebutton]));
-			w29.Position = 2;
-			w29.Expand = false;
-			w29.Fill = false;
+			global::Gtk.Box.BoxChild w28 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.removebutton]));
+			w28.Position = 2;
+			w28.Expand = false;
+			w28.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.editbutton = new global::Gtk.Button ();
 			this.editbutton.TooltipMarkup = "Edit the selected category";
@@ -143,34 +136,34 @@ namespace LongoMatch.Gui.Component
 			this.editbutton.Name = "editbutton";
 			this.editbutton.UseUnderline = true;
 			// Container child editbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w30 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
+			global::Gtk.Alignment w29 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w31 = new global::Gtk.HBox ();
-			w31.Spacing = 2;
+			global::Gtk.HBox w30 = new global::Gtk.HBox ();
+			w30.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w32 = new global::Gtk.Image ();
-			w32.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-edit", global::Gtk.IconSize.Menu);
-			w31.Add (w32);
-			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w34 = new global::Gtk.Label ();
-			w34.LabelProp = global::Mono.Unix.Catalog.GetString ("Edit");
-			w34.UseUnderline = true;
-			w31.Add (w34);
+			global::Gtk.Image w31 = new global::Gtk.Image ();
+			w31.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-edit", global::Gtk.IconSize.Menu);
 			w30.Add (w31);
-			this.editbutton.Add (w30);
+			// Container child GtkHBox.Gtk.Container+ContainerChild
+			global::Gtk.Label w33 = new global::Gtk.Label ();
+			w33.LabelProp = global::Mono.Unix.Catalog.GetString ("Edit");
+			w33.UseUnderline = true;
+			w30.Add (w33);
+			w29.Add (w30);
+			this.editbutton.Add (w29);
 			this.vbox2.Add (this.editbutton);
-			global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.editbutton]));
-			w38.Position = 3;
-			w38.Expand = false;
-			w38.Fill = false;
+			global::Gtk.Box.BoxChild w37 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.editbutton]));
+			w37.Position = 3;
+			w37.Expand = false;
+			w37.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.hseparator1 = new global::Gtk.HSeparator ();
 			this.hseparator1.Name = "hseparator1";
 			this.vbox2.Add (this.hseparator1);
-			global::Gtk.Box.BoxChild w39 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hseparator1]));
-			w39.Position = 4;
-			w39.Expand = false;
-			w39.Fill = false;
+			global::Gtk.Box.BoxChild w38 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.hseparator1]));
+			w38.Position = 4;
+			w38.Expand = false;
+			w38.Fill = false;
 			// Container child vbox2.Gtk.Box+BoxChild
 			this.exportbutton = new global::Gtk.Button ();
 			this.exportbutton.TooltipMarkup = "Export the template to a file";
@@ -178,32 +171,32 @@ namespace LongoMatch.Gui.Component
 			this.exportbutton.Name = "exportbutton";
 			this.exportbutton.UseUnderline = true;
 			// Container child exportbutton.Gtk.Container+ContainerChild
-			global::Gtk.Alignment w40 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
+			global::Gtk.Alignment w39 = new global::Gtk.Alignment (0.5f, 0.5f, 0f, 0f);
 			// Container child GtkAlignment.Gtk.Container+ContainerChild
-			global::Gtk.HBox w41 = new global::Gtk.HBox ();
-			w41.Spacing = 2;
+			global::Gtk.HBox w40 = new global::Gtk.HBox ();
+			w40.Spacing = 2;
 			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Image w42 = new global::Gtk.Image ();
-			w42.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save-as", global::Gtk.IconSize.Menu);
-			w41.Add (w42);
-			// Container child GtkHBox.Gtk.Container+ContainerChild
-			global::Gtk.Label w44 = new global::Gtk.Label ();
-			w44.LabelProp = global::Mono.Unix.Catalog.GetString ("Export");
-			w44.UseUnderline = true;
-			w41.Add (w44);
+			global::Gtk.Image w41 = new global::Gtk.Image ();
+			w41.Pixbuf = global::Stetic.IconLoader.LoadIcon (this, "gtk-save-as", global::Gtk.IconSize.Menu);
 			w40.Add (w41);
-			this.exportbutton.Add (w40);
+			// Container child GtkHBox.Gtk.Container+ContainerChild
+			global::Gtk.Label w43 = new global::Gtk.Label ();
+			w43.LabelProp = global::Mono.Unix.Catalog.GetString ("Export");
+			w43.UseUnderline = true;
+			w40.Add (w43);
+			w39.Add (w40);
+			this.exportbutton.Add (w39);
 			this.vbox2.Add (this.exportbutton);
-			global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.exportbutton]));
-			w48.PackType = ((global::Gtk.PackType)(1));
-			w48.Position = 5;
+			global::Gtk.Box.BoxChild w47 = ((global::Gtk.Box.BoxChild)(this.vbox2[this.exportbutton]));
+			w47.PackType = ((global::Gtk.PackType)(1));
+			w47.Position = 5;
+			w47.Expand = false;
+			w47.Fill = false;
+			this.hbox1.Add (this.vbox2);
+			global::Gtk.Box.BoxChild w48 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox2]));
+			w48.Position = 1;
 			w48.Expand = false;
 			w48.Fill = false;
-			this.hbox1.Add (this.vbox2);
-			global::Gtk.Box.BoxChild w49 = ((global::Gtk.Box.BoxChild)(this.hbox1[this.vbox2]));
-			w49.Position = 1;
-			w49.Expand = false;
-			w49.Fill = false;
 			this.Add (this.hbox1);
 			if ((this.Child != null)) {
 				this.Child.ShowAll ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]