Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

# 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_sldbase.h"
    00015
    00025 class QWT_EXPORT QwtWheel : public QwtSliderBase
    00026 {
    00027     Q_OBJECT
    00028     Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
    00029     Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
    00030     Q_PROPERTY( int    tickCnt READ tickCnt WRITE setTickCnt )
    00031     Q_PROPERTY( int    internalBorder READ internalBorder WRITE setInternalBorder )
    00032     Q_PROPERTY( double mass READ mass WRITE setMass )
    00033
    00034 public:
    00035     QwtWheel(QWidget *parent = 0, const char *name = 0);
    00036     virtual ~QwtWheel();
    00037
    00038     virtual void setOrientation(Qt::Orientation);
    00039
    00040     double totalAngle() const {return d_totalAngle;}
    00041         double viewAngle() const {return d_viewAngle;}
    00042     int tickCnt() const {return d_tickCnt;}
    00043     int internalBorder() const {return d_intBorder;}
    00044         double mass() const;
    00045
    00046     void setTotalAngle (double angle);
    00047     void setTickCnt(int cnt);
    00048     void setViewAngle(double angle);
    00049     void setInternalBorder(int width);
    00050     void setMass(double val);
    00051     void setWheelWidth( int w );
    00052
    00053     virtual QSize sizeHint() const;
    00054     virtual QSize minimumSizeHint() const;
    00055     virtual QSizePolicy sizePolicy() const;
    00056
    00057 protected:
    00058     virtual void resizeEvent(QResizeEvent *e);
    00059     virtual void paintEvent(QPaintEvent *e);
    00060
    00061     void layoutWheel( bool update = TRUE );
    00062     void draw(QPainter *p, const QRect& update_rect);
    00063     void drawWheel(QPainter *p, const QRect &r);
    00064     void drawWheelBackground(QPainter *p, const QRect &r);
    00065     void setColorArray();
    00066
    00067     virtual void valueChange();
    00068     virtual void paletteChange( const QPalette &);
    00069
    00070     virtual double getValue(const QPoint &p);
    00071     virtual void getScrollMode(const QPoint &p,
    00072         int &scrollMode, int &direction);
    00073
    00074 private:
    00075     QColor* d_colors;
    00076     QRect d_sliderRect;
    00077     double d_viewAngle;
    00078     double d_totalAngle;
    00079     int d_tickCnt;
    00080     int d_intBorder;
    00081     int d_borderWidth;
    00082     int d_colorCnt;
    00083     int d_wheelWidth;
    00084     int d_allocContext;
    00085 };
    00086
    00087 #endif