~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

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

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2009-04-12 23:25:58 UTC
  • mfrom: (1.1.4 upstream) (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090412232558-3bl06x785yr8xm8u
Tags: 5.1.2-1
* New upstream release.
* Bump compat/debhelper to 7.
* Bump Standards-Version to 3.8.1. No changes needed.
* Invert Maintainers and Uploaders field.
* Fix lintian warnings:
  - dh_clean _k deprecated.
  - missing dependency on libc.

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