Exemple #1
0
 /// <summary>Handles the change event for the GraphShowYears NumericUpDown </summary>
 /// <param name="sender">The source of the event</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void OnGraphShowYearsValueChanged(object sender, EventArgs e)
 {
     if (GraphRefreshClicked != null)
     {
         GraphRefreshClicked.Invoke(notebook1.CurrentPage, spinStartYear.ValueAsInt, spinNYears.ValueAsInt);
     }
 }
 /// <summary>Handles the change event for the GraphShowYears NumericUpDown </summary>
 /// <param name="sender">The source of the event</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void uxGraphShowYears_ValueChanged(object sender, EventArgs e)
 {
     if (GraphRefreshClicked != null)
     {
         int selectedTabIndex = tabControl1.SelectedIndex;
         GraphRefreshClicked.Invoke(selectedTabIndex, (int)GraphStartYearControl.Value, (int)GraphShowYearsControl.Value);
     }
 }
Exemple #3
0
        /// <summary>
        /// Handles the selection change between tabs, so that we can adjust the height of the Browse Panel,
        /// showing/or hiding information that is not relevant.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TabControl1_SelectedIndexChanged(object sender, SwitchPageArgs e)
        {
            bool moved = false;

            switch (e.PageNum)
            {
            case 2:
                if (hboxOptions.Parent != alignRainChart)
                {
                    hboxOptions.Reparent(alignRainChart);
                    moved = true;
                }
                break;

            case 3:
                if (hboxOptions.Parent != alignRainMonthly)
                {
                    hboxOptions.Reparent(alignRainMonthly);
                    moved = true;
                }
                break;

            case 4:
                if (hboxOptions.Parent != alignTemp)
                {
                    hboxOptions.Reparent(alignTemp);
                    moved = true;
                }
                break;

            case 5:
                if (hboxOptions.Parent != alignRadn)
                {
                    hboxOptions.Reparent(alignRadn);
                    moved = true;
                }
                break;

            default: break;
            }

            if (moved)
            {
                // On Windows, at least, these controls don't move correctly with the reparented HBox.
                // They think they're parented correctly, but are drawn at 0,0 of the main window.
                // We can hack around this by reparenting them somewhere else, then moving them back.
                Widget pa = spinStartYear.Parent;
                spinStartYear.Reparent(MainWidget);
                spinStartYear.Reparent(pa);
                pa = spinNYears.Parent;
                spinNYears.Reparent(MainWidget);
                spinNYears.Reparent(pa);
            }
            if (GraphRefreshClicked != null)
            {
                GraphRefreshClicked.Invoke(notebook1.CurrentPage, spinStartYear.ValueAsInt, spinNYears.ValueAsInt);
            }
        }
Exemple #4
0
 /// <summary>Handles the change event for the GraphStartYear NumericUpDown </summary>
 /// <param name="sender">The source of the event</param>
 /// <param name="e">The <see cref="EventArgs"/> instance containing the event data.</param>
 private void OnGraphStartYearValueChanged(object sender, EventArgs e)
 {
     try
     {
         if (GraphRefreshClicked != null)
         {
             GraphRefreshClicked.Invoke(notebook1.CurrentPage, spinStartYear.ValueAsInt, spinNYears.ValueAsInt);
         }
     }
     catch (Exception err)
     {
         ShowError(err);
     }
 }
        /// <summary>
        /// Handles the selection change between tabs, so that we can adjust the height of the Browse Panel,
        /// showing/or hiding information that is not relevant.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TabControl1_SelectedIndexChanged(object sender, EventArgs e)
        {
            TabControl tc = (TabControl)sender;

            if (tc.SelectedIndex == 0 || tc.SelectedIndex == 1)
            {
                //BrowsePanelControl.Height = 68;
                GraphOptionPanelControl.Visible = false;
                GraphRefreshClicked.Invoke(tc.SelectedIndex, GraphStartYearControl.Value, GraphShowYearsControl.Value);
            }
            else
            {
                //BrowsePanelControl.Height = 68;
                GraphOptionPanelControl.Visible = true;
                GraphRefreshClicked.Invoke(tc.SelectedIndex, GraphStartYearControl.Value, GraphShowYearsControl.Value);
            }
        }
        /// <summary>
        /// Handles the selection change between tabs, so that we can adjust the height of the Browse Panel,
        /// showing/or hiding information that is not relevant.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void TabControl1_SelectedIndexChanged(object sender, SwitchPageArgs e)
        {
            try
            {
                bool moved = false;
                switch (e.PageNum)
                {
                case 2:
                    if (hboxOptions.Parent != alignRainChart)
                    {
                        if (hboxOptions.Parent is Container container)
                        {
                            container.Remove(hboxOptions);
                        }

                        alignRainChart.Add(hboxOptions);
                        moved = true;
                    }
                    break;

                case 3:
                    if (hboxOptions.Parent != alignRainMonthly)
                    {
                        if (hboxOptions.Parent is Container container)
                        {
                            container.Remove(hboxOptions);
                        }

                        alignRainMonthly.Add(hboxOptions);
                        moved = true;
                    }
                    break;

                case 4:
                    if (hboxOptions.Parent != alignTemp)
                    {
                        if (hboxOptions.Parent is Container container)
                        {
                            container.Remove(hboxOptions);
                        }

                        alignTemp.Add(hboxOptions);
                        moved = true;
                    }
                    break;

                case 5:
                    if (hboxOptions.Parent != alignRadn)
                    {
                        if (hboxOptions.Parent is Container container)
                        {
                            container.Remove(hboxOptions);
                        }

                        alignRadn.Add(hboxOptions);
                        moved = true;
                    }
                    break;

                default: break;
                }

                if (moved)
                {
                    // On Windows, at least, these controls don't move correctly with the reparented HBox.
                    // They think they're parented correctly, but are drawn at 0,0 of the main window.
                    // We can hack around this by reparenting them somewhere else, then moving them back.
                    Container pa = spinStartYear.Parent as Container;

                    if (spinStartYear.Parent is Container container)
                    {
                        container.Remove(spinStartYear);
                    }

                    vbox1.Add(spinStartYear);
                    vbox1.Remove(spinStartYear);
                    pa.Add(spinStartYear);

                    pa = spinNYears.Parent as Container;
                    vbox1.Add(spinNYears);
                    vbox1.Remove(spinNYears);
                    pa.Add(spinNYears);
                }
                if (GraphRefreshClicked != null)
                {
                    GraphRefreshClicked.Invoke(notebook1.CurrentPage, spinStartYear.ValueAsInt, spinNYears.ValueAsInt);
                }
            }
            catch (Exception err)
            {
                ShowError(err);
            }
        }