diff widgets/Panner.h @ 1303:13f5f84fbfad

Collect the bits of bookkeeping for mouse wheel events, and use in all widgets
author Chris Cannam
date Fri, 22 Jun 2018 17:19:48 +0100
parents c492902dba40
children a18e78b9c78b
line wrap: on
line diff
--- a/widgets/Panner.h	Fri Jun 22 13:41:54 2018 +0100
+++ b/widgets/Panner.h	Fri Jun 22 17:19:48 2018 +0100
@@ -13,11 +13,13 @@
     COPYING included with this distribution for more information.
 */
 
-#ifndef _PANNER_H_
-#define _PANNER_H_
+#ifndef SV_PANNER_H
+#define SV_PANNER_H
 
 #include <QWidget>
 
+#include "WheelCounter.h"
+
 class Panner : public QWidget
 {
     Q_OBJECT
@@ -109,6 +111,12 @@
      */
     void scroll(bool up);
 
+    /**
+     * Move up (if up is true) or down a bit.  This is basically the
+     * same action as rolling the mouse wheel n notches.
+     */
+    void scroll(bool up, int n);
+
     void resetToDefault();
 
 protected:
@@ -145,6 +153,8 @@
     QPoint m_clickPos;
     float m_dragStartX;
     float m_dragStartY;
+
+    WheelCounter m_wheelCounter;
 };
 
 #endif