diff widgets/Panner.h @ 173:9c40dc10c88c

* Rename the existing Panner to Overview (big duh!) * Fixes to the new Panner.
author Chris Cannam
date Thu, 19 Oct 2006 09:57:27 +0000
parents d0b95a8cac96
children 96b8a790730a
line wrap: on
line diff
--- a/widgets/Panner.h	Wed Oct 18 16:38:30 2006 +0000
+++ b/widgets/Panner.h	Thu Oct 19 09:57:27 2006 +0000
@@ -26,6 +26,8 @@
     Panner(QWidget *parent = 0);
     virtual ~Panner();
 
+    void setDefaultRectCentre(float, float);
+
     virtual void mousePressEvent(QMouseEvent *e);
     virtual void mouseDoubleClickEvent(QMouseEvent *e);
     virtual void mouseMoveEvent(QMouseEvent *e);
@@ -89,11 +91,24 @@
 protected:
     void normalise();
     void emitAndUpdate();
+    void resetToDefault();
 
     float m_rectX;
     float m_rectY;
     float m_rectWidth;
     float m_rectHeight;
+
+    float m_defaultCentreX;
+    float m_defaultCentreY;
+    bool m_defaultsSet;
+
+    float centreX() const { return m_rectX + m_rectWidth/2; }
+    float centreY() const { return m_rectY + m_rectHeight/2; }
+
+    bool m_clicked;
+    QPoint m_clickPos;
+    float m_dragStartX;
+    float m_dragStartY;
 };
 
 #endif