Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Visualization/3.2/PanListener.cs @ 2017

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

Refactoring PanListener(#664)

File size: 614 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
10    public PanListener(Point startPoint) {
11      this.startPoint = startPoint;
12    }
13
14    #region IMouseEventListener Members
15
16    public void MouseMove(object sender, MouseEventArgs e) {
17      if (Pan != null) {
18        Pan(startPoint, e.Location);
19      }
20
21      startPoint = e.Location; 
22    }
23
24    public void MouseUp(object sender, MouseEventArgs e) {}
25
26    #endregion
27  }
28}
Note: See TracBrowser for help on using the repository browser.