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

qwt_plot_zoomer.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 // vim: expandtab
00011 
00012 #ifndef QWT_PLOT_ZOOMER_H
00013 #define QWT_PLOT_ZOOMER_H
00014 
00015 #include <qglobal.h>
00016 #if QT_VERSION < 0x040000
00017 #include <qvaluestack.h>
00018 #else
00019 #include <qstack.h>
00020 #endif
00021 
00022 #include "qwt_double_rect.h"
00023 #include "qwt_plot_picker.h"
00024 
00057 class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker
00058 {
00059     Q_OBJECT
00060 public:
00061     explicit QwtPlotZoomer(QwtPlotCanvas *);
00062     explicit QwtPlotZoomer(int xAxis, int yAxis, QwtPlotCanvas *);
00063     explicit QwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
00064         DisplayMode trackerMode, QwtPlotCanvas *);
00065 
00066     virtual ~QwtPlotZoomer();
00067 
00068     virtual void setZoomBase();
00069     virtual void setZoomBase(const QwtDoubleRect &);
00070 
00071     QwtDoubleRect zoomBase() const;
00072     QwtDoubleRect zoomRect() const;
00073 
00074     virtual void setAxis(int xAxis, int yAxis);
00075 
00076     void setMaxStackDepth(int);
00077     int maxStackDepth() const;
00078 
00079 #if QT_VERSION < 0x040000
00080     const QValueStack<QwtDoubleRect> &zoomStack() const;
00081 #else
00082     const QStack<QwtDoubleRect> &zoomStack() const;
00083 #endif
00084     uint zoomRectIndex() const;
00085 
00086     virtual void setSelectionFlags(int);
00087 
00088 public slots:
00089     void moveBy(double x, double y);
00090     virtual void move(double x, double y);
00091 
00092     virtual void zoom(const QwtDoubleRect &);
00093     virtual void zoom(int up);
00094 
00095 signals:
00105     void zoomed(const QwtDoubleRect &rect);
00106 
00107 protected:
00108     virtual void rescale();
00109 
00110     virtual QwtDoubleSize minZoomSize() const;
00111 
00112     virtual void widgetMouseReleaseEvent(QMouseEvent *);
00113     virtual void widgetKeyPressEvent(QKeyEvent *);
00114 
00115     virtual void begin();
00116     virtual bool end(bool ok = true);
00117     virtual bool accept(SelectedPoints &) const;
00118 
00119 private:
00120     void init(int selectionFlags = RectSelection & ClickSelection, 
00121         DisplayMode trackerMode = ActiveOnly);
00122 
00123     class PrivateData;
00124     PrivateData *d_data;
00125 };
00126             
00127 #endif

Generated on Mon Jan 30 22:16:26 2006 for Qwt User's Guide by  doxygen 1.4.4