comparison 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
comparison
equal deleted inserted replaced
255:e175ade2d6b0 256:c492902dba40
28 28
29 void setDefaultRectCentre(float, float); 29 void setDefaultRectCentre(float, float);
30 30
31 void setThumbColour(QColor colour); 31 void setThumbColour(QColor colour);
32 void setAlpha(int backgroundAlpha, int thumbAlpha); 32 void setAlpha(int backgroundAlpha, int thumbAlpha);
33
34 /**
35 * Set the amount the scroll() function or mouse wheel movement
36 * makes the panner rectangle move by. The default value of 0
37 * means to select a value automatically based on the dimensions
38 * of the panner rectangle.
39 */
40 void setScrollUnit(float unit);
33 41
34 void getRectExtents(float &x0, float &y0, float &width, float &height); 42 void getRectExtents(float &x0, float &y0, float &width, float &height);
35 43
36 virtual QSize sizeHint() const; 44 virtual QSize sizeHint() const;
37 45
93 * axis, as a proportion (0 -> 1) of the height of the whole panner 101 * axis, as a proportion (0 -> 1) of the height of the whole panner
94 * widget. 102 * widget.
95 */ 103 */
96 void setRectCentreY(float y); 104 void setRectCentreY(float y);
97 105
106 /**
107 * Move up (if up is true) or down a bit. This is basically the
108 * same action as rolling the mouse wheel one notch.
109 */
110 void scroll(bool up);
111
98 void resetToDefault(); 112 void resetToDefault();
99 113
100 protected: 114 protected:
101 virtual void mousePressEvent(QMouseEvent *e); 115 virtual void mousePressEvent(QMouseEvent *e);
102 virtual void mouseDoubleClickEvent(QMouseEvent *e); 116 virtual void mouseDoubleClickEvent(QMouseEvent *e);
112 126
113 float m_rectX; 127 float m_rectX;
114 float m_rectY; 128 float m_rectY;
115 float m_rectWidth; 129 float m_rectWidth;
116 float m_rectHeight; 130 float m_rectHeight;
131 float m_scrollUnit;
117 132
118 float m_defaultCentreX; 133 float m_defaultCentreX;
119 float m_defaultCentreY; 134 float m_defaultCentreY;
120 bool m_defaultsSet; 135 bool m_defaultsSet;
121 136