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