svgui  1.9
Panner Class Reference

#include <Panner.h>

List of all members.

Public Slots

void setRectExtents (float x0, float y0, float width, float height)
 Set the extents of the panned rectangle within the overall panner widget.
void setRectWidth (float width)
 Set the width of the panned rectangle as a fraction (0 -> 1) of that of the whole panner widget.
void setRectHeight (float height)
 Set the height of the panned rectangle as a fraction (0 -> 1) of that of the whole panner widget.
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.
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.
void scroll (bool up)
 Move up (if up is true) or down a bit.
void resetToDefault ()

Signals

void rectExtentsChanged (float, float, float, float)
 Emitted when the panned rectangle is dragged or otherwise moved.
void rectCentreMoved (float, float)
 Emitted when the rectangle is dragged or otherwise moved (as well as extentsChanged).
void doubleClicked ()
 Emitted when the panner is double-clicked (for the "customer" code to pop up a value editing dialog, for example).
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.
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

Detailed Description

Definition at line 21 of file Panner.h.


Constructor & Destructor Documentation

Panner::Panner ( QWidget *  parent = 0)

Definition at line 26 of file Panner.cpp.

Panner::~Panner ( ) [virtual]

Definition at line 45 of file Panner.cpp.


Member Function Documentation

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.

QSize Panner::sizeHint ( ) const [virtual]

Definition at line 273 of file Panner.cpp.

void Panner::rectExtentsChanged ( float  ,
float  ,
float  ,
float   
) [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().

void Panner::rectCentreMoved ( float  ,
float   
) [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().

void Panner::doubleClicked ( ) [signal]

Emitted when the panner is double-clicked (for the "customer" code to pop up a value editing dialog, for example).

Referenced by mouseDoubleClickEvent().

void Panner::mouseEntered ( ) [signal]

Referenced by enterEvent().

void Panner::mouseLeft ( ) [signal]

Referenced by leaveEvent().

void Panner::setRectExtents ( float  x0,
float  y0,
float  width,
float  height 
) [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().

void Panner::setRectWidth ( float  width) [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().

void Panner::setRectHeight ( float  height) [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().

void Panner::setRectCentreX ( float  x) [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().

void Panner::setRectCentreY ( float  y) [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().

void Panner::scroll ( bool  up) [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().

void Panner::mousePressEvent ( QMouseEvent *  e) [protected, virtual]

Definition at line 82 of file Panner.cpp.

References m_clicked, m_clickPos, m_dragStartX, m_dragStartY, m_rectX, m_rectY, and resetToDefault().

void Panner::mouseDoubleClickEvent ( QMouseEvent *  e) [protected, virtual]

Definition at line 97 of file Panner.cpp.

References doubleClicked().

void Panner::mouseMoveEvent ( QMouseEvent *  e) [protected, virtual]
void Panner::mouseReleaseEvent ( QMouseEvent *  e) [protected, virtual]

Definition at line 124 of file Panner.cpp.

References m_clicked, and mouseMoveEvent().

void Panner::wheelEvent ( QWheelEvent *  e) [protected, virtual]

Definition at line 133 of file Panner.cpp.

References scroll().

void Panner::paintEvent ( QPaintEvent *  e) [protected, virtual]
void Panner::enterEvent ( QEvent *  ) [protected, virtual]

Definition at line 139 of file Panner.cpp.

References mouseEntered().

void Panner::leaveEvent ( QEvent *  ) [protected, virtual]

Definition at line 145 of file Panner.cpp.

References mouseLeft().

float Panner::centreX ( ) const [inline, protected]

Definition at line 141 of file Panner.h.

References m_rectWidth, and m_rectX.

Referenced by emitAndUpdate(), mouseMoveEvent(), and normalise().

float Panner::centreY ( ) const [inline, protected]

Definition at line 142 of file Panner.h.

References m_rectHeight, and m_rectY.

Referenced by emitAndUpdate(), mouseMoveEvent(), and normalise().


Member Data Documentation

float Panner::m_scrollUnit [protected]

Definition at line 131 of file Panner.h.

Referenced by scroll(), and setScrollUnit().

float Panner::m_defaultCentreX [protected]

Definition at line 133 of file Panner.h.

Referenced by normalise(), resetToDefault(), and setDefaultRectCentre().

float Panner::m_defaultCentreY [protected]

Definition at line 134 of file Panner.h.

Referenced by normalise(), resetToDefault(), and setDefaultRectCentre().

bool Panner::m_defaultsSet [protected]

Definition at line 135 of file Panner.h.

Referenced by normalise(), and setDefaultRectCentre().

QColor Panner::m_thumbColour [protected]

Definition at line 137 of file Panner.h.

Referenced by paintEvent().

int Panner::m_backgroundAlpha [protected]

Definition at line 138 of file Panner.h.

Referenced by paintEvent(), and setAlpha().

int Panner::m_thumbAlpha [protected]

Definition at line 139 of file Panner.h.

Referenced by paintEvent(), and setAlpha().

bool Panner::m_clicked [protected]

Definition at line 144 of file Panner.h.

Referenced by mouseMoveEvent(), mousePressEvent(), and mouseReleaseEvent().

QPoint Panner::m_clickPos [protected]

Definition at line 145 of file Panner.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

float Panner::m_dragStartX [protected]

Definition at line 146 of file Panner.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

float Panner::m_dragStartY [protected]

Definition at line 147 of file Panner.h.

Referenced by mouseMoveEvent(), and mousePressEvent().


The documentation for this class was generated from the following files: