Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/26/16 14:59:37 (8 years ago)
Author:
jkarder
Message:

#1265: worked on visualization

  • fixed bug in primitive selection
  • added SelectedPrimitivesChanged event
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Visualization/HeuristicLab.Visualization/3.3/ChartModes/SelectChartMode.cs

    r13762 r13798  
    2020#endregion
    2121
     22using System;
    2223using System.Drawing;
    2324using System.Linq;
     
    5253            try {
    5354              chartControl.SuspendRendering();
    54               var worldLocation = chartControl.Chart.TransformPixelToWorld(e.Location);
    55               foreach (var p in chartControl.Chart.Group.SelectedPrimitives.Where(x => !x.ContainsPoint(worldLocation)))
     55              var sp = chartControl.Chart.GetPrimitive(e.Location);
     56              foreach (var p in chartControl.Chart.Group.SelectedPrimitives.Where(x => x != sp))
    5657                p.Selected = false;
    57               var sp = chartControl.Chart.GetPrimitive(e.Location);
    5858              if (sp != null) sp.Selected = true;
     59              OnSelectedPrimitivesChanged();
    5960            } finally { chartControl.ResumeRendering(); }
    6061            break;
     
    9293        foreach (var p in chartControl.Chart.Group.SelectedPrimitives)
    9394          chartControl.Chart.Group.Remove(p);
     95        OnSelectedPrimitivesChanged();
    9496      } finally { chartControl.ResumeRendering(); }
     97    }
     98
     99    public event EventHandler SelectedPrimitivesChanged;
     100    protected virtual void OnSelectedPrimitivesChanged() {
     101      var handler = SelectedPrimitivesChanged;
     102      if (handler != null) handler(this, EventArgs.Empty);
    95103    }
    96104  }
Note: See TracChangeset for help on using the changeset viewer.