Free cookie consent management tool by TermsFeed Policy Generator

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

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

Added some comments (#664)

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