Changeset 8085 for branches/GP-MoveOperators/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.cs
- Timestamp:
- 06/21/12 18:02:33 (12 years ago)
- Location:
- branches/GP-MoveOperators
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GP-MoveOperators
- Property svn:ignore
-
old new 20 20 bin 21 21 protoc.exe 22 _ReSharper.HeuristicLab 3.3 Tests
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/GP-MoveOperators/HeuristicLab.Operators.Views.GraphVisualization.Views/3.3/OperatorGraphView.cs
r7259 r8085 27 27 using HeuristicLab.MainForm; 28 28 using HeuristicLab.MainForm.WindowsForms; 29 using HeuristicLab.Netron.CustomTools; 29 30 using Netron.Diagramming.Core; 30 31 … … 33 34 [Content(typeof(OperatorGraph), true)] 34 35 public partial class OperatorGraphView : AsynchronousContentView { 36 private ITool lastActiveTool; 37 35 38 public OperatorGraphView() { 36 39 InitializeComponent(); … … 39 42 this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_SelectionChanged); 40 43 this.graphVisualizationInfoView.Controller.OnMouseDown += new EventHandler<MouseEventArgs>(Controller_OnMouseDown); 44 this.graphVisualizationInfoView.Controller.ParentControl.MouseDown += new MouseEventHandler(ParentControl_MouseDown); 45 this.graphVisualizationInfoView.Controller.ParentControl.MouseUp += new MouseEventHandler(ParentControl_MouseUp); 41 46 foreach (ITool tool in this.graphVisualizationInfoView.Controller.Tools) { 42 47 tool.OnToolActivate += new EventHandler<ToolEventArgs>(tool_OnToolActivate); … … 69 74 if (Content == null) { 70 75 selectButton.Enabled = false; 71 panButton.Enabled = false;72 76 relayoutButton.Enabled = false; 73 77 zoomToFitButton.Enabled = false; … … 79 83 } else { 80 84 selectButton.Enabled = true; 81 panButton.Enabled = true;82 85 relayoutButton.Enabled = true; 83 86 zoomToFitButton.Enabled = true; … … 150 153 } 151 154 155 void ParentControl_MouseDown(object sender, MouseEventArgs e) { 156 lastActiveTool = this.graphVisualizationInfoView.Controller.ActiveTool; 157 if (e.Button == MouseButtons.Middle) { 158 if (!(lastActiveTool is CustomPanTool)) this.graphVisualizationInfoView.Controller.ActivateTool(CustomPanTool.ToolName); 159 } 160 } 161 162 void ParentControl_MouseUp(object sender, MouseEventArgs e) { 163 if (e.Button == MouseButtons.Middle) { 164 if (lastActiveTool != null) this.graphVisualizationInfoView.Controller.ActivateTool(lastActiveTool.Name); 165 else this.graphVisualizationInfoView.Controller.DeactivateAllTools(); 166 } 167 } 168 152 169 #region context menu 153 170 private void Controller_OnShowContextMenu(object sender, EntityMenuEventArgs e) { … … 252 269 button = this.selectButton; 253 270 break; 254 case ControllerBase.PanToolName:255 button = this.panButton;256 break;257 271 case ControllerBase.ConnectionToolName: 258 272 button = this.connectButton; … … 268 282 ITool tool = this.graphVisualizationInfoView.Controller.Tools.Where(t => t.Name == ControllerBase.SelectionToolName).First(); 269 283 this.graphVisualizationInfoView.Controller.DeactivateAllTools(); 270 }271 272 private void panButton_Click(object sender, EventArgs e) {273 this.graphVisualizationInfoView.Controller.ActivateTool(ControllerBase.PanToolName);274 284 } 275 285
Note: See TracChangeset
for help on using the changeset viewer.