Free cookie consent management tool by TermsFeed Policy Generator

Changeset 3176


Ignore:
Timestamp:
03/22/10 16:28:27 (15 years ago)
Author:
mkommend
Message:

implemented open default view on double click (ticket #867)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Operators.Views.GraphVisualization/3.3/OperatorGraphView.cs

    r3173 r3176  
    4646      this.graphVisualizationInfoView.Controller.OnShowContextMenu += new EventHandler<EntityMenuEventArgs>(Controller_OnShowContextMenu);
    4747      this.graphVisualizationInfoView.Controller.Model.Selection.OnNewSelection += new EventHandler(Controller_SelectionChanged);
     48      this.graphVisualizationInfoView.Controller.OnMouseDown += new EventHandler<MouseEventArgs>(Controller_OnMouseDown);
    4849      foreach (ITool tool in this.graphVisualizationInfoView.Controller.Tools) {
    4950        tool.OnToolActivate += new EventHandler<ToolEventArgs>(tool_OnToolActivate);
     
    114115    }
    115116
     117    private void Controller_OnMouseDown(object sender, MouseEventArgs e) {
     118      if (e.Clicks >= 2) {
     119        IShape shape = this.graphVisualizationInfoView.Controller.Model.GetShapeAt(e.Location);
     120        if (shape != null) {
     121          IOperatorShapeInfo shapeInfo = shape.Tag as IOperatorShapeInfo;
     122          if (shapeInfo != null) {
     123            IOperator op = this.VisualizationInfo.GetOperatorForShapeInfo(shapeInfo);
     124            MainFormManager.CreateDefaultView(op).Show();
     125            HandledMouseEventArgs eventArgs = e as HandledMouseEventArgs;
     126            if (eventArgs != null)
     127              eventArgs.Handled = true;
     128          }
     129        }
     130      }
     131    }
     132
    116133    #region context menu
    117134    private void Controller_OnShowContextMenu(object sender, EntityMenuEventArgs e) {
     
    249266
    250267    private void screenshotButton_Click(object sender, EventArgs e) {
    251       Bitmap bitmap = ImageExporter.FromBundle(new Bundle(this.graphVisualizationInfoView.Controller.Model.Paintables),this.graphVisualizationInfoView.Controller.View.Graphics);
     268      Bitmap bitmap = ImageExporter.FromBundle(new Bundle(this.graphVisualizationInfoView.Controller.Model.Paintables), this.graphVisualizationInfoView.Controller.View.Graphics);
    252269      SaveFileDialog saveFileDialog = new SaveFileDialog();
    253270      saveFileDialog.Title = "Save Screenshot";
Note: See TracChangeset for help on using the changeset viewer.