00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 namespace Foodolini.Activities.Administration {
00012
00013
00014 public partial class AdministrationActivity {
00015
00016 private Gtk.UIManager UIManager;
00017
00018 private Gtk.HBox hbox1;
00019
00020 private Gtk.VBox vbox1;
00021
00022 private Gtk.ScrolledWindow GtkScrolledWindow;
00023
00024 private Gtk.NodeView UserView;
00025
00026 private Gtk.HButtonBox hbuttonbox1;
00027
00028 private Gtk.Button CreateNewUser;
00029
00030 private Gtk.Button DeleteUserButton;
00031
00032 private Gtk.Table CreatePersonTable;
00033
00034 private Gtk.Calendar BirthDayCalendar;
00035
00036 private Gtk.Entry FullNameEntry;
00037
00038 private Gtk.ComboBox GenderCombobox;
00039
00040 private Gtk.HButtonBox hbuttonbox2;
00041
00042 private Gtk.Button CancelNewUserButton;
00043
00044 private Gtk.Button SaveNewUserButton;
00045
00046 private Gtk.SpinButton HeightSpinbutton;
00047
00048 private Gtk.Label label1;
00049
00050 private Gtk.Label label2;
00051
00052 private Gtk.Label label3;
00053
00054 private Gtk.Label label4;
00055
00056 private Gtk.Label label5;
00057
00058 private Gtk.Label label6;
00059
00060 private Gtk.Label label7;
00061
00062 private Gtk.Entry UserNameEntry;
00063
00064 private Gtk.SpinButton WeightSpinbutton;
00065
00066 protected virtual void Build() {
00067 Stetic.Gui.Initialize(this);
00068
00069 Stetic.BinContainer w1 = Stetic.BinContainer.Attach(this);
00070 this.UIManager = new Gtk.UIManager();
00071 Gtk.ActionGroup w2 = new Gtk.ActionGroup("Default");
00072 this.UIManager.InsertActionGroup(w2, 0);
00073 this.Name = "Foodolini.Activities.Administration.AdministrationActivity";
00074
00075 this.hbox1 = new Gtk.HBox();
00076 this.hbox1.Name = "hbox1";
00077 this.hbox1.Spacing = 6;
00078
00079 this.vbox1 = new Gtk.VBox();
00080 this.vbox1.Name = "vbox1";
00081 this.vbox1.Spacing = 6;
00082
00083 this.GtkScrolledWindow = new Gtk.ScrolledWindow();
00084 this.GtkScrolledWindow.Name = "GtkScrolledWindow";
00085 this.GtkScrolledWindow.ShadowType = ((Gtk.ShadowType)(1));
00086
00087 this.UserView = new Gtk.NodeView();
00088 this.UserView.CanFocus = true;
00089 this.UserView.Name = "UserView";
00090 this.UserView.EnableSearch = false;
00091 this.GtkScrolledWindow.Add(this.UserView);
00092 this.vbox1.Add(this.GtkScrolledWindow);
00093 Gtk.Box.BoxChild w4 = ((Gtk.Box.BoxChild)(this.vbox1[this.GtkScrolledWindow]));
00094 w4.Position = 0;
00095
00096 this.hbuttonbox1 = new Gtk.HButtonBox();
00097 this.hbuttonbox1.Spacing = 5;
00098 this.hbuttonbox1.LayoutStyle = ((Gtk.ButtonBoxStyle)(3));
00099
00100 this.CreateNewUser = new Gtk.Button();
00101 this.CreateNewUser.TooltipMarkup = "Add a new user to the system";
00102 this.CreateNewUser.CanFocus = true;
00103 this.CreateNewUser.Name = "CreateNewUser";
00104 this.CreateNewUser.UseUnderline = true;
00105
00106 Gtk.Alignment w5 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
00107
00108 Gtk.HBox w6 = new Gtk.HBox();
00109 w6.Spacing = 2;
00110
00111 Gtk.Image w7 = new Gtk.Image();
00112 w7.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-add", Gtk.IconSize.Menu, 16);
00113 w6.Add(w7);
00114
00115 Gtk.Label w9 = new Gtk.Label();
00116 w9.LabelProp = Mono.Unix.Catalog.GetString("Create new user");
00117 w9.UseUnderline = true;
00118 w6.Add(w9);
00119 w5.Add(w6);
00120 this.CreateNewUser.Add(w5);
00121 this.hbuttonbox1.Add(this.CreateNewUser);
00122 Gtk.ButtonBox.ButtonBoxChild w13 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1[this.CreateNewUser]));
00123 w13.Expand = false;
00124 w13.Fill = false;
00125
00126 this.DeleteUserButton = new Gtk.Button();
00127 this.DeleteUserButton.TooltipMarkup = "Delete this selected user from the system";
00128 this.DeleteUserButton.Sensitive = false;
00129 this.DeleteUserButton.CanFocus = true;
00130 this.DeleteUserButton.Name = "DeleteUserButton";
00131 this.DeleteUserButton.UseUnderline = true;
00132
00133 Gtk.Alignment w14 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
00134
00135 Gtk.HBox w15 = new Gtk.HBox();
00136 w15.Spacing = 2;
00137
00138 Gtk.Image w16 = new Gtk.Image();
00139 w16.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-delete", Gtk.IconSize.Menu, 16);
00140 w15.Add(w16);
00141
00142 Gtk.Label w18 = new Gtk.Label();
00143 w18.LabelProp = Mono.Unix.Catalog.GetString("Delete user");
00144 w18.UseUnderline = true;
00145 w15.Add(w18);
00146 w14.Add(w15);
00147 this.DeleteUserButton.Add(w14);
00148 this.hbuttonbox1.Add(this.DeleteUserButton);
00149 Gtk.ButtonBox.ButtonBoxChild w22 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox1[this.DeleteUserButton]));
00150 w22.Position = 1;
00151 w22.Expand = false;
00152 w22.Fill = false;
00153 this.vbox1.Add(this.hbuttonbox1);
00154 Gtk.Box.BoxChild w23 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbuttonbox1]));
00155 w23.Position = 1;
00156 w23.Expand = false;
00157 w23.Fill = false;
00158 this.hbox1.Add(this.vbox1);
00159 Gtk.Box.BoxChild w24 = ((Gtk.Box.BoxChild)(this.hbox1[this.vbox1]));
00160 w24.Position = 0;
00161
00162 this.CreatePersonTable = new Gtk.Table(((uint)(9)), ((uint)(4)), false);
00163 this.CreatePersonTable.Name = "CreatePersonTable";
00164 this.CreatePersonTable.RowSpacing = ((uint)(6));
00165 this.CreatePersonTable.ColumnSpacing = ((uint)(6));
00166
00167 this.BirthDayCalendar = new Gtk.Calendar();
00168 this.BirthDayCalendar.CanFocus = true;
00169 this.BirthDayCalendar.Name = "BirthDayCalendar";
00170 this.BirthDayCalendar.DisplayOptions = ((Gtk.CalendarDisplayOptions)(35));
00171 this.CreatePersonTable.Add(this.BirthDayCalendar);
00172 Gtk.Table.TableChild w25 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.BirthDayCalendar]));
00173 w25.TopAttach = ((uint)(3));
00174 w25.BottomAttach = ((uint)(5));
00175 w25.LeftAttach = ((uint)(1));
00176 w25.RightAttach = ((uint)(4));
00177 w25.XOptions = ((Gtk.AttachOptions)(4));
00178 w25.YOptions = ((Gtk.AttachOptions)(4));
00179
00180 this.FullNameEntry = new Gtk.Entry();
00181 this.FullNameEntry.CanFocus = true;
00182 this.FullNameEntry.Name = "FullNameEntry";
00183 this.FullNameEntry.IsEditable = true;
00184 this.FullNameEntry.InvisibleChar = '●';
00185 this.CreatePersonTable.Add(this.FullNameEntry);
00186 Gtk.Table.TableChild w26 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.FullNameEntry]));
00187 w26.TopAttach = ((uint)(1));
00188 w26.BottomAttach = ((uint)(2));
00189 w26.LeftAttach = ((uint)(1));
00190 w26.RightAttach = ((uint)(4));
00191 w26.XOptions = ((Gtk.AttachOptions)(4));
00192 w26.YOptions = ((Gtk.AttachOptions)(4));
00193
00194 this.GenderCombobox = Gtk.ComboBox.NewText();
00195 this.GenderCombobox.AppendText(Mono.Unix.Catalog.GetString("Male"));
00196 this.GenderCombobox.AppendText(Mono.Unix.Catalog.GetString("Female"));
00197 this.GenderCombobox.Name = "GenderCombobox";
00198 this.GenderCombobox.Active = 0;
00199 this.CreatePersonTable.Add(this.GenderCombobox);
00200 Gtk.Table.TableChild w27 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.GenderCombobox]));
00201 w27.TopAttach = ((uint)(5));
00202 w27.BottomAttach = ((uint)(6));
00203 w27.LeftAttach = ((uint)(1));
00204 w27.RightAttach = ((uint)(2));
00205 w27.XOptions = ((Gtk.AttachOptions)(4));
00206 w27.YOptions = ((Gtk.AttachOptions)(4));
00207
00208 this.hbuttonbox2 = new Gtk.HButtonBox();
00209 this.hbuttonbox2.Name = "hbuttonbox2";
00210 this.hbuttonbox2.LayoutStyle = ((Gtk.ButtonBoxStyle)(1));
00211
00212 this.CancelNewUserButton = new Gtk.Button();
00213 this.CancelNewUserButton.TooltipMarkup = "Cancel creation of the new user";
00214 this.CancelNewUserButton.CanFocus = true;
00215 this.CancelNewUserButton.Name = "CancelNewUserButton";
00216 this.CancelNewUserButton.UseUnderline = true;
00217
00218 Gtk.Alignment w28 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
00219
00220 Gtk.HBox w29 = new Gtk.HBox();
00221 w29.Spacing = 2;
00222
00223 Gtk.Image w30 = new Gtk.Image();
00224 w30.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-cancel", Gtk.IconSize.Menu, 16);
00225 w29.Add(w30);
00226
00227 Gtk.Label w32 = new Gtk.Label();
00228 w32.LabelProp = Mono.Unix.Catalog.GetString("Cancel user creation");
00229 w32.UseUnderline = true;
00230 w29.Add(w32);
00231 w28.Add(w29);
00232 this.CancelNewUserButton.Add(w28);
00233 this.hbuttonbox2.Add(this.CancelNewUserButton);
00234 Gtk.ButtonBox.ButtonBoxChild w36 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.CancelNewUserButton]));
00235 w36.Expand = false;
00236 w36.Fill = false;
00237
00238 this.SaveNewUserButton = new Gtk.Button();
00239 this.SaveNewUserButton.TooltipMarkup = "Save the new user";
00240 this.SaveNewUserButton.Sensitive = false;
00241 this.SaveNewUserButton.CanFocus = true;
00242 this.SaveNewUserButton.Name = "SaveNewUserButton";
00243 this.SaveNewUserButton.UseUnderline = true;
00244
00245 Gtk.Alignment w37 = new Gtk.Alignment(0.5F, 0.5F, 0F, 0F);
00246
00247 Gtk.HBox w38 = new Gtk.HBox();
00248 w38.Spacing = 2;
00249
00250 Gtk.Image w39 = new Gtk.Image();
00251 w39.Pixbuf = Stetic.IconLoader.LoadIcon(this, "gtk-save", Gtk.IconSize.Menu, 16);
00252 w38.Add(w39);
00253
00254 Gtk.Label w41 = new Gtk.Label();
00255 w41.LabelProp = Mono.Unix.Catalog.GetString("Save new user");
00256 w41.UseUnderline = true;
00257 w38.Add(w41);
00258 w37.Add(w38);
00259 this.SaveNewUserButton.Add(w37);
00260 this.hbuttonbox2.Add(this.SaveNewUserButton);
00261 Gtk.ButtonBox.ButtonBoxChild w45 = ((Gtk.ButtonBox.ButtonBoxChild)(this.hbuttonbox2[this.SaveNewUserButton]));
00262 w45.Position = 1;
00263 w45.Expand = false;
00264 w45.Fill = false;
00265 this.CreatePersonTable.Add(this.hbuttonbox2);
00266 Gtk.Table.TableChild w46 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.hbuttonbox2]));
00267 w46.TopAttach = ((uint)(7));
00268 w46.BottomAttach = ((uint)(8));
00269 w46.RightAttach = ((uint)(4));
00270 w46.XOptions = ((Gtk.AttachOptions)(4));
00271 w46.YOptions = ((Gtk.AttachOptions)(4));
00272
00273 this.HeightSpinbutton = new Gtk.SpinButton(0, 25, 5);
00274 this.HeightSpinbutton.CanFocus = true;
00275 this.HeightSpinbutton.Name = "HeightSpinbutton";
00276 this.HeightSpinbutton.Adjustment.PageIncrement = 1;
00277 this.HeightSpinbutton.ClimbRate = 1;
00278 this.HeightSpinbutton.Digits = ((uint)(2));
00279 this.HeightSpinbutton.Numeric = true;
00280 this.HeightSpinbutton.Value = 18;
00281 this.CreatePersonTable.Add(this.HeightSpinbutton);
00282 Gtk.Table.TableChild w47 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.HeightSpinbutton]));
00283 w47.TopAttach = ((uint)(5));
00284 w47.BottomAttach = ((uint)(6));
00285 w47.LeftAttach = ((uint)(3));
00286 w47.RightAttach = ((uint)(4));
00287 w47.XOptions = ((Gtk.AttachOptions)(4));
00288 w47.YOptions = ((Gtk.AttachOptions)(4));
00289
00290 this.label1 = new Gtk.Label();
00291 this.label1.Name = "label1";
00292 this.label1.Xpad = 5;
00293 this.label1.Xalign = 0F;
00294 this.label1.LabelProp = Mono.Unix.Catalog.GetString("<span size=\"xx-large\">Create new user</span>");
00295 this.label1.UseMarkup = true;
00296 this.CreatePersonTable.Add(this.label1);
00297 Gtk.Table.TableChild w48 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.label1]));
00298 w48.RightAttach = ((uint)(4));
00299 w48.YOptions = ((Gtk.AttachOptions)(4));
00300
00301 this.label2 = new Gtk.Label();
00302 this.label2.Name = "label2";
00303 this.label2.Xpad = 5;
00304 this.label2.Xalign = 0F;
00305 this.label2.LabelProp = Mono.Unix.Catalog.GetString("Full name:");
00306 this.CreatePersonTable.Add(this.label2);
00307 Gtk.Table.TableChild w49 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.label2]));
00308 w49.TopAttach = ((uint)(1));
00309 w49.BottomAttach = ((uint)(2));
00310 w49.XOptions = ((Gtk.AttachOptions)(4));
00311 w49.YOptions = ((Gtk.AttachOptions)(4));
00312
00313 this.label3 = new Gtk.Label();
00314 this.label3.Name = "label3";
00315 this.label3.Xpad = 5;
00316 this.label3.Xalign = 0F;
00317 this.label3.LabelProp = Mono.Unix.Catalog.GetString("User name:");
00318 this.CreatePersonTable.Add(this.label3);
00319 Gtk.Table.TableChild w50 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.label3]));
00320 w50.TopAttach = ((uint)(2));
00321 w50.BottomAttach = ((uint)(3));
00322 w50.XOptions = ((Gtk.AttachOptions)(4));
00323 w50.YOptions = ((Gtk.AttachOptions)(4));
00324
00325 this.label4 = new Gtk.Label();
00326 this.label4.Name = "label4";
00327 this.label4.Xpad = 5;
00328 this.label4.Ypad = 3;
00329 this.label4.Xalign = 0F;
00330 this.label4.Yalign = 0F;
00331 this.label4.LabelProp = Mono.Unix.Catalog.GetString("Date of birth:");
00332 this.CreatePersonTable.Add(this.label4);
00333 Gtk.Table.TableChild w51 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.label4]));
00334 w51.TopAttach = ((uint)(3));
00335 w51.BottomAttach = ((uint)(4));
00336 w51.XOptions = ((Gtk.AttachOptions)(4));
00337 w51.YOptions = ((Gtk.AttachOptions)(4));
00338
00339 this.label5 = new Gtk.Label();
00340 this.label5.Name = "label5";
00341 this.label5.Xpad = 5;
00342 this.label5.Xalign = 0F;
00343 this.label5.LabelProp = Mono.Unix.Catalog.GetString("Gender:");
00344 this.CreatePersonTable.Add(this.label5);
00345 Gtk.Table.TableChild w52 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.label5]));
00346 w52.TopAttach = ((uint)(5));
00347 w52.BottomAttach = ((uint)(6));
00348 w52.XOptions = ((Gtk.AttachOptions)(4));
00349 w52.YOptions = ((Gtk.AttachOptions)(4));
00350
00351 this.label6 = new Gtk.Label();
00352 this.label6.Name = "label6";
00353 this.label6.Xpad = 5;
00354 this.label6.Xalign = 0F;
00355 this.label6.LabelProp = Mono.Unix.Catalog.GetString("Height (m):");
00356 this.CreatePersonTable.Add(this.label6);
00357 Gtk.Table.TableChild w53 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.label6]));
00358 w53.TopAttach = ((uint)(5));
00359 w53.BottomAttach = ((uint)(6));
00360 w53.LeftAttach = ((uint)(2));
00361 w53.RightAttach = ((uint)(3));
00362 w53.XOptions = ((Gtk.AttachOptions)(4));
00363 w53.YOptions = ((Gtk.AttachOptions)(4));
00364
00365 this.label7 = new Gtk.Label();
00366 this.label7.Name = "label7";
00367 this.label7.Xpad = 5;
00368 this.label7.Xalign = 0F;
00369 this.label7.LabelProp = Mono.Unix.Catalog.GetString("Weight (kg):");
00370 this.CreatePersonTable.Add(this.label7);
00371 Gtk.Table.TableChild w54 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.label7]));
00372 w54.TopAttach = ((uint)(6));
00373 w54.BottomAttach = ((uint)(7));
00374 w54.LeftAttach = ((uint)(2));
00375 w54.RightAttach = ((uint)(3));
00376 w54.XOptions = ((Gtk.AttachOptions)(4));
00377 w54.YOptions = ((Gtk.AttachOptions)(4));
00378
00379 this.UserNameEntry = new Gtk.Entry();
00380 this.UserNameEntry.CanFocus = true;
00381 this.UserNameEntry.Name = "UserNameEntry";
00382 this.UserNameEntry.IsEditable = true;
00383 this.UserNameEntry.InvisibleChar = '●';
00384 this.CreatePersonTable.Add(this.UserNameEntry);
00385 Gtk.Table.TableChild w55 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.UserNameEntry]));
00386 w55.TopAttach = ((uint)(2));
00387 w55.BottomAttach = ((uint)(3));
00388 w55.LeftAttach = ((uint)(1));
00389 w55.RightAttach = ((uint)(4));
00390 w55.XOptions = ((Gtk.AttachOptions)(4));
00391 w55.YOptions = ((Gtk.AttachOptions)(4));
00392
00393 this.WeightSpinbutton = new Gtk.SpinButton(0, 10000, 5);
00394 this.WeightSpinbutton.CanFocus = true;
00395 this.WeightSpinbutton.Name = "WeightSpinbutton";
00396 this.WeightSpinbutton.Adjustment.PageIncrement = 1;
00397 this.WeightSpinbutton.ClimbRate = 1;
00398 this.WeightSpinbutton.Digits = ((uint)(1));
00399 this.WeightSpinbutton.Numeric = true;
00400 this.WeightSpinbutton.Value = 75;
00401 this.CreatePersonTable.Add(this.WeightSpinbutton);
00402 Gtk.Table.TableChild w56 = ((Gtk.Table.TableChild)(this.CreatePersonTable[this.WeightSpinbutton]));
00403 w56.TopAttach = ((uint)(6));
00404 w56.BottomAttach = ((uint)(7));
00405 w56.LeftAttach = ((uint)(3));
00406 w56.RightAttach = ((uint)(4));
00407 w56.XOptions = ((Gtk.AttachOptions)(4));
00408 w56.YOptions = ((Gtk.AttachOptions)(4));
00409 this.hbox1.Add(this.CreatePersonTable);
00410 Gtk.Box.BoxChild w57 = ((Gtk.Box.BoxChild)(this.hbox1[this.CreatePersonTable]));
00411 w57.Position = 1;
00412 w57.Expand = false;
00413 w57.Fill = false;
00414 this.Add(this.hbox1);
00415 if ((this.Child != null)) {
00416 this.Child.ShowAll();
00417 }
00418 w1.SetUiManager(UIManager);
00419 this.Hide();
00420 this.UserView.CursorChanged += new System.EventHandler(this.OnUserViewCursorChanged);
00421 this.CreateNewUser.Clicked += new System.EventHandler(this.OnCreateNewUserClicked);
00422 this.DeleteUserButton.Clicked += new System.EventHandler(this.OnDeleteUserButtonClicked);
00423 this.UserNameEntry.Changed += new System.EventHandler(this.ValidateEntry);
00424 this.CancelNewUserButton.Clicked += new System.EventHandler(this.OnCancelNewUserButtonClicked);
00425 this.SaveNewUserButton.Clicked += new System.EventHandler(this.OnSaveNewUserButtonClicked);
00426 this.FullNameEntry.Changed += new System.EventHandler(this.ValidateEntry);
00427 }
00428 }
00429 }