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

« back to all changes in this revision

Viewing changes to qwt-5.1.1/examples/realtime_plot/scrollzoomer.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-05-26 10:26:31 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526102631-bp95mfccnrb957nx
Tags: 5.1.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _SCROLLZOOMER_H
 
2
#define _SCROLLZOOMER_H
 
3
 
 
4
#include <qglobal.h>
 
5
#if QT_VERSION < 0x040000
 
6
#include <qscrollview.h>
 
7
#endif
 
8
#include <qwt_plot_zoomer.h>
 
9
 
 
10
class ScrollData;
 
11
class ScrollBar;
 
12
 
 
13
class ScrollZoomer: public QwtPlotZoomer
 
14
{
 
15
    Q_OBJECT
 
16
public:
 
17
    enum ScrollBarPosition
 
18
    {
 
19
        AttachedToScale,
 
20
        OppositeToScale
 
21
    };
 
22
 
 
23
    ScrollZoomer(QwtPlotCanvas *);
 
24
    virtual ~ScrollZoomer();
 
25
 
 
26
    ScrollBar *horizontalScrollBar() const;
 
27
    ScrollBar *verticalScrollBar() const;
 
28
 
 
29
#if QT_VERSION < 0x040000
 
30
    void setHScrollBarMode(QScrollView::ScrollBarMode);
 
31
    void setVScrollBarMode(QScrollView::ScrollBarMode);
 
32
 
 
33
    QScrollView::ScrollBarMode vScrollBarMode () const;
 
34
    QScrollView::ScrollBarMode hScrollBarMode () const;
 
35
#else
 
36
    void setHScrollBarMode(Qt::ScrollBarPolicy);
 
37
    void setVScrollBarMode(Qt::ScrollBarPolicy);
 
38
 
 
39
    Qt::ScrollBarPolicy vScrollBarMode () const;
 
40
    Qt::ScrollBarPolicy hScrollBarMode () const;
 
41
#endif
 
42
 
 
43
    void setHScrollBarPosition(ScrollBarPosition);
 
44
    void setVScrollBarPosition(ScrollBarPosition);
 
45
 
 
46
    ScrollBarPosition hScrollBarPosition() const;
 
47
    ScrollBarPosition vScrollBarPosition() const;
 
48
 
 
49
    QWidget* cornerWidget() const;
 
50
    virtual void setCornerWidget(QWidget *); 
 
51
    
 
52
    virtual bool eventFilter(QObject *, QEvent *);
 
53
 
 
54
    virtual void rescale();
 
55
 
 
56
protected:
 
57
    virtual ScrollBar *scrollBar(Qt::Orientation);
 
58
    virtual void updateScrollBars();
 
59
    virtual void layoutScrollBars(const QRect &);
 
60
 
 
61
private slots:
 
62
    void scrollBarMoved(Qt::Orientation o, double min, double max);
 
63
 
 
64
private:
 
65
    bool needScrollBar(Qt::Orientation) const;
 
66
    int oppositeAxis(int) const;
 
67
 
 
68
    QWidget *d_cornerWidget;
 
69
 
 
70
    ScrollData *d_hScrollData;
 
71
    ScrollData *d_vScrollData;
 
72
 
 
73
    bool d_inZoom;
 
74
    bool d_alignCanvasToScales;
 
75
};
 
76
            
 
77
#endif