Пример #1
0
 protected virtual void OnToolSelected(DisplacementSubTool tool)
 {
     if (ToolSelected != null)
     {
         ToolSelected(this, tool);
     }
 }
Пример #2
0
 public void SelectTool(DisplacementSubTool tool)
 {
     ControlPanel.Controls.Clear();
     if (tool.Control != null)
     {
         ControlPanel.Controls.Add(tool.Control);
         tool.Control.Dock = DockStyle.Fill;
     }
     OnToolSelected(tool);
 }
Пример #3
0
 private void DisplacementToolSelected(object sender, DisplacementSubTool tool)
 {
     if (_currentTool != null)
     {
         _currentTool.ToolDeselected(false);
     }
     _currentTool = tool;
     if (_currentTool != null)
     {
         _currentTool.ToolSelected(false);
     }
 }
Пример #4
0
        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);
        }
Пример #5
0
 private void AddTool(DisplacementSubTool tool)
 {
     _form.AddTool(tool);
     _tools.Add(tool);
 }