Changeset 2901
- Timestamp:
- 03/01/10 17:34:36 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Tools/ConnectionTool.cs
r2868 r2901 84 84 public void MouseUp(MouseEventArgs e) { 85 85 if (IsActive) { 86 DeactivateTool();87 88 86 // First, make sure the initial point is far enough away from 89 87 // the final point to make a connection. … … 137 135 //drop the painted ghost 138 136 Controller.View.ResetGhost(); 139 //release other tools 140 this.UnsuspendTools(); 137 this.doDraw = false; 141 138 } 142 139 } -
trunk/sources/HeuristicLab.ExtLibs/HeuristicLab.Netron/3.0.2672.12446/Netron.Diagramming.Core-3.0.2672.12446/Tools/ZoomAreaTool.cs
r2768 r2901 124 124 if (IsActive) 125 125 { 126 DeactivateTool();127 126 IView view = Controller.View; 128 127 if (view.Ghost != null) -
trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs
r2899 r2901 46 46 this.graphVisualizationInfoView.Controller.OnShowContextMenu += new EventHandler<EntityMenuEventArgs>(Controller_OnShowContextMenu); 47 47 this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_SelectionChanged); 48 foreach (ITool tool in this.graphVisualizationInfoView.Controller.Tools) { 49 tool.OnToolActivate += new EventHandler<ToolEventArgs>(tool_OnToolActivate); 50 tool.OnToolDeactivate += new EventHandler<ToolEventArgs>(tool_OnToolDeactivate); 51 } 48 52 } 49 53 … … 183 187 #endregion 184 188 189 private void tool_OnToolActivate(object sender, ToolEventArgs e) { 190 Button button = GetButtonForTool(e.Properties.Name); 191 if (button != null) 192 button.Enabled = false; 193 } 194 195 private void tool_OnToolDeactivate(object sender, ToolEventArgs e) { 196 Button button = GetButtonForTool(e.Properties.Name); 197 if (button != null) 198 button.Enabled = true; 199 } 200 201 private Button GetButtonForTool(string toolName) { 202 Button button = null; 203 switch (toolName) { 204 case ControllerBase.SelectionToolName: 205 button = this.selectButton; 206 break; 207 case ControllerBase.PanToolName: 208 button = this.panButton; 209 break; 210 case ControllerBase.ConnectionToolName: 211 button = this.connectButton; 212 break; 213 case ControllerBase.ZoomAreaToolName: 214 button = this.zoomAreaButton; 215 break; 216 } 217 return button; 218 } 219 185 220 private void selectButton_Click(object sender, EventArgs e) { 186 221 ITool tool = this.graphVisualizationInfoView.Controller.Tools.Where(t => t.Name == ControllerBase.SelectionToolName).First(); 187 222 tool.IsSuspended = false; 188 tool = this.graphVisualizationInfoView.Controller.Tools.Where(t => t.Name == ControllerBase.PanToolName).First(); 189 this.graphVisualizationInfoView.Controller.DeactivateTool(tool); 223 this.graphVisualizationInfoView.Controller.DeactivateAllTools(); 190 224 } 191 225 192 226 private void panButton_Click(object sender, EventArgs e) { 193 ITool tool = this.graphVisualizationInfoView.Controller.Tools.Where(t => t.Name == ControllerBase.SelectionToolName).First();194 tool.IsSuspended = true;195 227 this.graphVisualizationInfoView.Controller.ActivateTool(ControllerBase.PanToolName); 196 228 }
Note: See TracChangeset
for help on using the changeset viewer.