diff widgets/Panner.h @ 256:c492902dba40

* Make shift+mousewheel scroll vertically (where applicable) and alt+mousewheel zoom vertically (where applicable). Closes #1734844
author Chris Cannam
date Wed, 13 Jun 2007 10:27:39 +0000
parents 5b7472db612b
children 13f5f84fbfad
line wrap: on
line diff
--- a/widgets/Panner.h	Wed Jun 13 09:19:33 2007 +0000
+++ b/widgets/Panner.h	Wed Jun 13 10:27:39 2007 +0000
@@ -31,6 +31,14 @@
     void setThumbColour(QColor colour);
     void setAlpha(int backgroundAlpha, int thumbAlpha);
 
+    /**
+     * Set the amount the scroll() function or mouse wheel movement
+     * makes the panner rectangle move by.  The default value of 0
+     * means to select a value automatically based on the dimensions
+     * of the panner rectangle.
+     */
+    void setScrollUnit(float unit);
+
     void getRectExtents(float &x0, float &y0, float &width, float &height);
 
     virtual QSize sizeHint() const;
@@ -95,6 +103,12 @@
      */
     void setRectCentreY(float y);
 
+    /**
+     * Move up (if up is true) or down a bit.  This is basically the
+     * same action as rolling the mouse wheel one notch.
+     */
+    void scroll(bool up);
+
     void resetToDefault();
 
 protected:
@@ -114,6 +128,7 @@
     float m_rectY;
     float m_rectWidth;
     float m_rectHeight;
+    float m_scrollUnit;
 
     float m_defaultCentreX;
     float m_defaultCentreY;