private void frmRetention_Load(object sender, EventArgs e) { // Add this to each object assigned to a Catchment, Implement MenuItemClickhandler InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); List <string> l = currentCatchment().getAvailableBMPs(); l.Add("None"); cbBMP1.Items.AddRange(l.ToArray()); // First BMP cannot be Stormwater Harvesting //cbBMP1.Items.Remove(BMPTrainsProject.sStormwaterHarvesting); cbBMP2.Items.AddRange(l.ToArray()); cbBMP3.Items.AddRange(l.ToArray()); cbBMP4.Items.AddRange(l.ToArray()); this.Text += " " + currentCatchmentID.ToString(); currentCatchment().Calculate(); setValues(); Calculate(); setOutputText(); }
private void frmWatershedCharacteristics_Load(object sender, EventArgs e) { if (currentCatchmentNum == 0) { currentCatchmentNum = 1; } cbPostLanduse.Items.Clear(); cbPostLanduse.DataSource = LanduseTable.Values(); cbPostLanduse.DisplayMember = "D"; cbPostLanduse.ValueMember = "D"; cbPreLanduse.DataSource = LanduseTable.Values(); cbPreLanduse.DisplayMember = "D"; cbPostLanduse.ValueMember = "D"; this.Text += " Version: " + Application.ProductVersion; InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler); menuStrip1.Items[1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); menuStrip1.CanOverflow = true; setValues(); }
private void frmRetention_Load(object sender, EventArgs e) { // Add this to each object assigned to a Catchment, Implement MenuItemClickhandler InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler, true); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); setValues(); this.Text += currentCatchment().TitleHeader(); }
private void frmStormwaterHarvesting_Load(object sender, EventArgs e) { InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler, true); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); setValues(); currentBMP().BMPType = BMPTrainsProject.sStormwaterHarvesting; this.Text += currentCatchment().TitleHeader(); // Now only doing currentBMP().SolveForChoice = RainwaterHarvesting.sHarvestEfficiency; }
private void MenuItemClickHandler(object sender, EventArgs e) { // This must be added to handle events from every form that edits objects associated with // Catchments. ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; InterfaceCommon.resetMenuColors(menuStrip1); clickedItem.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); currentCatchmentID = Convert.ToInt32(clickedItem.Name); SetButtonColors(); }
private void MenuItemClickHandler(object sender, EventArgs e) { ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; // Get current values getValues(); InterfaceCommon.resetMenuColors(menuStrip1); clickedItem.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); currentCatchmentNum = Convert.ToInt32(clickedItem.Name); setValues(); }
private void frmRetention_Load(object sender, EventArgs e) { // Add this to each object assigned to a Catchment, Implement MenuItemClickhandler InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler, true); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); pictureBox1.Image = BMPTrains_2020.Properties.Resources.VegBuffer; pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; currentBMP().BMPType = BMPTrainsProject.sVegetatedNaturalBuffer; setValues(); this.Text += currentCatchment().TitleHeader(); }
private void frmRetention_Load(object sender, EventArgs e) { cbRetentionOrDetention.Items.Add(Storage.sRetention); cbRetentionOrDetention.Items.Add(Storage.sDetention); // Add this to each object assigned to a Catchment, Implement MenuItemClickhandler InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler, true); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); setValues(); currentBMP().BMPType = BMPTrainsProject.sTreeWell; this.Text += currentCatchment().TitleHeader(); }
private void frmGreenroof_Load(object sender, EventArgs e) { cbRainfallStation.DataSource = new BindingSource(Greenroof.RainfallStations, null); cbRainfallStation.DisplayMember = "Key"; cbRainfallStation.ValueMember = "Key"; // Add this to each object assigned to a Catchment, Implement MenuItemClickhandler InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler, true); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); setValues(); this.Text += currentCatchment().TitleHeader(); }
private void frmExfiltration_Load(object sender, EventArgs e) { // Add this to each object assigned to a Catchment, Implement MenuItemClickhandler InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler, true); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); setValues(); this.Text += currentCatchment().TitleHeader(); if (Globals.Project.DoGroundwaterAnalysis == "No") { btnMediaMix.Visible = false; } }
private void frmRainwaterHarvesting_Load(object sender, EventArgs e) { cbRoofType.DataSource = new BindingSource(RainwaterHarvesting.RoofTypes(), null); cbRoofType.DisplayMember = "Key"; cbRoofType.ValueMember = "Key"; InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler, true); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); setValues(); this.Text += currentCatchment().TitleHeader(); // We are only doing Harvest Efficiency currentBMP().SolveForChoice = RainwaterHarvesting.sHarvestEfficiency; }
private void MenuItemClickHandler(object sender, EventArgs e) { // This must be added to handle events from every form that edits objects associated with // Catchments. ToolStripMenuItem clickedItem = (ToolStripMenuItem)sender; // Get current values if (clickedItem.Name == "reset") { currentCatchment().Reset(currentBMP()); setValues(); return; } getValues(); InterfaceCommon.resetMenuColors(menuStrip1); clickedItem.BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); currentCatchmentID = Convert.ToInt32(clickedItem.Name); setValues(); }
private void frmTreatmentOptions_Load(object sender, EventArgs e) { pbOptions.Image = Globals.Project.getConfigurationImage(); pbOptions.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; InterfaceCommon.BuildCatchmentMenu(menuStrip1, MenuItemClickHandler); menuStrip1.Items[currentCatchmentID - 1].BackColor = System.Drawing.Color.FromKnownColor(System.Drawing.KnownColor.MenuHighlight); if (!Globals.Project.CatchmentExists(1)) { DialogResult d = MessageBox.Show("You need a defined Catchment to do Analysis - would you like to create one and data for one now?", "Create Catchment", MessageBoxButtons.YesNo, MessageBoxIcon.Warning); if (d == DialogResult.Yes) { Form form = new frmWatershedCharacteristics(1); form.ShowDialog(); } } SetButtonColors(); this.Text += currentCatchment().TitleHeader(); }