/// <summary> /// Changes selected controls state /// </summary> /// <param name="state">true if modeling starts, false if it's over</param> private void ChangeWindowStateForMovementModeling(bool state) { CursorButton.Enabled = VertexButton.Enabled = EdgeButton.Enabled = DeleteButton.Enabled = ClearButton.Enabled = !state; if (!state) { CursorButton.Enabled = false; } if (SandpileTypeCheckBox.Checked) { SandpilePalette.BringToFront(); SandpilePalette.Visible = state; } foreach (var page in AppParameters.Controls) { foreach (var control in ((TabPage)page).Controls) { if (control is DataGridView dgv) { dgv.ReadOnly = state; } else { ((Control)control).Enabled = !state; } } } if (!state) { GridAdjacencyMatrix.ReadOnly = true; AnimationCheckBox.Enabled = false; } MovementToolStripMenuItem.Enabled = state; StopToolStripMenuItem.Visible = state; ResetToolStripMenuItem.Visible = state; }
/// <summary> /// Clears selection from sandpile palette /// </summary> private void SandpilePalette_SelectionChanged(object sender, EventArgs e) => SandpilePalette.ClearSelection();