protected virtual void OnToolSelected(DisplacementSubTool tool) { if (ToolSelected != null) { ToolSelected(this, tool); } }
public void SelectTool(DisplacementSubTool tool) { ControlPanel.Controls.Clear(); if (tool.Control != null) { ControlPanel.Controls.Add(tool.Control); tool.Control.Dock = DockStyle.Fill; } OnToolSelected(tool); }
private void DisplacementToolSelected(object sender, DisplacementSubTool tool) { if (_currentTool != null) { _currentTool.ToolDeselected(false); } _currentTool = tool; if (_currentTool != null) { _currentTool.ToolSelected(false); } }
public void AddTool(DisplacementSubTool tool) { var rdo = new RadioButton { Text = tool.GetName(), AutoSize = false, Size = new Size(110, 17) }; rdo.Click += (sender, e) => SelectTool(tool); radioLayoutPanel.Controls.Add(rdo); if (!_tools.Any()) { rdo.Checked = true; } _tools.Add(tool); }
private void AddTool(DisplacementSubTool tool) { _form.AddTool(tool); _tools.Add(tool); }