# qwt_wheel.h

    00001 /* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
    00002  * Qwt Widget Library
    00003  * Copyright (C) 1997   Josef Wilgen
    00004  * Copyright (C) 2002   Uwe Rathmann
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the Qwt License, Version 1.0
    00008  *****************************************************************************/
    00009
    00010 #ifndef QWT_WHEEL_H
    00011 #define QWT_WHEEL_H
    00012
    00013 #include "qwt_global.h"
    00014 #include "qwt_abstract_slider.h"
    00015
    00025 class QWT_EXPORT QwtWheel : public QwtAbstractSlider
    00026 {
    00027     Q_OBJECT
    00028
    00029     Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
    00030     Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
    00031     Q_PROPERTY( int tickCnt READ tickCnt WRITE setTickCnt )
    00032     Q_PROPERTY( int wheelWidth READ wheelWidth WRITE setWheelWidth )
    00033     Q_PROPERTY( int borderWidth READ borderWidth WRITE setBorderWidth )
    00034     Q_PROPERTY( int wheelBorderWidth READ wheelBorderWidth WRITE setWheelBorderWidth )
    00035     Q_PROPERTY( double mass READ mass WRITE setMass )
    00036
    00037 public:
    00038     explicit QwtWheel( QWidget *parent = NULL );
    00039     virtual ~QwtWheel();
    00040
    00041 public Q_SLOTS:
    00042     void setTotalAngle ( double );
    00043     void setViewAngle( double );
    00044
    00045 public:
    00046     virtual void setOrientation( Qt::Orientation );
    00047
    00048     double totalAngle() const;
    00049     double viewAngle() const;
    00050
    00051     void setTickCnt( int );
    00052     int tickCnt() const;
    00053
    00054     void setMass( double );
    00055     double mass() const;
    00056
    00057     void setWheelWidth( int );
    00058     int wheelWidth() const;
    00059
    00060     void setWheelBorderWidth( int );
    00061     int wheelBorderWidth() const;
    00062
    00063     void setBorderWidth( int );
    00064     int borderWidth() const;
    00065
    00066     QRect wheelRect() const;
    00067
    00068     virtual QSize sizeHint() const;
    00069     virtual QSize minimumSizeHint() const;
    00070
    00071 protected:
    00072     virtual void paintEvent( QPaintEvent * );
    00073     virtual void resizeEvent( QResizeEvent * );
    00074
    00075     virtual void drawTicks( QPainter *, const QRectF & );
    00076     virtual void drawWheelBackground( QPainter *, const QRectF & );
    00077
    00078     virtual void valueChange();
    00079
    00080     virtual double getValue( const QPoint & );
    00081     virtual void getScrollMode( const QPoint &,
    00082         QwtAbstractSlider::ScrollMode &, int &direction ) const;
    00083
    00084 private:
    00085     class PrivateData;
    00086     PrivateData *d_data;
    00087 };
    00088
    00089 #endif