svgui
1.9
|
#include <Panner.h>
Public Slots | |
void | setRectExtents (float x0, float y0, float width, float height) |
Set the extents of the panned rectangle within the overall panner widget. More... | |
void | setRectWidth (float width) |
Set the width of the panned rectangle as a fraction (0 -> 1) of that of the whole panner widget. More... | |
void | setRectHeight (float height) |
Set the height of the panned rectangle as a fraction (0 -> 1) of that of the whole panner widget. More... | |
void | setRectCentreX (float x) |
Set the location of the centre of the panned rectangle on the x axis, as a proportion (0 -> 1) of the width of the whole panner widget. More... | |
void | setRectCentreY (float y) |
Set the location of the centre of the panned rectangle on the y axis, as a proportion (0 -> 1) of the height of the whole panner widget. More... | |
void | scroll (bool up) |
Move up (if up is true) or down a bit. More... | |
void | resetToDefault () |
Signals | |
void | rectExtentsChanged (float, float, float, float) |
Emitted when the panned rectangle is dragged or otherwise moved. More... | |
void | rectCentreMoved (float, float) |
Emitted when the rectangle is dragged or otherwise moved (as well as extentsChanged). More... | |
void | doubleClicked () |
Emitted when the panner is double-clicked (for the "customer" code to pop up a value editing dialog, for example). More... | |
void | mouseEntered () |
void | mouseLeft () |
Public Member Functions | |
Panner (QWidget *parent=0) | |
virtual | ~Panner () |
void | setDefaultRectCentre (float, float) |
void | setThumbColour (QColor colour) |
void | setAlpha (int backgroundAlpha, int thumbAlpha) |
void | setScrollUnit (float unit) |
Set the amount the scroll() function or mouse wheel movement makes the panner rectangle move by. More... | |
void | getRectExtents (float &x0, float &y0, float &width, float &height) |
virtual QSize | sizeHint () const |
Protected Member Functions | |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | mouseDoubleClickEvent (QMouseEvent *e) |
virtual void | mouseMoveEvent (QMouseEvent *e) |
virtual void | mouseReleaseEvent (QMouseEvent *e) |
virtual void | wheelEvent (QWheelEvent *e) |
virtual void | paintEvent (QPaintEvent *e) |
virtual void | enterEvent (QEvent *) |
virtual void | leaveEvent (QEvent *) |
void | normalise () |
void | emitAndUpdate () |
float | centreX () const |
float | centreY () const |
Protected Attributes | |
float | m_rectX |
float | m_rectY |
float | m_rectWidth |
float | m_rectHeight |
float | m_scrollUnit |
float | m_defaultCentreX |
float | m_defaultCentreY |
bool | m_defaultsSet |
QColor | m_thumbColour |
int | m_backgroundAlpha |
int | m_thumbAlpha |
bool | m_clicked |
QPoint | m_clickPos |
float | m_dragStartX |
float | m_dragStartY |
Panner::Panner | ( | QWidget * | parent = 0 | ) |
Definition at line 26 of file Panner.cpp.
|
virtual |
Definition at line 45 of file Panner.cpp.
void Panner::setDefaultRectCentre | ( | float | cx, |
float | cy | ||
) |
Definition at line 279 of file Panner.cpp.
References m_defaultCentreX, m_defaultCentreY, and m_defaultsSet.
void Panner::setThumbColour | ( | QColor | colour | ) |
void Panner::setAlpha | ( | int | backgroundAlpha, |
int | thumbAlpha | ||
) |
Definition at line 50 of file Panner.cpp.
References m_backgroundAlpha, and m_thumbAlpha.
Referenced by Pane::updateHeadsUpDisplay().
void Panner::setScrollUnit | ( | float | unit | ) |
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.
Definition at line 57 of file Panner.cpp.
References m_scrollUnit.
void Panner::getRectExtents | ( | float & | x0, |
float & | y0, | ||
float & | width, | ||
float & | height | ||
) |
Definition at line 204 of file Panner.cpp.
References m_rectHeight, m_rectWidth, m_rectX, and m_rectY.
|
virtual |
Definition at line 273 of file Panner.cpp.
|
signal |
Emitted when the panned rectangle is dragged or otherwise moved.
Arguments are x0, y0, width and height of the rectangle in the range 0 -> 1 as proportions of the width and height of the whole widget.
Referenced by emitAndUpdate(), and mouseMoveEvent().
|
signal |
Emitted when the rectangle is dragged or otherwise moved (as well as extentsChanged).
Arguments are the centre coordinates of the rectangle in the range 0 -> 1 as proportions of the width and height of the whole widget.
Referenced by emitAndUpdate(), and mouseMoveEvent().
|
signal |
Emitted when the panner is double-clicked (for the "customer" code to pop up a value editing dialog, for example).
Referenced by mouseDoubleClickEvent().
|
signal |
Referenced by enterEvent().
|
signal |
Referenced by leaveEvent().
|
slot |
Set the extents of the panned rectangle within the overall panner widget.
Coordinates are in the range 0 -> 1 in both axes, with 0 at the top in the y axis.
Definition at line 213 of file Panner.cpp.
References emitAndUpdate(), m_rectHeight, m_rectWidth, m_rectX, m_rectY, and normalise().
Referenced by Pane::updateVerticalPanner().
|
slot |
Set the width of the panned rectangle as a fraction (0 -> 1) of that of the whole panner widget.
Definition at line 235 of file Panner.cpp.
References emitAndUpdate(), m_rectWidth, and normalise().
|
slot |
Set the height of the panned rectangle as a fraction (0 -> 1) of that of the whole panner widget.
Definition at line 244 of file Panner.cpp.
References emitAndUpdate(), m_rectHeight, and normalise().
|
slot |
Set the location of the centre of the panned rectangle on the x axis, as a proportion (0 -> 1) of the width of the whole panner widget.
Definition at line 253 of file Panner.cpp.
References emitAndUpdate(), m_rectWidth, m_rectX, and normalise().
|
slot |
Set the location of the centre of the panned rectangle on the y axis, as a proportion (0 -> 1) of the height of the whole panner widget.
Definition at line 263 of file Panner.cpp.
References emitAndUpdate(), m_rectHeight, m_rectY, and normalise().
|
slot |
Move up (if up is true) or down a bit.
This is basically the same action as rolling the mouse wheel one notch.
Definition at line 63 of file Panner.cpp.
References emitAndUpdate(), m_rectHeight, m_rectY, m_scrollUnit, and normalise().
Referenced by wheelEvent(), and Pane::wheelVertical().
|
slot |
Definition at line 287 of file Panner.cpp.
References emitAndUpdate(), m_defaultCentreX, m_defaultCentreY, m_rectHeight, m_rectWidth, m_rectX, m_rectY, and normalise().
Referenced by mousePressEvent().
|
protectedvirtual |
Definition at line 82 of file Panner.cpp.
References m_clicked, m_clickPos, m_dragStartX, m_dragStartY, m_rectX, m_rectY, and resetToDefault().
|
protectedvirtual |
Definition at line 97 of file Panner.cpp.
References doubleClicked().
|
protectedvirtual |
Definition at line 107 of file Panner.cpp.
References centreX(), centreY(), m_clicked, m_clickPos, m_dragStartX, m_dragStartY, m_rectHeight, m_rectWidth, m_rectX, m_rectY, normalise(), rectCentreMoved(), and rectExtentsChanged().
Referenced by mouseReleaseEvent().
|
protectedvirtual |
Definition at line 124 of file Panner.cpp.
References m_clicked, and mouseMoveEvent().
|
protectedvirtual |
Definition at line 133 of file Panner.cpp.
References scroll().
|
protectedvirtual |
Definition at line 151 of file Panner.cpp.
References m_backgroundAlpha, m_rectHeight, m_rectWidth, m_rectX, m_rectY, m_thumbAlpha, and m_thumbColour.
|
protectedvirtual |
Definition at line 139 of file Panner.cpp.
References mouseEntered().
|
protectedvirtual |
Definition at line 145 of file Panner.cpp.
References mouseLeft().
|
protected |
Definition at line 179 of file Panner.cpp.
References centreX(), centreY(), m_defaultCentreX, m_defaultCentreY, m_defaultsSet, m_rectHeight, m_rectWidth, m_rectX, and m_rectY.
Referenced by mouseMoveEvent(), resetToDefault(), scroll(), setRectCentreX(), setRectCentreY(), setRectExtents(), setRectHeight(), and setRectWidth().
|
protected |
Definition at line 196 of file Panner.cpp.
References centreX(), centreY(), m_rectHeight, m_rectWidth, m_rectX, m_rectY, rectCentreMoved(), and rectExtentsChanged().
Referenced by resetToDefault(), scroll(), setRectCentreX(), setRectCentreY(), setRectExtents(), setRectHeight(), and setRectWidth().
|
inlineprotected |
Definition at line 141 of file Panner.h.
References m_rectWidth, and m_rectX.
Referenced by emitAndUpdate(), mouseMoveEvent(), and normalise().
|
inlineprotected |
Definition at line 142 of file Panner.h.
References m_rectHeight, and m_rectY.
Referenced by emitAndUpdate(), mouseMoveEvent(), and normalise().
|
protected |
Definition at line 127 of file Panner.h.
Referenced by centreX(), emitAndUpdate(), getRectExtents(), mouseMoveEvent(), mousePressEvent(), normalise(), paintEvent(), resetToDefault(), setRectCentreX(), and setRectExtents().
|
protected |
Definition at line 128 of file Panner.h.
Referenced by centreY(), emitAndUpdate(), getRectExtents(), mouseMoveEvent(), mousePressEvent(), normalise(), paintEvent(), resetToDefault(), scroll(), setRectCentreY(), and setRectExtents().
|
protected |
Definition at line 129 of file Panner.h.
Referenced by centreX(), emitAndUpdate(), getRectExtents(), mouseMoveEvent(), normalise(), paintEvent(), resetToDefault(), setRectCentreX(), setRectExtents(), and setRectWidth().
|
protected |
Definition at line 130 of file Panner.h.
Referenced by centreY(), emitAndUpdate(), getRectExtents(), mouseMoveEvent(), normalise(), paintEvent(), resetToDefault(), scroll(), setRectCentreY(), setRectExtents(), and setRectHeight().
|
protected |
Definition at line 131 of file Panner.h.
Referenced by scroll(), and setScrollUnit().
|
protected |
Definition at line 133 of file Panner.h.
Referenced by normalise(), resetToDefault(), and setDefaultRectCentre().
|
protected |
Definition at line 134 of file Panner.h.
Referenced by normalise(), resetToDefault(), and setDefaultRectCentre().
|
protected |
Definition at line 135 of file Panner.h.
Referenced by normalise(), and setDefaultRectCentre().
|
protected |
Definition at line 137 of file Panner.h.
Referenced by paintEvent().
|
protected |
Definition at line 138 of file Panner.h.
Referenced by paintEvent(), and setAlpha().
|
protected |
Definition at line 139 of file Panner.h.
Referenced by paintEvent(), and setAlpha().
|
protected |
Definition at line 144 of file Panner.h.
Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().
|
protected |
Definition at line 145 of file Panner.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
protected |
Definition at line 146 of file Panner.h.
Referenced by mouseMoveEvent(), and mousePressEvent().
|
protected |
Definition at line 147 of file Panner.h.
Referenced by mouseMoveEvent(), and mousePressEvent().