00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 namespace Foodolini.Activities.Ingredients {
00012
00013
00014 public partial class IngredientsActivity {
00015
00016 private Gtk.VBox vbox2;
00017
00018 private Gtk.HBox hbox1;
00019
00020 private Gtk.Label label1;
00021
00022 private Gtk.Entry SearchEntry;
00023
00024 private Gtk.ComboBox CategoryCombobox;
00025
00026 private Gtk.ScrolledWindow GtkScrolledWindow;
00027
00028 private Gtk.NodeView ingredientsView;
00029
00030 private Gtk.HBox hbox2;
00031
00032 private Gtk.Button CreateIngredientButton;
00033
00034 private Gtk.Button EditIngredientButton;
00035
00036 protected virtual void Build() {
00037 Stetic.Gui.Initialize(this);
00038
00039 Stetic.BinContainer.Attach(this);
00040 this.Name = "Foodolini.Activities.Ingredients.IngredientsActivity";
00041
00042 this.vbox2 = new Gtk.VBox();
00043 this.vbox2.Name = "vbox2";
00044 this.vbox2.Spacing = 6;
00045
00046 this.hbox1 = new Gtk.HBox();
00047 this.hbox1.Name = "hbox1";
00048 this.hbox1.Spacing = 6;
00049
00050 this.label1 = new Gtk.Label();
00051 this.label1.Name = "label1";
00052 this.label1.LabelProp = Mono.Unix.Catalog.GetString("Search:");
00053 this.hbox1.Add(this.label1);
00054 Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.hbox1[this.label1]));
00055 w1.Position = 0;
00056 w1.Expand = false;
00057 w1.Fill = false;
00058
00059 this.SearchEntry = new Gtk.Entry();
00060 this.SearchEntry.TooltipMarkup = "Search ingredients by title";
00061 this.SearchEntry.CanFocus = true;
00062 this.SearchEntry.Name = "SearchEntry";
00063 this.SearchEntry.IsEditable = true;
00064 this.SearchEntry.InvisibleChar = '●';
00065 this.hbox1.Add(this.SearchEntry);
00066 Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.hbox1[this.SearchEntry]));
00067 w2.Position = 1;
00068
00069 this.CategoryCombobox = Gtk.ComboBox.NewText();
00070 this.CategoryCombobox.TooltipMarkup = "The category to perform the search in";
00071 this.CategoryCombobox.Name = "CategoryCombobox";
00072 this.hbox1.Add(this.CategoryCombobox);
00073 Gtk.Box.BoxChild w3 = ((Gtk.Box.BoxChild)(this.hbox1[this.CategoryCombobox]));
00074 w3.Position = 2;
00075 w3.Expand = false;
00076 w3.Fill = false;
00077 this.vbox2.Add(this.hbox1);
00078 Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbox1]));
00079 w4.Position = 0;
00080 w4.Expand = false;
00081 w4.Fill = false;
00082
00083 this.GtkScrolledWindow = new Gtk.ScrolledWindow();
00084 this.GtkScrolledWindow.Name = "GtkScrolledWindow";
00085 this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
00086
00087 this.ingredientsView = new Gtk.NodeView();
00088 this.ingredientsView.CanFocus = true;
00089 this.ingredientsView.Name = "ingredientsView";
00090 this.ingredientsView.EnableSearch = false;
00091 this.GtkScrolledWindow.Add(this.ingredientsView);
00092 this.vbox2.Add(this.GtkScrolledWindow);
00093 Gtk.Box.BoxChild w6 = ((Gtk.Box.BoxChild)(this.vbox2[this.GtkScrolledWindow]));
00094 w6.Position = 1;
00095
00096 this.hbox2 = new Gtk.HBox();
00097 this.hbox2.Name = "hbox2";
00098 this.hbox2.Spacing = 6;
00099
00100 this.CreateIngredientButton = new Gtk.Button();
00101 this.CreateIngredientButton.TooltipMarkup = "Create a new ingredient";
00102 this.CreateIngredientButton.CanFocus = true;
00103 this.CreateIngredientButton.Name = "CreateIngredientButton";
00104 this.CreateIngredientButton.UseUnderline = true;
00105
00106 Gtk.Alignment w7 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
00107
00108 Gtk.HBox w8 = new Gtk.HBox();
00109 w8.Spacing = 2;
00110
00111 Gtk.Image w9 = new Gtk.Image();
00112 w9.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
00113 w8.Add(w9);
00114
00115 Gtk.Label w11 = new Gtk.Label();
00116 w11.LabelProp = Mono.Unix.Catalog.GetString("_Create ingredient");
00117 w11.UseUnderline = true;
00118 w8.Add(w11);
00119 w7.Add(w8);
00120 this.CreateIngredientButton.Add(w7);
00121 this.hbox2.Add(this.CreateIngredientButton);
00122 Gtk.Box.BoxChild w15 = ((Gtk.Box.BoxChild)(this.hbox2[this.CreateIngredientButton]));
00123 w15.Position = 0;
00124 w15.Expand = false;
00125 w15.Fill = false;
00126
00127 this.EditIngredientButton = new Gtk.Button();
00128 this.EditIngredientButton.TooltipMarkup = "Edit the selected ingredient";
00129 this.EditIngredientButton.Sensitive = false;
00130 this.EditIngredientButton.CanFocus = true;
00131 this.EditIngredientButton.Name = "EditIngredientButton";
00132 this.EditIngredientButton.UseUnderline = true;
00133
00134 Gtk.Alignment w16 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
00135
00136 Gtk.HBox w17 = new Gtk.HBox();
00137 w17.Spacing = 2;
00138
00139 Gtk.Image w18 = new Gtk.Image();
00140 w18.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-edit", Gtk.IconSize.Menu, 16);
00141 w17.Add(w18);
00142
00143 Gtk.Label w20 = new Gtk.Label();
00144 w20.LabelProp = Mono.Unix.Catalog.GetString("Edit ingredient");
00145 w20.UseUnderline = true;
00146 w17.Add(w20);
00147 w16.Add(w17);
00148 this.EditIngredientButton.Add(w16);
00149 this.hbox2.Add(this.EditIngredientButton);
00150 Gtk.Box.BoxChild w24 = ((Gtk.Box.BoxChild)(this.hbox2[this.EditIngredientButton]));
00151 w24.Position = 1;
00152 w24.Expand = false;
00153 w24.Fill = false;
00154 this.vbox2.Add(this.hbox2);
00155 Gtk.Box.BoxChild w25 = ((Gtk.Box.BoxChild)(this.vbox2[this.hbox2]));
00156 w25.Position = 2;
00157 w25.Expand = false;
00158 w25.Fill = false;
00159 this.Add(this.vbox2);
00160 if ((this.Child != null)) {
00161 this.Child.ShowAll();
00162 }
00163 this.Hide();
00164 this.SearchEntry.Changed += new System.EventHandler(this.OnSearchEntryChanged);
00165 this.CategoryCombobox.Changed += new System.EventHandler(this.OnSearchEntryChanged);
00166 this.ingredientsView.RowActivated += new Gtk.RowActivatedHandler(this.OnIngredientsViewRowActivated);
00167 this.ingredientsView.ButtonPressEvent += new Gtk.ButtonPressEventHandler(this.OnIngredientsViewButtonPressEvent);
00168 this.ingredientsView.CursorChanged += new System.EventHandler(this.OnIngredientsViewCursorChanged);
00169 this.CreateIngredientButton.Clicked += new System.EventHandler(this.OnCreateIngredientButtonClicked);
00170 this.EditIngredientButton.Clicked += new System.EventHandler(this.OnEditIngredientButtonClicked);
00171 }
00172 }
00173 }