svgui  1.9
Panner Class Reference

#include <Panner.h>

Inheritance diagram for Panner:
Collaboration diagram for Panner:

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
 

Detailed Description

Definition at line 21 of file Panner.h.

Constructor & Destructor Documentation

◆ Panner()

Panner::Panner ( QWidget *  parent = 0)

Definition at line 26 of file Panner.cpp.

◆ ~Panner()

Panner::~Panner ( )
virtual

Definition at line 45 of file Panner.cpp.

Member Function Documentation

◆ setDefaultRectCentre()

void Panner::setDefaultRectCentre ( float  cx,
float  cy 
)

Definition at line 279 of file Panner.cpp.

References m_defaultCentreX, m_defaultCentreY, and m_defaultsSet.

◆ setThumbColour()

void Panner::setThumbColour ( QColor  colour)

◆ setAlpha()

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().

◆ setScrollUnit()

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.

◆ getRectExtents()

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.

◆ sizeHint()

QSize Panner::sizeHint ( ) const
virtual

Definition at line 273 of file Panner.cpp.

◆ rectExtentsChanged

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().

◆ rectCentreMoved

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().

◆ doubleClicked

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().

◆ mouseEntered

void Panner::mouseEntered ( )
signal

Referenced by enterEvent().

◆ mouseLeft

void Panner::mouseLeft ( )
signal

Referenced by leaveEvent().

◆ setRectExtents

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().

◆ setRectWidth

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().

◆ setRectHeight

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().

◆ setRectCentreX

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().

◆ setRectCentreY

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().

◆ scroll

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().

◆ resetToDefault

void Panner::resetToDefault ( )
slot

◆ mousePressEvent()

void Panner::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Definition at line 82 of file Panner.cpp.

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

◆ mouseDoubleClickEvent()

void Panner::mouseDoubleClickEvent ( QMouseEvent *  e)
protectedvirtual

Definition at line 97 of file Panner.cpp.

References doubleClicked().

◆ mouseMoveEvent()

void Panner::mouseMoveEvent ( QMouseEvent *  e)
protectedvirtual

◆ mouseReleaseEvent()

void Panner::mouseReleaseEvent ( QMouseEvent *  e)
protectedvirtual

Definition at line 124 of file Panner.cpp.

References m_clicked, and mouseMoveEvent().

◆ wheelEvent()

void Panner::wheelEvent ( QWheelEvent *  e)
protectedvirtual

Definition at line 133 of file Panner.cpp.

References scroll().

◆ paintEvent()

void Panner::paintEvent ( QPaintEvent *  e)
protectedvirtual

◆ enterEvent()

void Panner::enterEvent ( QEvent *  )
protectedvirtual

Definition at line 139 of file Panner.cpp.

References mouseEntered().

◆ leaveEvent()

void Panner::leaveEvent ( QEvent *  )
protectedvirtual

Definition at line 145 of file Panner.cpp.

References mouseLeft().

◆ normalise()

◆ emitAndUpdate()

◆ centreX()

float Panner::centreX ( ) const
inlineprotected

Definition at line 141 of file Panner.h.

References m_rectWidth, and m_rectX.

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

◆ centreY()

float Panner::centreY ( ) const
inlineprotected

Definition at line 142 of file Panner.h.

References m_rectHeight, and m_rectY.

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

Member Data Documentation

◆ m_rectX

◆ m_rectY

◆ m_rectWidth

float Panner::m_rectWidth
protected

◆ m_rectHeight

float Panner::m_rectHeight
protected

◆ m_scrollUnit

float Panner::m_scrollUnit
protected

Definition at line 131 of file Panner.h.

Referenced by scroll(), and setScrollUnit().

◆ m_defaultCentreX

float Panner::m_defaultCentreX
protected

Definition at line 133 of file Panner.h.

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

◆ m_defaultCentreY

float Panner::m_defaultCentreY
protected

Definition at line 134 of file Panner.h.

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

◆ m_defaultsSet

bool Panner::m_defaultsSet
protected

Definition at line 135 of file Panner.h.

Referenced by normalise(), and setDefaultRectCentre().

◆ m_thumbColour

QColor Panner::m_thumbColour
protected

Definition at line 137 of file Panner.h.

Referenced by paintEvent().

◆ m_backgroundAlpha

int Panner::m_backgroundAlpha
protected

Definition at line 138 of file Panner.h.

Referenced by paintEvent(), and setAlpha().

◆ m_thumbAlpha

int Panner::m_thumbAlpha
protected

Definition at line 139 of file Panner.h.

Referenced by paintEvent(), and setAlpha().

◆ m_clicked

bool Panner::m_clicked
protected

Definition at line 144 of file Panner.h.

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

◆ m_clickPos

QPoint Panner::m_clickPos
protected

Definition at line 145 of file Panner.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_dragStartX

float Panner::m_dragStartX
protected

Definition at line 146 of file Panner.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_dragStartY

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: