Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/PanListener.cs @ 1517

Last change on this file since 1517 was 1249, checked in by bspisic, 15 years ago

reimplemented panning and zooming (#424)

File size: 736 bytes
Line 
1using System.Drawing;
2using System.Windows.Forms;
3
4namespace HeuristicLab.Visualization {
5  public class PanListener : IMouseEventListener {
6    private Point startPoint;
7
8    public event MoveHandler Pan;
9    public event MoveHandler PanEnd;
10
11    public PanListener(Point startPoint) {
12      this.startPoint = startPoint;
13    }
14
15    #region IMouseEventListener Members
16
17    public void MouseMove(object sender, MouseEventArgs e) {
18      if (Pan != null) {
19        Pan(startPoint, e.Location);
20      }
21
22      startPoint = e.Location; 
23    }
24
25    public void MouseUp(object sender, MouseEventArgs e) {
26      if(PanEnd != null) {
27        PanEnd(startPoint, e.Location);
28      }
29    }
30
31    #endregion
32  }
33}
Note: See TracBrowser for help on using the repository browser.