/// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary> public SummaryView(ViewBase owner) : base(owner) { topBox = new HBox(); SummaryCheckBox = new CheckBoxView(this); SummaryCheckBox.TextOfLabel = "Capture summary?"; WarningCheckBox = new CheckBoxView(this); WarningCheckBox.TextOfLabel = "Capture warning messages?"; ErrorCheckBox = new CheckBoxView(this); ErrorCheckBox.TextOfLabel = "Capture error messages?"; topBox.PackStart(SummaryCheckBox.MainWidget, false, false, 10); topBox.PackStart(WarningCheckBox.MainWidget, false, false, 10); topBox.PackStart(ErrorCheckBox.MainWidget, false, false, 10); middleBox = new HBox(); SimulationDropDown = new DropDownView(this); middleBox.PackStart(new Label("Simulation:"), false, false, 10); middleBox.PackStart(SimulationDropDown.MainWidget, true, true, 10); mainControl = new VBox(); mainWidget = mainControl; mainControl.PackStart(topBox, false, false, 0); mainControl.PackStart(middleBox, false, false, 0); HtmlView = new HTMLView(this); mainControl.PackEnd(HtmlView.MainWidget, true, true, 0); mainWidget.Destroyed += MainWidgetDestroyed; }
/// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary> public SummaryView(ViewBase owner) : base(owner) { Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.SummaryView.glade", "vbox1"); gxml.Autoconnect(this); _mainWidget = vbox1; combobox1.PackStart(comboRender, false); combobox1.AddAttribute(comboRender, "text", 0); combobox1.Model = comboModel; htmlview = new HTMLView(this); layout1.Add(htmlview.MainWidget); }
/// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary> public SummaryView(ViewBase owner) : base(owner) { Glade.XML gxml = new Glade.XML("ApsimNG.Resources.Glade.SummaryView.glade", "vbox1"); gxml.Autoconnect(this); _mainWidget = vbox1; combobox1.PackStart(comboRender, false); combobox1.AddAttribute(comboRender, "text", 0); combobox1.Model = comboModel; htmlview = new HTMLView(this); vbox1.PackEnd(htmlview.MainWidget, true, true, 0); }
/// <summary>Initializes a new instance of the <see cref="SummaryView"/> class.</summary> public SummaryView(ViewBase owner) : base(owner) { Builder builder = new Builder("ApsimNG.Resources.Glade.SummaryView.glade"); vbox1 = (VBox)builder.GetObject("vbox1"); combobox1 = (ComboBox)builder.GetObject("combobox1"); _mainWidget = vbox1; combobox1.PackStart(comboRender, false); combobox1.AddAttribute(comboRender, "text", 0); combobox1.Model = comboModel; combobox1.Changed += comboBox1_TextChanged; htmlview = new HTMLView(this); vbox1.PackEnd(htmlview.MainWidget, true, true, 0); }
/// <summary> /// Add a description to the right hand view. /// </summary> /// <param name="description">The description to show.</param> public void AddDescriptionToRightHandView(string description) { if (description == null) { if (descriptionView != null) { rightHandView.Remove(descriptionView.MainWidget); descriptionView.MainWidget.Destroy(); } descriptionView = null; } else { if (descriptionView == null) { descriptionView = new HTMLView(this); rightHandView.PackStart(descriptionView.MainWidget, false, false, 0); } descriptionView.SetContents(description, false); } }
/// <summary> /// Constructor /// </summary> public UpgradeView(ViewBase owner) : base(owner) { Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.UpgradeView.glade"); window1 = (Window)builder.GetObject("window1"); button1 = (Button)builder.GetObject("button1"); button2 = (Button)builder.GetObject("button2"); table1 = (Table)builder.GetObject("table1"); table2 = (Table)builder.GetObject("table2"); firstNameBox = (Entry)builder.GetObject("firstNameBox"); lastNameBox = (Entry)builder.GetObject("lastNameBox"); organisationBox = (Entry)builder.GetObject("organisationBox"); emailBox = (Entry)builder.GetObject("emailBox"); countryBox = (ComboBox)builder.GetObject("countryBox"); label1 = (Label)builder.GetObject("label1"); htmlAlign = (Alignment)builder.GetObject("HTMLalign"); checkbutton1 = (CheckButton)builder.GetObject("checkbutton1"); listview1 = (Gtk.TreeView)builder.GetObject("listview1"); alignment7 = (Alignment)builder.GetObject("alignment7"); oldVersions = (CheckButton)builder.GetObject("checkbutton2"); listview1.Model = listmodel; Version version = Assembly.GetExecutingAssembly().GetName().Version; if (version.Revision == 0) { button1.Sensitive = false; table2.Hide(); checkbutton1.Hide(); } CellRendererText textRender = new Gtk.CellRendererText(); textRender.Editable = false; TreeViewColumn column0 = new TreeViewColumn("Version", textRender, "text", 0); listview1.AppendColumn(column0); column0.Sizing = TreeViewColumnSizing.Autosize; column0.Resizable = true; TreeViewColumn column1 = new TreeViewColumn("Description", textRender, "text", 1); listview1.AppendColumn(column1); column1.Sizing = TreeViewColumnSizing.Autosize; column1.Resizable = true; // Populate the combo box with a list of valid country names. ListStore countries = new ListStore(typeof(string)); foreach (string country in Constants.Countries) { countries.AppendValues(country); } countryBox.Model = countries; // Add a cell renderer to the combo box. CellRendererText cell = new CellRendererText(); countryBox.PackStart(cell, false); countryBox.AddAttribute(cell, "text", 0); // Make the tab order a little more sensible than the defaults table1.FocusChain = new Widget[] { alignment7, button1, button2 }; table2.FocusChain = new Widget[] { firstNameBox, lastNameBox, emailBox, organisationBox, countryBox }; htmlView = new HTMLView(new ViewBase(null)); htmlAlign.Add(htmlView.MainWidget); tabbedExplorerView = owner as IMainView; window1.TransientFor = owner.MainWidget.Toplevel as Window; window1.Modal = true; oldVersions.Toggled += OnShowOldVersionsToggled; button1.Clicked += OnUpgrade; button2.Clicked += OnViewMoreDetail; window1.Destroyed += OnFormClosing; window1.MapEvent += OnShown; }
/// <summary> /// Constructor /// </summary> public UpgradeView(ViewBase owner) : base(owner) { Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.UpgradeView.glade"); window1 = (Window)builder.GetObject("window1"); button1 = (Button)builder.GetObject("button1"); button2 = (Button)builder.GetObject("button2"); table1 = (Table)builder.GetObject("table1"); table2 = (Table)builder.GetObject("table2"); firstNameBox = (Entry)builder.GetObject("firstNameBox"); lastNameBox = (Entry)builder.GetObject("lastNameBox"); organisationBox = (Entry)builder.GetObject("organisationBox"); emailBox = (Entry)builder.GetObject("emailBox"); address1Box = (Entry)builder.GetObject("address1Box"); address2Box = (Entry)builder.GetObject("address2Box"); cityBox = (Entry)builder.GetObject("cityBox"); stateBox = (Entry)builder.GetObject("stateBox"); countryBox = (Entry)builder.GetObject("countryBox"); postcodeBox = (Entry)builder.GetObject("postcodeBox"); label1 = (Label)builder.GetObject("label1"); htmlAlign = (Alignment)builder.GetObject("HTMLalign"); checkbutton1 = (CheckButton)builder.GetObject("checkbutton1"); listview1 = (Gtk.TreeView)builder.GetObject("listview1"); alignment3 = (Alignment)builder.GetObject("alignment3"); alignment4 = (Alignment)builder.GetObject("alignment4"); alignment5 = (Alignment)builder.GetObject("alignment5"); alignment6 = (Alignment)builder.GetObject("alignment6"); alignment7 = (Alignment)builder.GetObject("alignment7"); oldVersions = (CheckButton)builder.GetObject("checkbutton2"); listview1.Model = listmodel; CellRendererText textRender = new Gtk.CellRendererText(); textRender.Editable = false; TreeViewColumn column0 = new TreeViewColumn("Version", textRender, "text", 0); listview1.AppendColumn(column0); column0.Sizing = TreeViewColumnSizing.Autosize; column0.Resizable = true; TreeViewColumn column1 = new TreeViewColumn("Description", textRender, "text", 1); listview1.AppendColumn(column1); column1.Sizing = TreeViewColumnSizing.Autosize; column1.Resizable = true; // Make the tab order a little more sensible than the defaults table1.FocusChain = new Widget[] { alignment7, button1, button2 }; table2.FocusChain = new Widget[] { firstNameBox, lastNameBox, organisationBox, emailBox, alignment3, alignment4, cityBox, alignment5, countryBox, alignment6 }; htmlView = new HTMLView(new ViewBase(null)); htmlAlign.Add(htmlView.MainWidget); tabbedExplorerView = owner as IMainView; window1.TransientFor = owner.MainWidget.Toplevel as Window; oldVersions.Toggled += OnShowOldVersionsToggled; button1.Clicked += OnUpgrade; button2.Clicked += OnViewMoreDetail; window1.Destroyed += OnFormClosing; window1.MapEvent += OnShown; }