comparison widgets/Panner.h @ 188:dd573e090eed

* Add range input dialog * Make Panner support middle-click/ctrl-left-click to reset and emit doubleClicked when doubleClicked instead of resetting * Use range input dialog to enter new values for panner on double-click
author Chris Cannam
date Fri, 12 Jan 2007 21:52:56 +0000
parents 42118892f428
children 5b7472db612b
comparison
equal deleted inserted replaced
187:e7cf6044c2a0 188:dd573e090eed
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 33
34 void getRectExtents(float &x0, float &y0, float &width, float &height);
35
34 virtual void mousePressEvent(QMouseEvent *e); 36 virtual void mousePressEvent(QMouseEvent *e);
35 virtual void mouseDoubleClickEvent(QMouseEvent *e); 37 virtual void mouseDoubleClickEvent(QMouseEvent *e);
36 virtual void mouseMoveEvent(QMouseEvent *e); 38 virtual void mouseMoveEvent(QMouseEvent *e);
37 virtual void mouseReleaseEvent(QMouseEvent *e); 39 virtual void mouseReleaseEvent(QMouseEvent *e);
38 virtual void wheelEvent(QWheelEvent *e); 40 virtual void wheelEvent(QWheelEvent *e);
54 * well as extentsChanged). Arguments are the centre coordinates 56 * well as extentsChanged). Arguments are the centre coordinates
55 * of the rectangle in the range 0 -> 1 as proportions of the 57 * of the rectangle in the range 0 -> 1 as proportions of the
56 * width and height of the whole widget. 58 * width and height of the whole widget.
57 */ 59 */
58 void rectCentreMoved(float, float); 60 void rectCentreMoved(float, float);
61
62 /**
63 * Emitted when the panner is double-clicked (for the "customer"
64 * code to pop up a value editing dialog, for example).
65 */
66 void doubleClicked();
59 67
60 public slots: 68 public slots:
61 /** 69 /**
62 * Set the extents of the panned rectangle within the overall 70 * Set the extents of the panned rectangle within the overall
63 * panner widget. Coordinates are in the range 0 -> 1 in both axes, 71 * panner widget. Coordinates are in the range 0 -> 1 in both axes,
89 * axis, as a proportion (0 -> 1) of the height of the whole panner 97 * axis, as a proportion (0 -> 1) of the height of the whole panner
90 * widget. 98 * widget.
91 */ 99 */
92 void setRectCentreY(float y); 100 void setRectCentreY(float y);
93 101
102 void resetToDefault();
103
94 protected: 104 protected:
95 void normalise(); 105 void normalise();
96 void emitAndUpdate(); 106 void emitAndUpdate();
97 void resetToDefault();
98 107
99 float m_rectX; 108 float m_rectX;
100 float m_rectY; 109 float m_rectY;
101 float m_rectWidth; 110 float m_rectWidth;
102 float m_rectHeight; 111 float m_rectHeight;