Mercurial > hg > svgui
comparison widgets/Panner.h @ 1324:13d9b422f7fe zoom
Merge from default branch
author | Chris Cannam |
---|---|
date | Mon, 17 Sep 2018 13:51:31 +0100 |
parents | 13f5f84fbfad |
children | a18e78b9c78b |
comparison
equal
deleted
inserted
replaced
1183:57d192e26331 | 1324:13d9b422f7fe |
---|---|
11 published by the Free Software Foundation; either version 2 of the | 11 published by the Free Software Foundation; either version 2 of the |
12 License, or (at your option) any later version. See the file | 12 License, or (at your option) any later version. See the file |
13 COPYING included with this distribution for more information. | 13 COPYING included with this distribution for more information. |
14 */ | 14 */ |
15 | 15 |
16 #ifndef _PANNER_H_ | 16 #ifndef SV_PANNER_H |
17 #define _PANNER_H_ | 17 #define SV_PANNER_H |
18 | 18 |
19 #include <QWidget> | 19 #include <QWidget> |
20 | |
21 #include "WheelCounter.h" | |
20 | 22 |
21 class Panner : public QWidget | 23 class Panner : public QWidget |
22 { | 24 { |
23 Q_OBJECT | 25 Q_OBJECT |
24 | 26 |
107 * Move up (if up is true) or down a bit. This is basically the | 109 * Move up (if up is true) or down a bit. This is basically the |
108 * same action as rolling the mouse wheel one notch. | 110 * same action as rolling the mouse wheel one notch. |
109 */ | 111 */ |
110 void scroll(bool up); | 112 void scroll(bool up); |
111 | 113 |
114 /** | |
115 * Move up (if up is true) or down a bit. This is basically the | |
116 * same action as rolling the mouse wheel n notches. | |
117 */ | |
118 void scroll(bool up, int n); | |
119 | |
112 void resetToDefault(); | 120 void resetToDefault(); |
113 | 121 |
114 protected: | 122 protected: |
115 virtual void mousePressEvent(QMouseEvent *e); | 123 virtual void mousePressEvent(QMouseEvent *e); |
116 virtual void mouseDoubleClickEvent(QMouseEvent *e); | 124 virtual void mouseDoubleClickEvent(QMouseEvent *e); |
143 | 151 |
144 bool m_clicked; | 152 bool m_clicked; |
145 QPoint m_clickPos; | 153 QPoint m_clickPos; |
146 float m_dragStartX; | 154 float m_dragStartX; |
147 float m_dragStartY; | 155 float m_dragStartY; |
156 | |
157 WheelCounter m_wheelCounter; | |
148 }; | 158 }; |
149 | 159 |
150 #endif | 160 #endif |
151 | 161 |