~l3on/ubuntu/oneiric/qwt/fix-921430

« back to all changes in this revision

Viewing changes to qwt-5.0.1/src/qwt_wheel.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2007-10-05 15:20:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20071005152041-qmybqh4fj9jejyo2
Tags: 5.0.2-2
* Handle nostrip build option. (Closes: #437877)
* Build libqwt5-doc package in binary-indep target. (Closes: #443110)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
2
 
 * Qwt Widget Library
3
 
 * Copyright (C) 1997   Josef Wilgen
4
 
 * Copyright (C) 2002   Uwe Rathmann
5
 
 *
6
 
 * This library is free software; you can redistribute it and/or
7
 
 * modify it under the terms of the Qwt License, Version 1.0
8
 
 *****************************************************************************/
9
 
 
10
 
#ifndef QWT_WHEEL_H
11
 
#define QWT_WHEEL_H
12
 
 
13
 
#include "qwt_global.h"
14
 
#include "qwt_abstract_slider.h"
15
 
 
16
 
/*!
17
 
  \brief The Wheel Widget
18
 
 
19
 
  The wheel widget can be used to change values over a very large range
20
 
  in very small steps. Using the setMass member, it can be configured
21
 
  as a flywheel.
22
 
 
23
 
  \sa The radio example.
24
 
*/
25
 
class QWT_EXPORT QwtWheel : public QwtAbstractSlider
26
 
{
27
 
    Q_OBJECT 
28
 
    Q_PROPERTY( double totalAngle READ totalAngle WRITE setTotalAngle )
29
 
    Q_PROPERTY( double viewAngle READ viewAngle WRITE setViewAngle )
30
 
    Q_PROPERTY( int    tickCnt READ tickCnt WRITE setTickCnt )
31
 
    Q_PROPERTY( int    internalBorder READ internalBorder WRITE setInternalBorder )
32
 
    Q_PROPERTY( double mass READ mass WRITE setMass )
33
 
            
34
 
public:
35
 
    explicit QwtWheel(QWidget *parent = NULL);
36
 
#if QT_VERSION < 0x040000
37
 
    explicit QwtWheel(QWidget *parent, const char *name);
38
 
#endif
39
 
    virtual ~QwtWheel();
40
 
 
41
 
    virtual void setOrientation(Qt::Orientation);
42
 
 
43
 
    double totalAngle() const;
44
 
    double viewAngle() const;
45
 
    int tickCnt() const;
46
 
    int internalBorder() const;
47
 
 
48
 
    double mass() const;
49
 
 
50
 
    void setTotalAngle (double angle);
51
 
    void setTickCnt(int cnt);
52
 
    void setViewAngle(double angle);
53
 
    void setInternalBorder(int width);
54
 
    void setMass(double val);
55
 
    void setWheelWidth( int w );
56
 
 
57
 
    virtual QSize sizeHint() const;
58
 
    virtual QSize minimumSizeHint() const;
59
 
 
60
 
protected:
61
 
    virtual void resizeEvent(QResizeEvent *e);
62
 
    virtual void paintEvent(QPaintEvent *e);
63
 
 
64
 
    void layoutWheel( bool update = true );
65
 
    void draw(QPainter *p, const QRect& update_rect);
66
 
    void drawWheel(QPainter *p, const QRect &r);
67
 
    void drawWheelBackground(QPainter *p, const QRect &r);
68
 
    void setColorArray();
69
 
 
70
 
    virtual void valueChange();
71
 
    virtual void paletteChange( const QPalette &);
72
 
 
73
 
    virtual double getValue(const QPoint &p);
74
 
    virtual void getScrollMode(const QPoint &p, 
75
 
        int &scrollMode, int &direction);
76
 
 
77
 
private:
78
 
    void initWheel();
79
 
 
80
 
    class PrivateData;
81
 
    PrivateData *d_data;
82
 
};
83
 
 
84
 
#endif