Last change
on this file since 1803 was
1530,
checked in by gkronber, 15 years ago
|
Moved source files of plugins Hive ... Visualization.Test into version-specific sub-folders. #576
|
File size:
736 bytes
|
Rev | Line | |
---|
[1055] | 1 | using System.Drawing;
|
---|
| 2 | using System.Windows.Forms;
|
---|
| 3 |
|
---|
| 4 | namespace HeuristicLab.Visualization {
|
---|
| 5 | public class PanListener : IMouseEventListener {
|
---|
[1249] | 6 | private Point startPoint;
|
---|
[1055] | 7 |
|
---|
[1249] | 8 | public event MoveHandler Pan;
|
---|
| 9 | public event MoveHandler PanEnd;
|
---|
| 10 |
|
---|
| 11 | public PanListener(Point startPoint) {
|
---|
[1055] | 12 | this.startPoint = startPoint;
|
---|
| 13 | }
|
---|
| 14 |
|
---|
| 15 | #region IMouseEventListener Members
|
---|
| 16 |
|
---|
| 17 | public void MouseMove(object sender, MouseEventArgs e) {
|
---|
[1249] | 18 | if (Pan != null) {
|
---|
| 19 | Pan(startPoint, e.Location);
|
---|
[1055] | 20 | }
|
---|
| 21 |
|
---|
[1249] | 22 | startPoint = e.Location;
|
---|
[1055] | 23 | }
|
---|
| 24 |
|
---|
| 25 | public void MouseUp(object sender, MouseEventArgs e) {
|
---|
[1249] | 26 | if(PanEnd != null) {
|
---|
| 27 | PanEnd(startPoint, e.Location);
|
---|
[1055] | 28 | }
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | #endregion
|
---|
| 32 | }
|
---|
| 33 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.