private void RemoveCurrentPaneButton_Click(object sender, EventArgs e) { Ui.StatusBarPane pane = CurrentPaneComboBox.SelectedItem as Ui.StatusBarPane; if (pane == null) { return; } if (CurrentPaneComboBox.SelectedIndex < CurrentPaneComboBox.Items.Count - 1) { CurrentPaneComboBox.SelectedIndex += 1; } else if (CurrentPaneComboBox.SelectedIndex > 0) { CurrentPaneComboBox.SelectedIndex -= 1; } else { CurrentPaneComboBox.SelectedItem = null; } CurrentPaneComboBox.Items.Remove(pane); foreach (System.Windows.Forms.Control control in pane.Controls) { ProgressBar progressBar = control as ProgressBar; if (progressBar != null) { _progressBarsList.Remove(progressBar); } } pane.Parent = null; pane.Dispose(); }
private void DisableCurrentPaneButton_Click(object sender, EventArgs e) { Ui.StatusBarPane pane = CurrentPaneComboBox.SelectedItem as Ui.StatusBarPane; if (pane == null) { return; } pane.Enabled = !DisableCurrentPaneToggleButton.Pressed; }
private void UpdateControlsForCurrentPane() { Ui.StatusBarPane pane = CurrentPaneComboBox.SelectedItem as Ui.StatusBarPane; CurrentPaneComboBox.Enabled = HighlightCurrentPaneButton.Enabled = RemoveCurrentPaneButton.Enabled = DisableCurrentPaneToggleButton.Enabled = AddButtonCommand.Enabled = AddButtonWithTextCommand.Enabled = AddToggleButtonCommand.Enabled = AddToggleButtonWithTextCommand.Enabled = AddButtonGroupButton.Enabled = AddProgressBarButton.Enabled = AddSliderCommand.Enabled = AddSliderButton.Enabled = AddLabelButton.Enabled = pane != null; DisableCurrentPaneToggleButton.Pressed = pane != null && !pane.Enabled; }
private void HighlightCurrentPane() { _highlightTimer.Stop(); if (_highlightPane != null) { _highlightPane.Paint -= HighlightPane_Paint; } Ui.StatusBarPane pane = CurrentPaneComboBox.SelectedItem as Ui.StatusBarPane; if (pane == null) { return; } _highlightPane = pane; _highlightFramesShown = 0; _highlightPane.Paint += HighlightPane_Paint; _showHighlightBorder = false; _highlightTimer.Start(); }
private System.Windows.Forms.Control AddControlToTheCurrentPane(Type controlType, bool setImage, bool setText) { Ui.StatusBarPane pane = CurrentPaneComboBox.SelectedItem as Ui.StatusBarPane; if (pane == null) { return(null); } System.Windows.Forms.Control control = CreateControl(controlType, setImage, setText); if (control == null) { return(null); } if (pane.Controls.Count == 1 && pane.Controls[0].Tag == pane) { pane.Controls.Remove(pane.Controls[0]); } control.Parent = pane; return(control); }
private void HighlightCurrentPane() { _highlightTimer.Stop(); if (_highlightPane != null) _highlightPane.Paint -= HighlightPane_Paint; Ui.StatusBarPane pane = CurrentPaneComboBox.SelectedItem as Ui.StatusBarPane; if (pane == null) return; _highlightPane = pane; _highlightFramesShown = 0; _highlightPane.Paint += HighlightPane_Paint; _showHighlightBorder = false; _highlightTimer.Start(); }