public InfoAffectableWindow(string title, bool isEdited = false) : base(WindowType.Toplevel) { Modal = true; Title = title; TransientFor = MainWindow.GetInstance(); VPaned.Add1(infoView); VPaned.Add2(ActionButtonBox); this.Add(VPaned); ActionButtonBox.Add(CloseButton); ActionButtonBox.Add(EditButton); CloseButton.Clicked += (object sender, System.EventArgs e) => this.Destroy(); EditButton.Clicked += (object sender, System.EventArgs e) => { if (isEdited) { this.Destroy(); } else { Edit(); } }; this.Destroyed += (object o, System.EventArgs args) => { //MainWindow.GetInstance().Sensitive = true; }; //MainWindow.GetInstance().Sensitive = false; }
void ShowEditor(Editor editor) { SetupEditor(editor); current_editor = editor; buttons.Hide(); // Top label var vbox = new VBox(false, 4); var label = new Label { Markup = $"<big><b>{editor.Label}</b></big>" }; vbox.PackStart(label, false, false, 5); // Optional config widget var config = editor.ConfigurationWidget(); if (config != null) { // This is necessary because GtkBuilder widgets need to be // reparented. if (config.Parent != null) { config.Reparent(vbox); } else { vbox.PackStart(config, false, false, 0); } } // Apply / Cancel buttons var tool_buttons = new HButtonBox { LayoutStyle = ButtonBoxStyle.End, Spacing = 5, BorderWidth = 5, Homogeneous = false }; var cancel = new Button(Stock.Cancel); cancel.Clicked += HandleCancel; tool_buttons.Add(cancel); var apply = new Button(editor.ApplyLabel) { // FIXME, Theme icon //Image = new Image (GtkUtil.TryLoadIcon (Settings.Global.IconTheme, editor.IconName, 22, 0)) }; apply.Clicked += (s, e) => { Apply(editor); }; tool_buttons.Add(apply); // Pack it all together vbox.PackEnd(tool_buttons, false, false, 0); active_editor = vbox; widgets.Add(active_editor); active_editor.ShowAll(); }
public EditAffectableWindow(string title, Affectable affectable) : base(WindowType.Toplevel) { Modal = true; Title = title; TransientFor = MainWindow.GetInstance(); VPaned.Add(EntryBox); NameEntry = new Entry(affectable.Name); AddEntry("Name", NameEntry); SciNameEntry = new Entry(affectable.ScientificName); AddEntry("Scientific Name", SciNameEntry); DescriptionTextView = new TextView(); DescriptionTextView.Buffer.Text = affectable.Description; AddEntry("Description ", DescriptionTextView); ActionButtonBox.Add(InfoButton); ActionButtonBox.Add(SaveButton); ActionButtonBox.Add(DeleteButton); ActionButtonBox.Add(DiscardButton); VPaned.Add2(ActionButtonBox); this.Add(VPaned); InfoButton.Clicked += (object sender, System.EventArgs e) => Info(); DiscardButton.Clicked += (object sender, System.EventArgs e) => TryToClose(); SaveButton.Clicked += (object sender, System.EventArgs e) => Save(); DeleteButton.Clicked += (object sender, System.EventArgs e) => Delete(); }
public Contact(Hashtable contact) : base(false, 10) { HBox hbox; Table table; Button button; HButtonBox hbuttonbox; this.contact = contact; // Create header containing an icon and display name hbox = new HBox(); hbox.Spacing = 10; hbox.PackStart(Beagle.Images.GetWidget("person.png"), false, false, 0); hbox.PackStart(new VLabel(String.Format("<b><span size='large'>{0} \"{1}\" {2}</span></b>", GetValue("FirstName"), GetValue("NickName"), GetValue("LastName")), false)); PackStart(hbox, false, false, 0); PackStart(new HSeparator(), false, false, 0); // Create a table containing some user information table = new Table(5, 2, false); PackStart(table, false, false, 0); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Primary E-Mail:")), false), 0, 1, 0, 1, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("PrimaryEmail"), true), 1, 2, 0, 1); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Screen name:")), false), 0, 1, 1, 2, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("_AimScreenName"), true), 1, 2, 1, 2); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Home phone:")), false), 0, 1, 2, 3, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("HomePhone"), true), 1, 2, 2, 3); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Mobile phone:")), false), 0, 1, 3, 4, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("CellularNumber"), true), 1, 2, 3, 4); table.Attach(new VLabel(String.Format("<b>{0}</b>", Catalog.GetString("Web page:")), false), 0, 1, 4, 5, AttachOptions.Shrink | AttachOptions.Fill, AttachOptions.Shrink, 10, 0); table.Attach(new VLabel(GetValue("WebPage2"), true), 1, 2, 4, 5); // Add a button row with some informational buttons hbuttonbox = new HButtonBox(); hbuttonbox.Layout = ButtonBoxStyle.End; PackEnd(hbuttonbox, false, false, 0); button = new Button(Catalog.GetString("Send E-Mail")); button.Clicked += OnSendEmail; hbuttonbox.Add(button); button = new Button(Catalog.GetString("Details...")); button.Clicked += OnDetails; hbuttonbox.Add(button); }
void ShowEditor(Editor editor) { SetupEditor(editor); current_editor = editor; buttons.Hide(); // Top label VBox vbox = new VBox(false, 4); Label label = new Label(); label.Markup = string.Format("<big><b>{0}</b></big>", editor.Label); vbox.PackStart(label, false, false, 5); // Optional config widget Widget config = editor.ConfigurationWidget(); if (config != null) { // This is necessary because GtkBuilder widgets need to be // reparented. if (config.Parent != null) { config.Reparent(vbox); } else { vbox.PackStart(config, false, false, 0); } } // Apply / Cancel buttons HButtonBox tool_buttons = new HButtonBox(); tool_buttons.LayoutStyle = ButtonBoxStyle.End; tool_buttons.Spacing = 5; tool_buttons.BorderWidth = 5; tool_buttons.Homogeneous = false; Button cancel = new Button(Stock.Cancel); cancel.Clicked += HandleCancel; tool_buttons.Add(cancel); Button apply = new Button(editor.ApplyLabel); apply.Image = new Image(GtkUtil.TryLoadIcon(FSpot.Settings.Global.IconTheme, editor.IconName, 22, 0)); apply.Clicked += (s, e) => { Apply(editor); }; tool_buttons.Add(apply); // Pack it all together vbox.PackEnd(tool_buttons, false, false, 0); active_editor = vbox; widgets.Add(active_editor); active_editor.ShowAll(); }
public LogWindow(string title, string contents) : base(title) { this.contents = contents; SetDefaultSize(640, 480); VBox vbox = new VBox(false, 2); vbox.BorderWidth = 5; ScrolledWindow scrolledWindow = new ScrolledWindow(); TextView textView = new TextView(); textView.Buffer.Text = contents; textView.Editable = false; scrolledWindow.Add(textView); scrolledWindow.ShowAll(); HButtonBox buttonBox = new HButtonBox(); buttonBox.Layout = ButtonBoxStyle.End; buttonBox.Spacing = 5; Button saveAs = new Button(Stock.SaveAs); saveAs.Clicked += delegate(object obj, EventArgs args) { this.SaveAs(); }; buttonBox.Add(saveAs); Button close = new Button(Stock.Close); close.CanDefault = true; close.Clicked += delegate(object obj, EventArgs args) { this.Close(); }; buttonBox.Add(close); vbox.PackStart(scrolledWindow, true, true, 5); vbox.PackStart(buttonBox, false, false, 5); Add(vbox); ShowAll(); close.GrabDefault(); }
public MainWindow() : base(WindowType.Toplevel) { VBox vBox = new VBox(); _swf = new Swfdec.GtkWidget(new Player(null)); _swf.SetSizeRequest(400, 300); vBox.PackStart(_swf); HButtonBox btnBox = new HButtonBox(); Button btnOpen = new Button(); btnOpen.Label = "Open"; btnOpen.Clicked += ButtonOpenClicked; btnBox.Add(btnOpen); vBox.PackStart(btnBox, false, false, 3); Add(vBox); WindowPosition = Gtk.WindowPosition.Center; DeleteEvent += OnDeleteEvent; }
private void ShowEditor(Editor editor) { SetupEditor(editor); current_editor = editor; buttons.Hide(); // Top label VBox vbox = new VBox(false, 4); Label label = new Label(); label.Markup = String.Format("<big><b>{0}</b></big>", editor.Label); vbox.PackStart(label, false, false, 5); // Optional config widget Widget config = editor.ConfigurationWidget(); if (config != null) { vbox.PackStart(config, false, false, 0); } // Apply / Cancel buttons HButtonBox tool_buttons = new HButtonBox(); tool_buttons.LayoutStyle = ButtonBoxStyle.End; tool_buttons.Spacing = 5; tool_buttons.BorderWidth = 5; tool_buttons.Homogeneous = false; Button cancel = new Button(Stock.Cancel); cancel.Clicked += HandleCancel; tool_buttons.Add(cancel); Button apply = new Button(editor.ApplyLabel); apply.Image = new Image(GtkUtil.TryLoadIcon(FSpot.Global.IconTheme, editor.IconName, 22, (Gtk.IconLookupFlags) 0)); apply.Clicked += delegate { Apply(editor); }; tool_buttons.Add(apply); // Pack it all together vbox.PackEnd(tool_buttons, false, false, 0); active_editor = vbox; widgets.Add(active_editor); active_editor.ShowAll(); }
protected NumberInputWindow(string title, string message, int min, int max) : base(WindowType.Toplevel) { Modal = true; Title = title; label = new Label(message); spinButton = new SpinButton(min, max, 1); okButton = new Button("Ok"); cancelButton = new Button("Cancel"); vBox = new VBox(); vBox.Add(label); vBox.Add(spinButton); hButtonBox = new HButtonBox(); hButtonBox.Add(cancelButton); hButtonBox.Add(okButton); vBox.Add(hButtonBox); Add(vBox); }
private void build() { var mainBox = new VBox(); qnv = new QuestitionNodeView(); mainBox.PackStart(qnv, true, true, 2); var buttonBox = new HButtonBox { Layout = ButtonBoxStyle.End, Spacing = 6 }; Button buttonAdd = new Button(Stock.Add); buttonAdd.Clicked += ButtonAddClicked; buttonBox.Add(buttonAdd); Button buttonRemove = new Button(Stock.Remove); buttonRemove.Clicked += ButtonRemoveClicked; buttonBox.Add(buttonRemove); Button buttonRefresh = new Button(Stock.Refresh); buttonRefresh.Clicked += ButtonRefreshClicked; buttonBox.Add(buttonRefresh); Button buttonClose = new Button(Stock.Close); buttonClose.Clicked += ButtonCloseClicked; buttonBox.Add(buttonClose); mainBox.PackEnd(buttonBox, false, false, 2); this.Add(mainBox); }
public AttributeEditorWidget() : base() { sw = new ScrolledWindow(); sw.HscrollbarPolicy = PolicyType.Automatic; sw.VscrollbarPolicy = PolicyType.Automatic; store = new ListStore(typeof(string), typeof(string)); store.SetSortColumnId(0, SortType.Ascending); tv = new TreeView(); tv.Model = store; TreeViewColumn col; col = tv.AppendColumn("Name", new CellRendererText(), "text", 0); col.SortColumnId = 0; CellRendererText cell = new CellRendererText(); cell.Editable = true; cell.Edited += new EditedHandler(OnAttributeEdit); tv.AppendColumn("Value", cell, "text", 1); tv.KeyPressEvent += new KeyPressEventHandler(OnKeyPress); tv.ButtonPressEvent += new ButtonPressEventHandler(OnRightClick); tv.RowActivated += new RowActivatedHandler(OnRowActivated); sw.AddWithViewport(tv); HButtonBox hb = new HButtonBox(); hb.Layout = ButtonBoxStyle.End; applyButton = new Button(); applyButton.Label = "Apply"; applyButton.Image = new Gtk.Image(Stock.Apply, IconSize.Button); applyButton.Clicked += new EventHandler(OnApplyClicked); applyButton.Sensitive = false; hb.Add(applyButton); this.PackStart(sw, true, true, 0); this.PackStart(hb, false, false, 5); this.ShowAll(); }
public void Commit(object obj, EventArgs args) //EventArgs { this.HideAll(); //MAKE SOMETHING RELATED WITH COMMITTING LOGIN DATA string pswStored = "ciaone"; int pswHashStored = pswStored.GetHashCode(); String avviso; if (this.password.Text.GetHashCode() == pswHashStored) { avviso = "Password corretta"; } else { avviso = "Password errata"; password.Text = ""; } Console.WriteLine(avviso); dialog = new Window(WindowType.Toplevel); dialog.Resize(200, 100); dialog.BorderWidth = 20; VBox dialogBox = new VBox(); Label labelDialog = new Label(avviso); Button okPop = new Button("Ok"); HButtonBox dialogButtonBox = new HButtonBox(); dialogButtonBox.Add(okPop); dialogBox.Add(labelDialog); dialogBox.Add(dialogButtonBox); dialog.Add(dialogBox); dialog.SetPosition(WindowPosition.CenterAlways); dialog.ShowAll(); if (avviso.Equals("Password corretta")) { okPop.Clicked += CancelWindowCloser; } else { okPop.Clicked += Revealer; } //THEN QUIT }
protected virtual void Build() { Gui.Initialize(this); base.Name = "CocoStudio.ControlLib.Windows.NewProjectDialog"; base.WindowPosition = WindowPosition.CenterOnParent; VBox vBox = base.VBox; vBox.Name = "dialog1_VBox"; vBox.BorderWidth = 2u; this.evtbx_border = new EventBox(); this.evtbx_border.Name = "evtbx_border"; this.evtbx_border.BorderWidth = 12u; this.table1 = new Table(2u, 2u, false); this.table1.Name = "table1"; this.table1.RowSpacing = 6u; this.table1.ColumnSpacing = 6u; this.entry_Name = new Entry(); this.entry_Name.CanFocus = true; this.entry_Name.Name = "entry_Name"; this.entry_Name.IsEditable = true; this.entry_Name.InvisibleChar = '●'; this.table1.Add(this.entry_Name); Table.TableChild tableChild = (Table.TableChild) this.table1[this.entry_Name]; tableChild.LeftAttach = 1u; tableChild.RightAttach = 2u; tableChild.YOptions = AttachOptions.Fill; this.hbox3 = new HBox(); this.hbox3.Name = "hbox3"; this.hbox3.Spacing = 6; this.entry_Path = new Entry(); this.entry_Path.CanFocus = true; this.entry_Path.Name = "entry_Path"; this.entry_Path.IsEditable = true; this.entry_Path.InvisibleChar = '●'; this.hbox3.Add(this.entry_Path); Box.BoxChild boxChild = (Box.BoxChild) this.hbox3[this.entry_Path]; boxChild.Position = 0; this.button_Browse = new Button(); this.button_Browse.CanFocus = true; this.button_Browse.Name = "button_Browse"; this.button_Browse.UseUnderline = true; this.button_Browse.Label = Catalog.GetString("浏览"); this.hbox3.Add(this.button_Browse); Box.BoxChild boxChild2 = (Box.BoxChild) this.hbox3[this.button_Browse]; boxChild2.Position = 1; boxChild2.Expand = false; boxChild2.Fill = false; this.table1.Add(this.hbox3); Table.TableChild tableChild2 = (Table.TableChild) this.table1[this.hbox3]; tableChild2.TopAttach = 1u; tableChild2.BottomAttach = 2u; tableChild2.LeftAttach = 1u; tableChild2.RightAttach = 2u; tableChild2.YOptions = AttachOptions.Fill; this.label_Name = new Label(); this.label_Name.Name = "label_Name"; this.label_Name.Xalign = 1f; this.label_Name.LabelProp = Catalog.GetString("项目名称"); this.table1.Add(this.label_Name); Table.TableChild tableChild3 = (Table.TableChild) this.table1[this.label_Name]; tableChild3.XOptions = AttachOptions.Fill; tableChild3.YOptions = AttachOptions.Fill; this.label_Path = new Label(); this.label_Path.Name = "label_Path"; this.label_Path.Xalign = 1f; this.label_Path.LabelProp = Catalog.GetString("项目路径"); this.table1.Add(this.label_Path); Table.TableChild tableChild4 = (Table.TableChild) this.table1[this.label_Path]; tableChild4.TopAttach = 1u; tableChild4.BottomAttach = 2u; tableChild4.XOptions = AttachOptions.Fill; tableChild4.YOptions = AttachOptions.Fill; this.evtbx_border.Add(this.table1); vBox.Add(this.evtbx_border); Box.BoxChild boxChild3 = (Box.BoxChild)vBox[this.evtbx_border]; boxChild3.Position = 0; boxChild3.Expand = false; boxChild3.Fill = false; HButtonBox actionArea = base.ActionArea; actionArea.Name = "dialog1_ActionArea"; actionArea.Spacing = 10; actionArea.BorderWidth = 5u; actionArea.LayoutStyle = ButtonBoxStyle.End; this.hbox_cancelOKBox = new HBox(); this.hbox_cancelOKBox.Name = "hbox_cancelOKBox"; this.hbox_cancelOKBox.Spacing = 6; this.buttonCancel = new Button(); this.buttonCancel.WidthRequest = 80; this.buttonCancel.CanDefault = true; this.buttonCancel.CanFocus = true; this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.UseStock = true; this.buttonCancel.UseUnderline = true; this.buttonCancel.Label = "gtk-cancel"; this.hbox_cancelOKBox.Add(this.buttonCancel); Box.BoxChild boxChild4 = (Box.BoxChild) this.hbox_cancelOKBox[this.buttonCancel]; boxChild4.Position = 0; boxChild4.Expand = false; boxChild4.Fill = false; this.buttonOk = new Button(); this.buttonOk.WidthRequest = 80; this.buttonOk.CanDefault = true; this.buttonOk.CanFocus = true; this.buttonOk.Name = "buttonOk"; this.buttonOk.UseStock = true; this.buttonOk.UseUnderline = true; this.buttonOk.Label = "gtk-ok"; this.hbox_cancelOKBox.Add(this.buttonOk); Box.BoxChild boxChild5 = (Box.BoxChild) this.hbox_cancelOKBox[this.buttonOk]; boxChild5.Position = 1; boxChild5.Expand = false; boxChild5.Fill = false; actionArea.Add(this.hbox_cancelOKBox); ButtonBox.ButtonBoxChild buttonBoxChild = (ButtonBox.ButtonBoxChild)actionArea[this.hbox_cancelOKBox]; buttonBoxChild.Expand = false; buttonBoxChild.Fill = false; if (base.Child != null) { base.Child.ShowAll(); } base.DefaultWidth = 363; base.DefaultHeight = 134; base.Show(); }
public void AddButton(Button button) { Buttons.Add(button); ShowAll(); }
protected virtual void Build() { Gui.Initialize((Widget)this); this.WidthRequest = 400; this.HeightRequest = 100; this.Name = "ImprotFileDialog.Dialog"; this.Title = Catalog.GetString("导入文件"); this.WindowPosition = WindowPosition.CenterOnParent; this.Resizable = false; VBox vbox = this.VBox; vbox.Name = "dialog1_VBox"; vbox.BorderWidth = 2U; this.alignment1 = new Alignment(0.5f, 0.5f, 1f, 1f); this.alignment1.Name = "alignment1"; this.alignment1.LeftPadding = 8U; this.labDescribe = new Label(); this.labDescribe.WidthRequest = 392; this.labDescribe.HeightRequest = 50; this.labDescribe.LineWrap = true; this.labDescribe.Name = "labDescribe"; this.labDescribe.LabelProp = Catalog.GetString("文件已经存在,请选择"); this.alignment1.Add((Widget)this.labDescribe); vbox.Add((Widget)this.alignment1); ((Box.BoxChild)vbox[(Widget)this.alignment1]).Position = 0; HButtonBox actionArea = this.ActionArea; actionArea.Name = "dialog1_ActionArea"; actionArea.Spacing = 10; actionArea.BorderWidth = 5U; actionArea.LayoutStyle = ButtonBoxStyle.Edge; this.ckbIsChangeAll = new CheckButton(); this.ckbIsChangeAll.CanFocus = true; this.ckbIsChangeAll.Name = "ckbIsChangeAll"; this.ckbIsChangeAll.Label = Catalog.GetString("全部应用"); this.ckbIsChangeAll.DrawIndicator = true; this.ckbIsChangeAll.UseUnderline = true; actionArea.Add((Widget)this.ckbIsChangeAll); ButtonBox.ButtonBoxChild buttonBoxChild1 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.ckbIsChangeAll]; buttonBoxChild1.Expand = false; buttonBoxChild1.Fill = false; this.hbox4 = new HBox(); this.hbox4.Name = "hbox4"; this.hbox4.Spacing = 6; this.btnKeepBoth = new Button(); this.btnKeepBoth.WidthRequest = 65; this.btnKeepBoth.CanFocus = true; this.btnKeepBoth.Name = "btnKeepBoth"; this.btnKeepBoth.UseUnderline = true; this.btnKeepBoth.Label = Catalog.GetString("保留两者"); this.hbox4.Add((Widget)this.btnKeepBoth); Box.BoxChild boxChild1 = (Box.BoxChild) this.hbox4[(Widget)this.btnKeepBoth]; boxChild1.Position = 0; boxChild1.Expand = false; boxChild1.Fill = false; this.btnReplace = new Button(); this.btnReplace.WidthRequest = 65; this.btnReplace.CanDefault = true; this.btnReplace.CanFocus = true; this.btnReplace.Name = "btnReplace"; this.btnReplace.UseUnderline = true; this.btnReplace.Label = Catalog.GetString("替换"); this.hbox4.Add((Widget)this.btnReplace); Box.BoxChild boxChild2 = (Box.BoxChild) this.hbox4[(Widget)this.btnReplace]; boxChild2.Position = 1; boxChild2.Expand = false; boxChild2.Fill = false; this.btnSkip = new Button(); this.btnSkip.WidthRequest = 65; this.btnSkip.CanDefault = true; this.btnSkip.CanFocus = true; this.btnSkip.Name = "btnSkip"; this.btnSkip.UseUnderline = true; this.btnSkip.Label = Catalog.GetString("跳过"); this.hbox4.Add((Widget)this.btnSkip); Box.BoxChild boxChild3 = (Box.BoxChild) this.hbox4[(Widget)this.btnSkip]; boxChild3.Position = 2; boxChild3.Expand = false; boxChild3.Fill = false; actionArea.Add((Widget)this.hbox4); ButtonBox.ButtonBoxChild buttonBoxChild2 = (ButtonBox.ButtonBoxChild)actionArea[(Widget)this.hbox4]; buttonBoxChild2.Position = 1; buttonBoxChild2.Expand = false; buttonBoxChild2.Fill = false; if (this.Child != null) { this.Child.ShowAll(); } this.DefaultWidth = 454; this.DefaultHeight = 126; this.Show(); }
public MainWindow() : base(WindowType.Toplevel) { GardenData.LoadedData = GardenData.LoadedData = new GardenData("new project"); Title = "Garden project '" + GardenData.LoadedData.Name + "'"; //GardenData.LoadedData = GardenPlanner.MainClass.TestData(); PlantSideVPaned.Add1(FamilyPlantVarietySelector); PlantAreaInfoVPaned.Add1(PlantBox); PlantAreaInfoVPaned.Add2(AreaInfo); PlantSideVPaned.Add2(PlantAreaInfoVPaned); TopPanedToolboxVPaned.Add1(GraphicsSidebarHPaned); TopPanedToolboxVPaned.Add2(ToolBox); Frame frame; PlantBox.Add(PlantAddButton); PlantBox.Add(PlantInfoButton); PlantBox.Add(PlantEditButton); ToolBox.Add(AreaNewButton); ToolBox.Add(AreaCancelButton); ToolBox.Add(AreaTypeComboBox); ToolBox.Add(AreaEditButton); ToolBox.Add(AreaDeleteButton); frame = new Frame("Zoom"); frame.Add(ZoomButton); ToolBox.Add(frame); frame = new Frame("Date"); VButtonBox buttonBox = new VButtonBox(); //yearButton = new SpinButton(GardenData.GetFirstYear(), GardenData.GetLastYear(), 1); yearButton = new SpinButton(settings.MinYear, settings.MaxYear, 1); buttonBox.Add(yearButton); buttonBox.Add(monthButton); frame.Add(buttonBox); ToolBox.Add(frame); foreach (Widget w in TopVBox.Children) { TopVBox.Remove(w); } TopVBox.Add(MenuBar); TopVBox.Add(TopPanedToolboxVPaned); if (this.Child == null) { this.Add(TopVBox); } ResetForNewData(); FamilyPlantVarietySelector.SetSizeRequest(100, 400); AreaInfo.WrapMode = WrapMode.Word; AreaInfo.Editable = false; PlantAddButton.Sensitive = false; PlantAddButton.Clicked += (sender, e) => { GardenDrawingArea area = GardenDrawingArea.ActiveInstance; if (area.SelectedArea is Planting planting && SelectedEntry is PlantVariety variety) { EditPlantingInfoWindow.ShowPlantingInfoWindow((PlantingInfo plantingInfo) => { planting.AddVariety(variety, plantingInfo); GardenDrawingArea.ActiveInstance.Draw(); ShowAreaSelectionInfo(area.SelectedArea); }, planting, variety.Name); } ; }; PlantInfoButton.Clicked += (object sender, System.EventArgs e) => { if (SelectedEntry is PlantFamily family) { InfoPlantFamilyWindow.ShowWindow(family, false); } else if (SelectedEntry is Plant plant) { InfoPlantWindow.ShowWindow(plant, false); } else if (SelectedEntry is PlantVariety variety) { InfoPlantVarietyWindow.ShowWindow(variety, false); } }; PlantEditButton.Clicked += (object sender, System.EventArgs e) => { if (SelectedEntry is PlantFamily family) { EditPlantFamilyWindow.ShowWindow(family); } else if (SelectedEntry is Plant plant) { EditPlantWindow.ShowWindow(plant); } else if (SelectedEntry is PlantVariety variety) { EditPlantVarietyWindow.ShowWindow(variety); } }; ZoomButton.Value = GardenDrawingArea.Zoom; ZoomButton.Events = Gdk.EventMask.ButtonPressMask | Gdk.EventMask.ButtonReleaseMask | Gdk.EventMask.KeyPressMask | Gdk.EventMask.KeyReleaseMask; ZoomButton.TooltipText = "Zoom"; AreaNewButton.Clicked += (object sender, System.EventArgs e) => { if (AreaCancelButtonClicked) { AreaCancelButtonClicked = false; AreaCancelButton.Sensitive = false; if (GardenDrawingArea.ActiveInstance != null) { GardenDrawingArea.ActiveInstance.UndoSelection(); GardenDrawingArea.ActiveInstance.NewPoints.Clear(); GardenDrawingArea.ActiveInstance.Draw(); } } else if (!AreaNewButton.Active)//deactivated { AreaCancelButton.Sensitive = false; if (GardenDrawingArea.ActiveInstance != null) { List <GardenPoint> points = GardenDrawingArea.ActiveInstance.NewPoints; switch (AreaTypeComboBox.Active) { case 0: //garden if (GardenDrawingArea.ActiveInstance.Garden.Shape.GetPoints().Count == 0) { GardenDrawingArea.ActiveInstance.Garden.Shape.AddPoints(points); GardenDrawingArea.ActiveInstance.Garden.Shape.FinishPoints(); GardenDrawingArea.ActiveInstance.NewPoints.Clear(); GardenDrawingArea.ActiveInstance.Draw(); } break; case 1: //planting PlantingCreationDialog.ShowPlantingCreationDialog(new List <GardenPoint>(points), (Planting planting) => { GardenDrawingArea.ActiveInstance.NewPoints.Clear(); GardenDrawingArea.ActiveInstance.Draw(); GardenDrawingArea.ActiveInstance.Garden.AddPlanting(GardenData.GenID(planting.Name), planting); }); break; case 2: //method area GardenAreaCreationDialog.ShowGardenAreaCreationDialog(new List <GardenPoint>(points), (GardenArea area) => { GardenDrawingArea.ActiveInstance.NewPoints.Clear(); GardenDrawingArea.ActiveInstance.Draw(); GardenDrawingArea.ActiveInstance.Garden.AddMethodArea(GardenData.GenID(area.Name), area); }); break; } } } else //activated { if (AreaTypeComboBox.Active == 0) //garden { if (GardenDrawingArea.ActiveInstance == null || GardenDrawingArea.ActiveInstance.Garden.Shape.GetPoints().Count > 0) { AreaNewButton.Active = false; GardenCreationDialog.ShowGardenCreationDialog(new List <GardenPoint>(), ((Garden garden) => { GardenData.LoadedData.AddGarden(GardenData.GenID(garden.Name), garden); this.ResetForNewData(); GardenBedBook.Page = GardenBedBook.NPages - 1; AreaNewButton.Active = true; })); } } AreaCancelButton.Sensitive = true; } }; AreaCancelButton.Sensitive = false; AreaCancelButton.Clicked += (object sender, System.EventArgs e) => { AreaCancelButtonClicked = true; AreaCancelButton.Sensitive = false; AreaNewButton.Active = false; }; AreaTypeComboBox.Active = 0; AreaTypeComboBox.Changed += (object sender, System.EventArgs e) => { switch (AreaTypeComboBox.Active) { case 0: AreaNewButton.Label = "New Garden"; break; case 1: AreaNewButton.Label = "New Planting"; break; case 2: AreaNewButton.Label = "New Method Area"; break; } }; AreaEditButton.Clicked += (object sender, System.EventArgs e) => { GardenDrawingArea gardenDrawingArea = GardenDrawingArea.ActiveInstance; if (gardenDrawingArea == null || gardenDrawingArea.Garden == null || gardenDrawingArea.SelectedArea == null) { return; } if (gardenDrawingArea.SelectedArea is Planting planting) { PlantingCreationDialog.ShowPlantingEditDialog(planting); } else if (gardenDrawingArea.SelectedArea is Garden) { GardenAreaCreationDialog.ShowGardenAreaEditDialog(gardenDrawingArea.SelectedArea); } else { GardenAreaCreationDialog.ShowGardenAreaEditDialog(gardenDrawingArea.SelectedArea); } }; AreaDeleteButton.Clicked += (object sender, System.EventArgs e) => { GardenDrawingArea gardenDrawingArea = GardenDrawingArea.ActiveInstance; if (gardenDrawingArea == null || gardenDrawingArea.Garden == null) { return; } string name = gardenDrawingArea.SelectedArea != null ? gardenDrawingArea.SelectedArea.Name : gardenDrawingArea.Garden.Name; Dialog dialog = new MessageDialog(this, DialogFlags.Modal, MessageType.Warning, ButtonsType.OkCancel, "Do you want to delete '" + name + "'?", new { }); int response = dialog.Run(); //System.Console.WriteLine("response " + result); if (response == (int)ResponseType.Cancel) { } else if (response == (int)ResponseType.Ok) { if (gardenDrawingArea.Garden != null && (gardenDrawingArea.SelectedArea == null || gardenDrawingArea.SelectedArea is Garden)) { var garden = gardenDrawingArea.Garden; GardenData.LoadedData.Gardens.Remove(garden.ID); GardenBedBook.Remove(GardenBedBook.GetNthPage(GardenBedBook.CurrentPage)); //System.Console.WriteLine("delete garden"); GardenDrawingArea.ActiveInstance = null; gardenDrawingArea.UndoSelection(); SelectGardenEntry(null); if (GardenBedBook.Page >= 0 && GardenBedBook.GetNthPage(GardenBedBook.Page) is GardenDrawingArea drawingArea) { GardenDrawingArea.ActiveInstance = drawingArea; drawingArea.Draw(); } GardenData.unsaved = true; } else if (gardenDrawingArea.SelectedArea is Planting planting) { gardenDrawingArea.Garden.RemovePlanting(planting); gardenDrawingArea.UndoSelection(); SelectGardenEntry(null); gardenDrawingArea.Draw(); GardenData.unsaved = true; } else if (gardenDrawingArea.SelectedArea is GardenArea area) { gardenDrawingArea.Garden.RemoveMethodArea(area); gardenDrawingArea.UndoSelection(); SelectGardenEntry(null); gardenDrawingArea.Draw(); GardenData.unsaved = true; } } dialog.Destroy(); }; int yearValue = yearButton.ValueAsInt; yearButton.ValueChanged += (sender, e) => { if (yearButton.ValueAsInt > yearValue) { monthButton.Value = 1; } else { monthButton.Value = 12; } yearValue = yearButton.ValueAsInt; DateChanged(); }; monthButton.Changed += (sender, e) => { DateChanged(); }; void DateChanged() { GardenDrawingArea gardenDrawingArea = GardenDrawingArea.ActiveInstance; if (gardenDrawingArea == null) { return; } if (gardenDrawingArea.SelectedArea != null && (!gardenDrawingArea.SelectedArea.CheckDate(GetYear(), GetMonth()) || !gardenDrawingArea.Garden.CheckDate(GetYear(), GetMonth()))) { gardenDrawingArea.UndoSelection(); } gardenDrawingArea.Draw(); ShowAreaSelectionInfo(gardenDrawingArea.SelectedArea); } //FamilyPlantVarietySelector.Add1(PopulateFamilies(GardenData.LoadedData)); //RepopulateGrowables(); //Build(); this.DeleteEvent += (object o, DeleteEventArgs args) => { TryToClose(); args.RetVal = true; }; this.Destroyed += (sender, e) => { GardenPlannerSettings.Save(); Application.Quit(); }; }
protected virtual void Build() { // Widget BizeeBirdBoarding.Ui.MainWindow Name = "BizeeBirdBoarding.Ui.MainWindow"; Title = "BiZee Bird Boarding"; WindowPosition = WindowPosition.CenterOnParent; DefaultWidth = 1115; DefaultHeight = 480; // Container child BizeeBirdBoarding.Ui.MainWindow.Container+ContainerChild topLevelVbox = new VBox(); topLevelVbox.Name = "topLevelVbox"; topLevelVbox.Spacing = 6; // Container child topLevelVbox.Box+BoxChild toolbarButtonBox = new HButtonBox(); toolbarButtonBox.Name = "toolbarButtonBox"; toolbarButtonBox.LayoutStyle = ButtonBoxStyle.Start; // Container child toolbarButtonBox.ButtonBox+ButtonBoxChild button1 = new Button(); button1.CanFocus = true; button1.Name = "button1"; button1.UseUnderline = true; button1.Label = "New Customer"; toolbarButtonBox.Add(button1); ButtonBox.ButtonBoxChild w1 = (ButtonBox.ButtonBoxChild)toolbarButtonBox[button1]; w1.Expand = false; w1.Fill = false; // Container child toolbarButtonBox.ButtonBox+ButtonBoxChild button2 = new Button(); button2.CanFocus = true; button2.Name = "button2"; button2.UseUnderline = true; button2.Label = "New Appointment"; toolbarButtonBox.Add(button2); ButtonBox.ButtonBoxChild w2 = (ButtonBox.ButtonBoxChild)toolbarButtonBox[button2]; w2.Position = 1; w2.Expand = false; w2.Fill = false; topLevelVbox.Add(toolbarButtonBox); Box.BoxChild w3 = ((Box.BoxChild)(topLevelVbox[toolbarButtonBox])); w3.Position = 0; w3.Expand = false; w3.Fill = false; // Container child topLevelVbox.Box+BoxChild notebook = new Notebook(); notebook.CanFocus = true; notebook.Name = "notebook"; notebook.CurrentPage = 0; // Container child notebook.Notebook+NotebookChild appointmentsTabHPaned = new HPaned(); appointmentsTabHPaned.Name = "appointmentsTabHPaned"; // Container child appointmentsTabHPaned.Paned+PanedChild upcomingDropOffsFrame = new Frame(); upcomingDropOffsFrame.WidthRequest = 450; upcomingDropOffsFrame.Name = "upcomingDropOffsFrame"; upcomingDropOffsFrame.ShadowType = ShadowType.In; // Container child upcomingDropOffsFrame.Container+ContainerChild upcomingDropOffsGtkAlignment = new Alignment(0F, 0F, 1F, 1F); upcomingDropOffsGtkAlignment.Name = "upcomingDropOffsGtkAlignment"; upcomingDropOffsGtkAlignment.LeftPadding = 12; // Container child upcomingDropOffsGtkAlignment.Container+ContainerChild upcomingDropOffsGtkScrolledWindow = new ScrolledWindow(); upcomingDropOffsGtkScrolledWindow.Name = "upcomingDropOffsGtkScrolledWindow"; upcomingDropOffsGtkScrolledWindow.ShadowType = ShadowType.In; // Container child upcomingDropOffsGtkScrolledWindow.Container+ContainerChild upcomingDropOffsTreeView = new TreeView(); upcomingDropOffsTreeView.CanFocus = true; upcomingDropOffsTreeView.Name = "upcomingDropOffsTreeView"; upcomingDropOffsGtkScrolledWindow.Add(upcomingDropOffsTreeView); upcomingDropOffsGtkAlignment.Add(upcomingDropOffsGtkScrolledWindow); upcomingDropOffsFrame.Add(upcomingDropOffsGtkAlignment); upcomingDropOffsLabel = new Label(); upcomingDropOffsLabel.Name = "upcomingDropOffsLabel"; upcomingDropOffsLabel.LabelProp = "<b>Upcoming Drop Offs</b>"; upcomingDropOffsLabel.UseMarkup = true; upcomingDropOffsFrame.LabelWidget = upcomingDropOffsLabel; appointmentsTabHPaned.Add(upcomingDropOffsFrame); Paned.PanedChild w7 = (Paned.PanedChild)appointmentsTabHPaned[upcomingDropOffsFrame]; w7.Resize = false; // Container child appointmentsTabHPaned.Paned+PanedChild upcomingPickupsFrame = new Frame(); upcomingPickupsFrame.Name = "upcomingPickupsFrame"; upcomingPickupsFrame.ShadowType = ShadowType.In; // Container child upcomingPickupsFrame.Container+ContainerChild upcomingPickupsAlignment = new Alignment(0F, 0F, 1F, 1F); upcomingPickupsAlignment.Name = "upcomingPickupsAlignment"; upcomingPickupsAlignment.LeftPadding = 12; // Container child upcomingPickupsAlignment.Container+ContainerChild upcomingPickupsScrolledWindow = new ScrolledWindow(); upcomingPickupsScrolledWindow.Name = "upcomingPickupsScrolledWindow"; upcomingPickupsScrolledWindow.ShadowType = ShadowType.In; // Container child upcomingPickupsScrolledWindow.Container+ContainerChild upcomingPickupsTreeview = new TreeView(); upcomingPickupsTreeview.CanFocus = true; upcomingPickupsTreeview.Name = "upcomingPickupsTreeview"; upcomingPickupsScrolledWindow.Add(upcomingPickupsTreeview); upcomingPickupsAlignment.Add(upcomingPickupsScrolledWindow); upcomingPickupsFrame.Add(upcomingPickupsAlignment); upcomingPickupsLabel = new Label(); upcomingPickupsLabel.Name = "upcomingPickupsLabel"; upcomingPickupsLabel.LabelProp = "<b>Upcoming Pickups</b>"; upcomingPickupsLabel.UseMarkup = true; upcomingPickupsFrame.LabelWidget = upcomingPickupsLabel; appointmentsTabHPaned.Add(upcomingPickupsFrame); notebook.Add(appointmentsTabHPaned); // Notebook tab appointmentsTabLabel = new Label(); appointmentsTabLabel.Name = "appointmentsTabLabel"; appointmentsTabLabel.LabelProp = "Appointments"; notebook.SetTabLabel(appointmentsTabHPaned, appointmentsTabLabel); appointmentsTabLabel.ShowAll(); // Container child notebook.Notebook+NotebookChild customerTabVbox = new VBox(); customerTabVbox.Name = "customerTabVbox"; customerTabVbox.Spacing = 6; // Container child customerTabVbox.Box+BoxChild hbox1 = new HBox(); hbox1.Name = "hbox1"; hbox1.Spacing = 6; // Container child hbox1.Box+BoxChild customerSearchLabel = new Label(); customerSearchLabel.Name = "customerSearchLabel"; customerSearchLabel.LabelProp = "Search"; hbox1.Add(customerSearchLabel); Box.BoxChild w13 = (Box.BoxChild)hbox1[customerSearchLabel]; w13.Position = 0; w13.Expand = false; w13.Fill = false; // Container child hbox1.Box+BoxChild customerSearchEntry = new Entry(); customerSearchEntry.CanFocus = true; customerSearchEntry.Name = "customerSearchEntry"; customerSearchEntry.IsEditable = true; hbox1.Add(customerSearchEntry); Box.BoxChild w14 = (Box.BoxChild)hbox1[customerSearchEntry]; w14.Position = 1; customerTabVbox.Add(hbox1); Box.BoxChild w15 = (Box.BoxChild)customerTabVbox[hbox1]; w15.Position = 0; w15.Expand = false; w15.Fill = false; // Container child customerTabVbox.Box+BoxChild customersScrolledWindow = new ScrolledWindow(); customersScrolledWindow.Name = "customersScrolledWindow"; customersScrolledWindow.ShadowType = ShadowType.In; // Container child customersScrolledWindow.Container+ContainerChild customersTreeview = new TreeView(); customersTreeview.CanFocus = true; customersTreeview.Name = "customersTreeview"; customersScrolledWindow.Add(customersTreeview); customerTabVbox.Add(customersScrolledWindow); Box.BoxChild w17 = (Box.BoxChild)customerTabVbox[customersScrolledWindow]; w17.Position = 1; notebook.Add(customerTabVbox); Notebook.NotebookChild w18 = (Notebook.NotebookChild)notebook[customerTabVbox]; w18.Position = 1; // Notebook tab customerTabLabel = new Label(); customerTabLabel.Name = "customerTabLabel"; customerTabLabel.LabelProp = "Customers"; notebook.SetTabLabel(customerTabVbox, customerTabLabel); customerTabLabel.ShowAll(); // Container child notebook.Notebook+NotebookChild historyTablVbox = new VBox(); historyTablVbox.Name = "historyTablVbox"; historyTablVbox.Spacing = 6; // Container child historyTablVbox.Box+BoxChild historySearchHbox = new HBox(); historySearchHbox.Name = "historySearchHbox"; historySearchHbox.Spacing = 6; // Container child historySearchHbox.Box+BoxChild historySearchLabel = new Label(); historySearchLabel.Name = "historySearchLabel"; historySearchLabel.LabelProp = "Search"; historySearchHbox.Add(historySearchLabel); Box.BoxChild w19 = (Box.BoxChild)historySearchHbox[historySearchLabel]; w19.Position = 0; w19.Expand = false; w19.Fill = false; // Container child historySearchHbox.Box+BoxChild historySearchEntry = new Entry(); historySearchEntry.CanFocus = true; historySearchEntry.Name = "historySearchEntry"; historySearchEntry.IsEditable = true; historySearchHbox.Add(historySearchEntry); Box.BoxChild w20 = (Box.BoxChild)historySearchHbox[historySearchEntry]; w20.Position = 1; historyTablVbox.Add(historySearchHbox); Box.BoxChild w21 = (Box.BoxChild)historyTablVbox[historySearchHbox]; w21.Position = 0; w21.Expand = false; w21.Fill = false; // Container child historyTablVbox.Box+BoxChild historyScrolledWindow = new ScrolledWindow(); historyScrolledWindow.Name = "historyScrolledWindow"; historyScrolledWindow.ShadowType = ShadowType.In; // Container child historyScrolledWindow.Container+ContainerChild historyTreeview = new TreeView(); historyTreeview.CanFocus = true; historyTreeview.Name = "historyTreeview"; historyScrolledWindow.Add(historyTreeview); historyTablVbox.Add(historyScrolledWindow); Box.BoxChild w23 = (Box.BoxChild)historyTablVbox[historyScrolledWindow]; w23.Position = 1; notebook.Add(historyTablVbox); Notebook.NotebookChild w24 = (Notebook.NotebookChild)notebook[historyTablVbox]; w24.Position = 2; // Notebook tab historyTabLabel = new Label(); historyTabLabel.Name = "historyTabLabel"; historyTabLabel.LabelProp = "History"; notebook.SetTabLabel(historyTablVbox, historyTabLabel); historyTabLabel.ShowAll(); topLevelVbox.Add(notebook); Box.BoxChild w25 = (Box.BoxChild)topLevelVbox[notebook]; w25.Position = 1; Add(topLevelVbox); if ((Child != null)) { Child.ShowAll(); } Show(); DeleteEvent += new DeleteEventHandler(OnDeleteEvent); button1.Clicked += new System.EventHandler(onNewCustomerClicked); button2.Clicked += new System.EventHandler(onNewApointmentButtonClicked); upcomingDropOffsTreeView.RowActivated += new RowActivatedHandler(onUpcomingDropOffsRowActivated); upcomingPickupsTreeview.RowActivated += new RowActivatedHandler(onUpcomingPickupsRowActivated); customerSearchEntry.Changed += new System.EventHandler(onCustomerSearchEntryChanged); customersTreeview.RowActivated += new RowActivatedHandler(onCustomersRowActivated); historySearchEntry.Changed += new System.EventHandler(onHistorySearchEntryChanged); historyTreeview.RowActivated += new RowActivatedHandler(onHistoryRowActivated); }
public Authentication() : base() { //this.SetIconFromFile ("../../icons/main_icon.ico"); this.Title = "Login"; this.BorderWidth = 10; //this.SetDefaultSize (200, 200); this.Resizable = false; isOk = false; mainBox = new VBox(); formFrame = new Frame(); //only container in this window to have a frame -> aesthetic purpose //Start with labels userInfo = new Label("Benvenuto! Autenticati per ottenere l'accesso: "); //labelFrame.Add (userInfo); mainBox.Add(userInfo); //entries username = new Entry(); this.CheckList.Add(false); password = new Entry(); this.CheckList.Add(false); password.Visibility = false; usernameLabel = new Label("Username"); passwordLabel = new Label("Password"); entryBox = new VBox(); labelEntryBox = new VBox(); //continue with login entries entryBox.Add(username); entryBox.Add(password); labelEntryBox.Add(usernameLabel); labelEntryBox.Add(passwordLabel); loginBox = new HBox(); loginBox.Add(labelEntryBox); loginBox.Add(entryBox); formFrame.Add(loginBox); mainBox.Add(formFrame); //finish adding buttons commitBox = new HButtonBox(); commit = new Button("Ok"); cancel = new Button("Annulla"); isMedic = new CheckButton("Medico"); commit.Show(); cancel.Show(); isMedic.Show(); commitBox.Add(isMedic); commitBox.Add(commit); commitBox.Add(cancel); mainBox.Add(commitBox); //buttonBoxFrame.Add (commitBox); this.Add(mainBox); //button funzionality implementation cancel.Clicked += new EventHandler(CancelWindowCloser); commit.Clicked += Commit_Clicked; isMedic.Toggled += (object sender, EventArgs e) => showMedic = true; //Events this.DeleteEvent += new DeleteEventHandler(WindowCloser); // CheckList /*this.username.FocusInEvent += new FocusInEventHandler(UsernameTestAndScan);*/ //last window settings this.SetPosition(WindowPosition.CenterAlways); this.ShowAll(); isInstantiated = true; //commit.HideAll(); }
public override void LaunchDialogue() { //the Type in the collection IList collection = (IList)parentRow.PropertyValue; string displayName = parentRow.PropertyDescriptor.DisplayName; //populate list with existing items itemStore = new ListStore(typeof(object), typeof(int), typeof(string)); for (int i = 0; i < collection.Count; i++) { itemStore.AppendValues(collection [i], i, collection [i].ToString()); } #region Building Dialogue //dialogue and buttons Dialog dialog = new Dialog(); dialog.Title = displayName + " Editor"; dialog.Modal = true; dialog.AllowGrow = true; dialog.AllowShrink = true; dialog.Modal = true; dialog.AddActionWidget(new Button(Stock.Cancel), ResponseType.Cancel); dialog.AddActionWidget(new Button(Stock.Ok), ResponseType.Ok); //three columns for items, sorting, PropGrid HBox hBox = new HBox(); dialog.VBox.PackStart(hBox, true, true, 5); //propGrid at end grid = new PropertyGrid(parentRow.ParentGrid.EditorManager); grid.CurrentObject = null; grid.WidthRequest = 200; grid.ShowHelp = false; hBox.PackEnd(grid, true, true, 5); //followed by item sorting buttons in ButtonBox VButtonBox sortButtonBox = new VButtonBox(); sortButtonBox.LayoutStyle = ButtonBoxStyle.Start; Button upButton = new Button(); Image upImage = new Image(Stock.GoUp, IconSize.Button); upImage.Show(); upButton.Add(upImage); upButton.Show(); sortButtonBox.Add(upButton); Button downButton = new Button(); Image downImage = new Image(Stock.GoDown, IconSize.Button); downImage.Show(); downButton.Add(downImage); downButton.Show(); sortButtonBox.Add(downButton); hBox.PackEnd(sortButtonBox, false, false, 5); //Third column is a VBox VBox itemsBox = new VBox(); hBox.PackStart(itemsBox, false, false, 5); //which at bottom has add/remove buttons HButtonBox addRemoveButtons = new HButtonBox(); addRemoveButtons.LayoutStyle = ButtonBoxStyle.End; Button addButton = new Button(Stock.Add); addRemoveButtons.Add(addButton); if (types [0].IsAbstract) { addButton.Sensitive = false; } Button removeButton = new Button(Stock.Remove); addRemoveButtons.Add(removeButton); itemsBox.PackEnd(addRemoveButtons, false, false, 10); //and at top has list (TreeView) in a ScrolledWindow ScrolledWindow listScroll = new ScrolledWindow(); listScroll.WidthRequest = 200; listScroll.HeightRequest = 320; itemsBox.PackStart(listScroll, true, true, 0); itemTree = new TreeView(itemStore); itemTree.Selection.Mode = SelectionMode.Single; itemTree.HeadersVisible = false; listScroll.AddWithViewport(itemTree); //renderers and attribs for TreeView CellRenderer rdr = new CellRendererText(); itemTree.AppendColumn(new TreeViewColumn("Index", rdr, "text", 1)); rdr = new CellRendererText(); itemTree.AppendColumn(new TreeViewColumn("Object", rdr, "text", 2)); #endregion #region Events addButton.Clicked += new EventHandler(addButton_Clicked); removeButton.Clicked += new EventHandler(removeButton_Clicked); itemTree.Selection.Changed += new EventHandler(Selection_Changed); upButton.Clicked += new EventHandler(upButton_Clicked); downButton.Clicked += new EventHandler(downButton_Clicked); #endregion //show and get response dialog.ShowAll(); ResponseType response = (ResponseType)dialog.Run(); dialog.Destroy(); //if 'OK' put items back in collection if (response == ResponseType.Ok) { DesignerTransaction tran = CreateTransaction(parentRow.ParentGrid.CurrentObject); object old = collection; try { collection.Clear(); foreach (object[] o in itemStore) { collection.Add(o[0]); } EndTransaction(parentRow.ParentGrid.CurrentObject, tran, old, collection, true); } catch { EndTransaction(parentRow.ParentGrid.CurrentObject, tran, old, collection, false); throw; } } //clean up so we start fresh if launched again itemTree = null; itemStore = null; grid = null; previousIter = TreeIter.Zero; }
public NoteRenameDialog(IList <Note> notes, string oldTitle, Note renamedNote) : base(Catalog.GetString("Rename Note Links?"), renamedNote.Window, DialogFlags.NoSeparator) { this.DefaultResponse = ResponseType.Cancel; this.BorderWidth = 10; var renameButton = (Button) AddButton(Catalog.GetString("_Rename Links"), ResponseType.Yes); var dontRenameButton = (Button) AddButton(Catalog.GetString("_Don't Rename Links"), ResponseType.No); this.notes = notes; notesModel = new Gtk.TreeStore(typeof(bool), typeof(string), typeof(Note)); foreach (var note in notes) { notesModel.AppendValues(true, note.Title, note); } var labelText = Catalog.GetString("Rename links in other notes from \"<span underline=\"single\">{0}</span>\" " + "to \"<span underline=\"single\">{1}</span>\"?\n\n" + "If you do not rename the links, " + "they will no longer link to anything."); var label = new Label(); label.UseMarkup = true; label.Markup = String.Format(labelText, GLib.Markup.EscapeText(oldTitle), GLib.Markup.EscapeText(renamedNote.Title)); label.LineWrap = true; VBox.PackStart(label, false, true, 5); var notesView = new TreeView(notesModel); notesView.SetSizeRequest(-1, 200); var toggleCell = new CellRendererToggle(); toggleCell.Activatable = true; var column = new TreeViewColumn(Catalog.GetString("Rename Links"), toggleCell, "active", 0); column.SortColumnId = 0; column.Resizable = true; notesView.AppendColumn(column); toggleCell.Toggled += (o, args) => { TreeIter iter; if (!notesModel.GetIterFromString(out iter, args.Path)) { return; } bool val = (bool)notesModel.GetValue(iter, 0); notesModel.SetValue(iter, 0, !val); }; column = new TreeViewColumn(Catalog.GetString("Note Title"), new CellRendererText(), "text", 1); column.SortColumnId = 1; column.Resizable = true; notesView.AppendColumn(column); notesView.RowActivated += (o, args) => { TreeIter iter; if (!notesModel.GetIter(out iter, args.Path)) { return; } Note note = (Note)notesModel.GetValue(iter, 2); if (note != null) { note.Window.Present(); NoteFindBar find = note.Window.Find; find.ShowAll(); find.Visible = true; find.SearchText = "\"" + oldTitle + "\""; } }; var notesBox = new VBox(false, 5); var selectAllButton = new Button(); // Translators: This button causes all notes in the list to be selected selectAllButton.Label = Catalog.GetString("Select All"); selectAllButton.Clicked += (o, e) => { notesModel.Foreach((model, path, iter) => { notesModel.SetValue(iter, 0, true); return(false); }); }; var selectNoneButton = new Button(); // Translators: This button causes all notes in the list to be unselected selectNoneButton.Label = Catalog.GetString("Select None"); selectNoneButton.Clicked += (o, e) => { notesModel.Foreach((model, path, iter) => { notesModel.SetValue(iter, 0, false); return(false); }); }; var notesButtonBox = new HButtonBox(); notesButtonBox.Add(selectNoneButton); notesButtonBox.Add(selectAllButton); notesButtonBox.Spacing = 5; notesButtonBox.LayoutStyle = ButtonBoxStyle.End; var notesScroll = new ScrolledWindow(); notesScroll.Add(notesView); notesBox.PackStart(notesScroll); notesBox.PackStart(notesButtonBox, false, true, 0); var advancedExpander = new Expander(Catalog.GetString("Ad_vanced")); var expandBox = new VBox(); expandBox.PackStart(notesBox); alwaysShowDlgRadio = new RadioButton(Catalog.GetString("Always show this _window")); alwaysShowDlgRadio.Clicked += (o, e) => { selectAllButton.Click(); notesBox.Sensitive = true; renameButton.Sensitive = true; dontRenameButton.Sensitive = true; }; neverRenameRadio = new RadioButton(alwaysShowDlgRadio, Catalog.GetString("Never rename _links")); neverRenameRadio.Clicked += (o, e) => { selectNoneButton.Click(); notesBox.Sensitive = false; renameButton.Sensitive = false; dontRenameButton.Sensitive = true; }; alwaysRenameRadio = new RadioButton(alwaysShowDlgRadio, Catalog.GetString("Alwa_ys rename links")); alwaysRenameRadio.Clicked += (o, e) => { selectAllButton.Click(); notesBox.Sensitive = false; renameButton.Sensitive = true; dontRenameButton.Sensitive = false; }; expandBox.PackStart(alwaysShowDlgRadio, false, true, 0); expandBox.PackStart(neverRenameRadio, false, true, 0); expandBox.PackStart(alwaysRenameRadio, false, true, 0); advancedExpander.Add(expandBox); VBox.PackStart(advancedExpander, true, true, 5); advancedExpander.Activated += (o, e) => this.Resizable = advancedExpander.Expanded; this.Focus = dontRenameButton; VBox.ShowAll(); }
public Authentication() : base(Gtk.WindowType.Toplevel) { this.Title = "Login"; this.BorderWidth = 10; //this.SetDefaultSize (200, 200); this.Resizable = false; VBox mainBox = new VBox(); Frame formFrame = new Frame(); //only container in this window to have a frame -> aesthetic purpose //Start with labels Label userInfo = new Label("Welcome! Authenticate to access data: "); //labelFrame.Add (userInfo); mainBox.Add(userInfo); //entries Entry username = new Entry(); Entry password = new Entry(); password.Visibility = false; Label usernameLabel = new Label("Username"); Label passwordLabel = new Label("Password"); VBox entryBox = new VBox(); VBox labelEntryBox = new VBox(); //continue with login entries entryBox.Add(username); entryBox.Add(password); labelEntryBox.Add(usernameLabel); labelEntryBox.Add(passwordLabel); HBox loginBox = new HBox(); loginBox.Add(labelEntryBox); loginBox.Add(entryBox); formFrame.Add(loginBox); mainBox.Add(formFrame); //finish adding buttons HButtonBox commitBox = new HButtonBox(); Button commit = new Button("Ok"); Button cancel = new Button("Cancel"); commit.Show(); cancel.Show(); commitBox.Add(commit); commitBox.Add(cancel); mainBox.Add(commitBox); //buttonBoxFrame.Add (commitBox); this.Add(mainBox); //button funzionality implementation cancel.Clicked += new EventHandler(CancelWindowCloser); commit.Clicked += new EventHandler(Commit); //Events this.DeleteEvent += new DeleteEventHandler(WindowCloser); //last window settings this.SetPosition(WindowPosition.CenterAlways); this.ShowAll(); } //end of constructor
void CreateEndButtons() { var b = new Button(); b.Label = "Neues Spiel"; b.Clicked += HandleNewGameClicked; buttonBox.Add(b); }
protected virtual void Build() { // Widget BizeeBirdBoarding.Ui.CustomerDialog Name = "BizeeBirdBoarding.Ui.CustomerDialog"; Title = "New Customer"; WindowPosition = WindowPosition.CenterOnParent; // Internal child BizeeBirdBoarding.Ui.CustomerDialog.VBox VBox w1 = VBox; w1.Name = "newCustomerDialog_VBox"; w1.BorderWidth = 2; // Container child newCustomerDialog_VBox.Box+BoxChild toplevelVbox = new VBox(); toplevelVbox.Name = "toplevelVbox"; toplevelVbox.Spacing = 6; // Container child toplevelVbox.Box+BoxChild topTable = new Table(5, 2, false); topTable.Name = "topTable"; topTable.RowSpacing = 6; topTable.ColumnSpacing = 6; // Container child topTable.Table+TableChild boardingRateLabel = new Label(); boardingRateLabel.Name = "boardingRateLabel"; boardingRateLabel.LabelProp = "Boarding Rate"; topTable.Add(boardingRateLabel); Table.TableChild w2 = (Table.TableChild)topTable[boardingRateLabel]; w2.TopAttach = 3; w2.BottomAttach = 4; w2.XOptions = AttachOptions.Fill; w2.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild boardingRateSpinButton = new SpinButton(0D, 100D, 1D); boardingRateSpinButton.CanFocus = true; boardingRateSpinButton.Name = "boardingRateSpinButton"; boardingRateSpinButton.Adjustment.PageIncrement = 10D; boardingRateSpinButton.ClimbRate = 1D; boardingRateSpinButton.Digits = 2; boardingRateSpinButton.Numeric = true; topTable.Add(boardingRateSpinButton); Table.TableChild w3 = (Table.TableChild)topTable[boardingRateSpinButton]; w3.TopAttach = 3; w3.BottomAttach = 4; w3.LeftAttach = 1; w3.RightAttach = 2; w3.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild customerNameEntry = new Entry(); customerNameEntry.CanFocus = true; customerNameEntry.Name = "customerNameEntry"; customerNameEntry.IsEditable = true; topTable.Add(customerNameEntry); Table.TableChild w4 = ((Table.TableChild)(topTable[customerNameEntry])); w4.LeftAttach = 1; w4.RightAttach = 2; w4.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild customerNotesLabel = new Label(); customerNotesLabel.Name = "customerNotesLabel"; customerNotesLabel.LabelProp = "Notes"; topTable.Add(customerNotesLabel); Table.TableChild w5 = ((Table.TableChild)(topTable[customerNotesLabel])); w5.TopAttach = 4; w5.BottomAttach = 5; w5.XOptions = AttachOptions.Fill; w5.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild customerNotesScrolledWindow = new ScrolledWindow(); customerNotesScrolledWindow.Name = "customerNotesScrolledWindow"; customerNotesScrolledWindow.ShadowType = ShadowType.In; // Container child customerNotesScrolledWindow.Container+ContainerChild customerNotesTextView = new TextView(); customerNotesTextView.CanFocus = true; customerNotesTextView.Name = "customerNotesTextView"; customerNotesScrolledWindow.Add(customerNotesTextView); topTable.Add(customerNotesScrolledWindow); Table.TableChild w7 = ((Table.TableChild)(topTable[customerNotesScrolledWindow])); w7.TopAttach = 4; w7.BottomAttach = 5; w7.LeftAttach = 1; w7.RightAttach = 2; // Container child topTable.Table+TableChild emailEntry = new Entry(); emailEntry.CanFocus = true; emailEntry.Name = "emailEntry"; emailEntry.IsEditable = true; topTable.Add(emailEntry); Table.TableChild w8 = (Table.TableChild)topTable[emailEntry]; w8.TopAttach = 2; w8.BottomAttach = 3; w8.LeftAttach = 1; w8.RightAttach = 2; w8.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild emailLabel = new Label(); emailLabel.Name = "emailLabel"; emailLabel.LabelProp = "E-mail"; topTable.Add(emailLabel); Table.TableChild w9 = (Table.TableChild)topTable[emailLabel]; w9.TopAttach = 2; w9.BottomAttach = 3; w9.XOptions = AttachOptions.Fill; w9.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild nameLabel = new Label(); nameLabel.Name = "nameLabel"; nameLabel.LabelProp = "Name"; topTable.Add(nameLabel); Table.TableChild w10 = (Table.TableChild)topTable[nameLabel]; w10.XOptions = AttachOptions.Fill; w10.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild phoneNumberContainerVbox = new VBox(); phoneNumberContainerVbox.Name = "phoneNumberContainerVbox"; phoneNumberContainerVbox.Spacing = 6; topTable.Add(phoneNumberContainerVbox); Table.TableChild w11 = (Table.TableChild)topTable[phoneNumberContainerVbox]; w11.TopAttach = 1; w11.BottomAttach = 2; w11.LeftAttach = 1; w11.RightAttach = 2; w11.XOptions = AttachOptions.Fill; w11.YOptions = AttachOptions.Fill; // Container child topTable.Table+TableChild phoneNumberLabel = new Label(); phoneNumberLabel.Name = "phoneNumberLabel"; phoneNumberLabel.LabelProp = "Phone Number"; topTable.Add(phoneNumberLabel); Table.TableChild w12 = (Table.TableChild)topTable[phoneNumberLabel]; w12.TopAttach = 1; w12.BottomAttach = 2; w12.XOptions = AttachOptions.Fill; w12.YOptions = AttachOptions.Fill; toplevelVbox.Add(topTable); Box.BoxChild w13 = (Box.BoxChild)toplevelVbox[topTable]; w13.Position = 0; // Container child toplevelVbox.Box+BoxChild birdsFrame = new Frame(); birdsFrame.Name = "birdsFrame"; birdsFrame.ShadowType = ShadowType.In; // Container child birdsFrame.Container+ContainerChild birdsGtkAlignment = new Alignment(0F, 0F, 1F, 1F); birdsGtkAlignment.Name = "birdsGtkAlignment"; birdsGtkAlignment.LeftPadding = 12; // Container child birdsGtkAlignment.Container+ContainerChild birdsHbox = new HBox(); birdsHbox.Name = "birdsHbox"; birdsHbox.Spacing = 6; // Container child birdsHbox.Box+BoxChild birdsVBox = new VBox(); birdsVBox.Name = "birdsVBox"; birdsVBox.Spacing = 6; // Container child birdsVBox.Box+BoxChild GtkScrolledWindow = new ScrolledWindow(); GtkScrolledWindow.Name = "GtkScrolledWindow"; GtkScrolledWindow.ShadowType = ShadowType.In; // Container child GtkScrolledWindow.Container+ContainerChild birdsTreeView = new TreeView(); birdsTreeView.WidthRequest = 300; birdsTreeView.CanFocus = true; birdsTreeView.Name = "birdsTreeView"; GtkScrolledWindow.Add(birdsTreeView); birdsVBox.Add(GtkScrolledWindow); Box.BoxChild w15 = (Box.BoxChild)birdsVBox[GtkScrolledWindow]; w15.Position = 0; // Container child birdsVBox.Box+BoxChild birdsButtonBox = new HButtonBox(); birdsButtonBox.Name = "birdsButtonBox"; // Container child birdsButtonBox.ButtonBox+ButtonBoxChild addBirdButton = new Button(); addBirdButton.CanFocus = true; addBirdButton.Name = "addBirdButton"; addBirdButton.UseStock = true; addBirdButton.UseUnderline = true; addBirdButton.Label = "gtk-add"; birdsButtonBox.Add(addBirdButton); ButtonBox.ButtonBoxChild w16 = (ButtonBox.ButtonBoxChild)birdsButtonBox[addBirdButton]; w16.Expand = false; w16.Fill = false; // Container child birdsButtonBox.ButtonBox+ButtonBoxChild removeBirdButton = new Button(); removeBirdButton.CanFocus = true; removeBirdButton.Name = "removeBirdButton"; removeBirdButton.UseStock = true; removeBirdButton.UseUnderline = true; removeBirdButton.Label = "gtk-remove"; birdsButtonBox.Add(removeBirdButton); ButtonBox.ButtonBoxChild w17 = (ButtonBox.ButtonBoxChild)birdsButtonBox[removeBirdButton]; w17.Position = 1; w17.Expand = false; w17.Fill = false; birdsVBox.Add(birdsButtonBox); Box.BoxChild w18 = (Box.BoxChild)birdsVBox[birdsButtonBox]; w18.Position = 1; w18.Expand = false; w18.Fill = false; birdsHbox.Add(birdsVBox); Box.BoxChild w19 = (Box.BoxChild)birdsHbox[birdsVBox]; w19.Position = 0; // Container child birdsHbox.Box+BoxChild birdsTable = new Table(6, 2, false); birdsTable.Name = "birdsTable"; birdsTable.RowSpacing = 6; birdsTable.ColumnSpacing = 6; // Container child birdsTable.Table+TableChild birdAgeLabel = new Label(); birdAgeLabel.Name = "birdAgeLabel"; birdAgeLabel.LabelProp = "Age"; birdsTable.Add(birdAgeLabel); Table.TableChild w20 = (Table.TableChild)birdsTable[birdAgeLabel]; w20.TopAttach = 3; w20.BottomAttach = 4; w20.XOptions = AttachOptions.Fill; w20.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdAgeSpinButton = new SpinButton(0D, 100D, 1D); birdAgeSpinButton.CanFocus = true; birdAgeSpinButton.Name = "birdAgeSpinButton"; birdAgeSpinButton.Adjustment.PageIncrement = 10D; birdAgeSpinButton.ClimbRate = 1D; birdAgeSpinButton.Numeric = true; birdsTable.Add(birdAgeSpinButton); Table.TableChild w21 = (Table.TableChild)birdsTable[birdAgeSpinButton]; w21.TopAttach = 3; w21.BottomAttach = 4; w21.LeftAttach = 1; w21.RightAttach = 2; w21.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdBreedEntry = new Entry(); birdBreedEntry.CanFocus = true; birdBreedEntry.Name = "birdBreedEntry"; birdBreedEntry.IsEditable = true; birdsTable.Add(birdBreedEntry); Table.TableChild w22 = (Table.TableChild)birdsTable[birdBreedEntry]; w22.TopAttach = 1; w22.BottomAttach = 2; w22.LeftAttach = 1; w22.RightAttach = 2; w22.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdBreedLabel = new Label(); birdBreedLabel.Name = "birdBreedLabel"; birdBreedLabel.LabelProp = "Breed"; birdsTable.Add(birdBreedLabel); Table.TableChild w23 = (Table.TableChild)birdsTable[birdBreedLabel]; w23.TopAttach = 1; w23.BottomAttach = 2; w23.XOptions = AttachOptions.Fill; w23.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdColorEntry = new Entry(); birdColorEntry.CanFocus = true; birdColorEntry.Name = "birdColorEntry"; birdColorEntry.IsEditable = true; birdsTable.Add(birdColorEntry); Table.TableChild w24 = (Table.TableChild)birdsTable[birdColorEntry]; w24.TopAttach = 2; w24.BottomAttach = 3; w24.LeftAttach = 1; w24.RightAttach = 2; w24.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdColorLabel = new Label(); birdColorLabel.Name = "birdColorLabel"; birdColorLabel.LabelProp = "Color"; birdsTable.Add(birdColorLabel); Table.TableChild w25 = (Table.TableChild)birdsTable[birdColorLabel]; w25.TopAttach = 2; w25.BottomAttach = 3; w25.XOptions = AttachOptions.Fill; w25.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdGenderHbox = new HBox(); birdGenderHbox.Name = "birdGenderHbox"; birdGenderHbox.Spacing = 6; // Container child birdGenderHbox.Box+BoxChild birdGenderMaleRadioButton = new RadioButton("Male"); birdGenderMaleRadioButton.CanFocus = true; birdGenderMaleRadioButton.Name = "birdGenderMaleRadioButton"; birdGenderMaleRadioButton.DrawIndicator = true; birdGenderMaleRadioButton.UseUnderline = true; birdGenderMaleRadioButton.Group = new GLib.SList(System.IntPtr.Zero); birdGenderHbox.Add(birdGenderMaleRadioButton); Box.BoxChild w26 = (Box.BoxChild)birdGenderHbox[birdGenderMaleRadioButton]; w26.Position = 0; // Container child birdGenderHbox.Box+BoxChild birdGenderFemaleRadioButton = new RadioButton("Female"); birdGenderFemaleRadioButton.CanFocus = true; birdGenderFemaleRadioButton.Name = "birdGenderFemaleRadioButton"; birdGenderFemaleRadioButton.DrawIndicator = true; birdGenderFemaleRadioButton.UseUnderline = true; birdGenderFemaleRadioButton.Group = birdGenderMaleRadioButton.Group; birdGenderHbox.Add(birdGenderFemaleRadioButton); Box.BoxChild w27 = (Box.BoxChild)birdGenderHbox[birdGenderFemaleRadioButton]; w27.Position = 1; birdsTable.Add(birdGenderHbox); Table.TableChild w28 = (Table.TableChild)birdsTable[birdGenderHbox]; w28.TopAttach = 4; w28.BottomAttach = 5; w28.LeftAttach = 1; w28.RightAttach = 2; w28.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdGenderLabel = new Label(); birdGenderLabel.Name = "birdGenderLabel"; birdGenderLabel.LabelProp = "Gender"; birdsTable.Add(birdGenderLabel); Table.TableChild w29 = (Table.TableChild)birdsTable[birdGenderLabel]; w29.TopAttach = 4; w29.BottomAttach = 5; w29.XOptions = AttachOptions.Fill; w29.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdNameEntry = new Entry(); birdNameEntry.CanFocus = true; birdNameEntry.Name = "birdNameEntry"; birdNameEntry.IsEditable = true; birdsTable.Add(birdNameEntry); Table.TableChild w30 = (Table.TableChild)birdsTable[birdNameEntry]; w30.LeftAttach = 1; w30.RightAttach = 2; w30.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdNameLabel = new Label(); birdNameLabel.Name = "birdNameLabel"; birdNameLabel.LabelProp = "Name"; birdsTable.Add(birdNameLabel); Table.TableChild w31 = (Table.TableChild)birdsTable[birdNameLabel]; w31.XOptions = AttachOptions.Fill; w31.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdNotesLabel = new Label(); birdNotesLabel.Name = "birdNotesLabel"; birdNotesLabel.LabelProp = "Notes"; birdsTable.Add(birdNotesLabel); Table.TableChild w32 = (Table.TableChild)birdsTable[birdNotesLabel]; w32.TopAttach = 5; w32.BottomAttach = 6; w32.XOptions = AttachOptions.Fill; w32.YOptions = AttachOptions.Fill; // Container child birdsTable.Table+TableChild birdNotesScrolledWindow = new ScrolledWindow(); birdNotesScrolledWindow.Name = "birdNotesScrolledWindow"; birdNotesScrolledWindow.ShadowType = ShadowType.In; // Container child birdNotesScrolledWindow.Container+ContainerChild birdNotesTextView = new TextView(); birdNotesTextView.CanFocus = true; birdNotesTextView.Name = "birdNotesTextView"; birdNotesScrolledWindow.Add(birdNotesTextView); birdsTable.Add(birdNotesScrolledWindow); Table.TableChild w34 = (Table.TableChild)birdsTable[birdNotesScrolledWindow]; w34.TopAttach = 5; w34.BottomAttach = 6; w34.LeftAttach = 1; w34.RightAttach = 2; birdsHbox.Add(birdsTable); Box.BoxChild w35 = (Box.BoxChild)birdsHbox[birdsTable]; w35.Position = 1; birdsGtkAlignment.Add(birdsHbox); birdsFrame.Add(birdsGtkAlignment); birdsFrameLabel = new Label(); birdsFrameLabel.Name = "birdsFrameLabel"; birdsFrameLabel.LabelProp = "<b>Birds</b>"; birdsFrameLabel.UseMarkup = true; birdsFrame.LabelWidget = birdsFrameLabel; toplevelVbox.Add(birdsFrame); Box.BoxChild w38 = (Box.BoxChild)toplevelVbox[birdsFrame]; w38.Position = 1; w1.Add(toplevelVbox); Box.BoxChild w39 = (Box.BoxChild)w1[toplevelVbox]; w39.Position = 0; // Internal child BizeeBirdBoarding.Ui.CustomerDialog.ActionArea HButtonBox w40 = ActionArea; w40.Name = "newCustomerDialog_ActionArea"; w40.Spacing = 10; w40.BorderWidth = 5; w40.LayoutStyle = ButtonBoxStyle.End; // Container child newCustomerDialog_ActionArea.ButtonBox+ButtonBoxChild buttonCancel = new Button(); buttonCancel.CanDefault = true; buttonCancel.CanFocus = true; buttonCancel.Name = "buttonCancel"; buttonCancel.UseStock = true; buttonCancel.UseUnderline = true; buttonCancel.Label = "gtk-cancel"; AddActionWidget(buttonCancel, -6); ButtonBox.ButtonBoxChild w41 = (ButtonBox.ButtonBoxChild)w40[buttonCancel]; w41.Expand = false; w41.Fill = false; // Container child newCustomerDialog_ActionArea.ButtonBox+ButtonBoxChild buttonOk = new Button(); buttonOk.CanDefault = true; buttonOk.CanFocus = true; buttonOk.Name = "buttonOk"; buttonOk.UseStock = true; buttonOk.UseUnderline = true; buttonOk.Label = "gtk-ok"; AddActionWidget(buttonOk, -5); ButtonBox.ButtonBoxChild w42 = (ButtonBox.ButtonBoxChild)w40[buttonOk]; w42.Position = 1; w42.Expand = false; w42.Fill = false; if ((Child != null)) { Child.ShowAll(); } DefaultWidth = 551; DefaultHeight = 490; Show(); addBirdButton.Clicked += new System.EventHandler(onBirdAddButtonClicked); removeBirdButton.Clicked += new System.EventHandler(onBirdRemoveButtonClicked); buttonCancel.Clicked += new System.EventHandler(onCancelButtonClicked); buttonOk.Clicked += new System.EventHandler(onOkButtonClicked); }
public SparkleDialog() : base("") { DefaultSize = new Gdk.Size(360, 260); BorderWidth = 0; IconName = "folder-sparkleshare"; Resizable = true; WindowPosition = WindowPosition.Center; Title = "About SparkleShare"; Resizable = false; Gdk.Color color = Style.Foreground(StateType.Insensitive); string secondary_text_color = SparkleUIHelpers.GdkColorToHex(color); EventBox box = new EventBox(); box.ModifyBg(StateType.Normal, new TreeView().Style.Base(StateType.Normal)); Label header = new Label() { Markup = "<span font_size='xx-large'>SparkleShare</span>\n<span fgcolor='" + secondary_text_color + "'><small>" + Defines.VERSION + "</small></span>", Xalign = 0, Xpad = 18, Ypad = 18 }; box.Add(header); Label license = new Label() { Xalign = 0, Xpad = 18, Ypad = 22, LineWrap = true, Wrap = true, LineWrapMode = Pango.WrapMode.Word, Markup = "<small>Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others\n" + "\n" + "SparkleShare is Free and Open Source Software. " + "You are free to use, modify, and redistribute it " + "under the terms of the GNU General Public License version 3 or later.</small>" }; VBox vbox = new VBox(false, 0) { BorderWidth = 0 }; HButtonBox button_bar = new HButtonBox() { BorderWidth = 12 }; Button credits_button = new Button(_("_Show Credits")) { UseUnderline = true }; credits_button.Clicked += delegate { Process process = new Process(); process.StartInfo.FileName = "xdg-open"; process.StartInfo.Arguments = "http://www.sparkleshare.org/credits"; process.Start(); }; Button website_button = new Button(_("_Visit Website")) { UseUnderline = true }; website_button.Clicked += delegate { Process process = new Process(); process.StartInfo.FileName = "xdg-open"; process.StartInfo.Arguments = "http://www.sparkleshare.org/"; process.Start(); }; button_bar.Add(website_button); button_bar.Add(credits_button); vbox.PackStart(box, true, true, 0); vbox.PackStart(license, true, true, 0); vbox.PackStart(button_bar, false, false, 0); Add(vbox); }
public MainWindow(PlotBox[] graphs) : base() { //MainWindow Proprieties this.SetDefaultSize(400, 400); //this.SetIconFromFile ("../../icons/main_icon.ico"); this.BorderWidth = 4; //background this.background = new Table(cellX, cellY, false); this.Add(background); background.RowSpacing = 10; background.ColumnSpacing = 10; //monitor this.monitorFrame = new Frame(); background.Attach(monitorFrame, 0, cellX - 1, 0, cellY - 1); this.monitor = new VBox(); monitorFrame.Add(monitor); this.monitorDeck = new VBox(); monitor.Add(monitorDeck); this.monitorSpace = new MonitorScrollableSpace(monitorDeck); //this.surface2d = new PlotSurface2D(); //int[] x = { 1, 3, 5, 7, 9, 11, 13 }; //int[] y = { 3, 4, 10, 11, 34, 1, 0 }; //test filler //Image[] prova = new Image[20]; //PlotWindow[] graphs = new PlotWindow[20]; this.graphs = graphs; for (int i = 0; i < numberOfBox; i++) { //prova[i] = new Image("../../icons/Heartbeat.jpg"); graphs[i] = new PlotBox(i + 1); monitorSpace.getContainer().PackStart(graphs[i], true, true, 4); monitorSpace.getContainer().Add(graphs[i]); } //warning this.warningFrame = new Frame(); background.Attach(warningFrame, 0, cellX, cellY - 1, cellY); this.warningBox = new VBox(); warningFrame.Add(warningBox); this.warningLabel = new Label(warningFillerText); warningBox.Add(warningLabel); //toolbar this.toolbarFrame = new Frame("Toolbar"); this.toolbar = new VBox(); background.Attach(toolbarFrame, cellX - 1, cellX, 0, cellY - 1); toolbarFrame.Add(toolbar); toolbar.Spacing = 10; //login this.loginFrame = new Frame("Account"); loginFrame.BorderWidth = 10; this.loginBox = new VBox(); this.loginButtonBox = new HButtonBox(); this.loginButton = new Button(); toolbar.PackStart(loginFrame, false, false, 20); toolbar.Add(loginFrame); loginFrame.Add(loginBox); loginBox.PackStart(loginButtonBox, false, false, 10); loginBox.Add(loginButtonBox); loginButtonBox.PackStart(loginButton, false, false, 0); loginButtonBox.Add(loginButton); //image button this.imageBox = new HBox(); this.accountImage = new Image("../../icons/account.png"); loginButton.Add(imageBox); imageBox.PackStart(accountImage, false, false, 3); imageBox.Add(accountImage); //accountImage.SetSizeRequest(128, 128); this.loginLabel = new Label(loginText); imageBox.PackStart(loginLabel, false, false, 0); imageBox.Add(loginLabel); //Buttons loginButton.Clicked += new EventHandler(OpenLoginWindow); }
private void CreateEventLog() { LayoutVertical = new VBox(false, 0); ScrolledWindow = new ScrolledWindow(); WebView = new WebView() { Editable = false }; WebView.HoveringOverLink += delegate(object o, WebKit.HoveringOverLinkArgs args) { LinkStatus = args.Link; }; WebView.NavigationRequested += delegate(object o, WebKit.NavigationRequestedArgs args) { if (args.Request.Uri == LinkStatus) { Process process = new Process(); process.StartInfo.FileName = "xdg-open"; process.StartInfo.Arguments = args.Request.Uri.Replace(" ", "\\ "); // Escape space-characters process.Start(); // FIXME: Use the right event, waiting for newer webkit bindings UpdateEventLog(); } }; ScrolledWindow.AddWithViewport(WebView); LayoutVertical.PackStart(ScrolledWindow, true, true, 0); UpdateEventLog(); HButtonBox dialog_buttons = new HButtonBox { Layout = ButtonBoxStyle.Edge, BorderWidth = 12 }; Button open_folder_button = new Button(_("_Open Folder")) { UseUnderline = true }; open_folder_button.Clicked += delegate(object o, EventArgs args) { Process process = new Process(); process.StartInfo.FileName = "xdg-open"; process.StartInfo.Arguments = LocalPath.Replace(" ", "\\ "); // Escape space-characters process.Start(); }; Button close_button = new Button(Stock.Close); close_button.Clicked += delegate { HideAll(); }; dialog_buttons.Add(open_folder_button); dialog_buttons.Add(close_button); // We have to hide the menubar somewhere... LayoutVertical.PackStart(CreateShortcutsBar(), false, false, 0); LayoutVertical.PackStart(dialog_buttons, false, false, 0); Add(LayoutVertical); }
public StructureDatabaseView(string fileName) { this.filename = fileName; hbox = new HBox(); sqlLiteDal = new SqlLiteDal(fileName); lblTable = new Label(MainClass.Languages.Translate("tables")); hbox.PackStart(lblTable, false, false, 10); cbTable = new ComboBox(); cbTable.Changed += new EventHandler(OnComboProjectChanged); CellRendererText textRenderer = new CellRendererText(); cbTable.PackStart(textRenderer, true); cbTable.AddAttribute(textRenderer, "text", 0); cbTable.Model = tablesComboModel; cbTable.WidthRequest = 200; hbox.PackStart(cbTable, false, false, 2); hbox.PackEnd(new Label(""), true, true, 2); HButtonBox hbbAction = new HButtonBox(); hbbAction.LayoutStyle = Gtk.ButtonBoxStyle.Start; hbbAction.Spacing = 6; Button btnAddTable = new Button(MainClass.Languages.Translate("add_table")); btnAddTable.Clicked += delegate(object sender, EventArgs e) { SqlLiteAddTable addtable = new SqlLiteAddTable(filename); int result = addtable.Run(); if (result == (int)ResponseType.Ok) { GetTables(); } addtable.Destroy(); }; Button btnDeleteTable = new Button(MainClass.Languages.Translate("delete_table")); btnDeleteTable.Clicked += delegate(object sender, EventArgs e) { if (!CheckSelectTable()) { return; } MessageDialogs md = new MessageDialogs(MessageDialogs.DialogButtonType.YesNo, MainClass.Languages.Translate("permanently_delete_table", curentTable), "", Gtk.MessageType.Question); int result = md.ShowDialog(); if (result != (int)Gtk.ResponseType.Yes) { return; } DropTable(); GetTables(); }; Button btnEditTable = new Button(MainClass.Languages.Translate("edit_table")); btnEditTable.Clicked += delegate(object sender, EventArgs e) { if (!CheckSelectTable()) { return; } SqlLiteEditTable editTable = new SqlLiteEditTable(filename, curentTable); int result = editTable.Run(); if (result == (int)ResponseType.Ok) { GetTables(); } editTable.Destroy(); }; hbbAction.Add(btnAddTable); hbbAction.Add(btnDeleteTable); hbbAction.Add(btnEditTable); hbox.PackEnd(hbbAction, false, false, 10); this.PackStart(hbox, false, false, 5); ScrolledWindow sw = new ScrolledWindow(); sw.ShadowType = ShadowType.EtchedIn; sw.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); treeView = new TreeView(tableModel); GenerateColumns(); treeView.RulesHint = true; //treeView.SearchColumn = (int) Column.Description; sw.Add(treeView); this.PackStart(sw, true, true, 5); ScrolledWindow sw2 = new ScrolledWindow(); sw2.ShadowType = ShadowType.EtchedIn; sw2.SetPolicy(PolicyType.Automatic, PolicyType.Automatic); sw2.HeightRequest = 50; textControl = new TextView(); textControl.Editable = false; textControl.HeightRequest = 50; sw2.Add(textControl); this.PackEnd(sw2, false, false, 5); this.ShowAll(); GetTables(); //cbTable.Active = 0; }