Line | |
---|
1 | using System.Drawing;
|
---|
2 | using System.Windows.Forms;
|
---|
3 |
|
---|
4 | namespace 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.