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 #if QT_VERSION < 0x040000
00109     QValueStack<QwtDoubleRect> &zoomStack();
00110 #else
00111     QStack<QwtDoubleRect> &zoomStack();
00112 #endif
00113 
00114     virtual void rescale();
00115 
00116     virtual QwtDoubleSize minZoomSize() const;
00117 
00118     virtual void widgetMouseReleaseEvent(QMouseEvent *);
00119     virtual void widgetKeyPressEvent(QKeyEvent *);
00120 
00121     virtual void begin();
00122     virtual bool end(bool ok = true);
00123     virtual bool accept(SelectedPoints &) const;
00124 
00125 private:
00126     void init(int selectionFlags = RectSelection & ClickSelection, 
00127         DisplayMode trackerMode = ActiveOnly);
00128 
00129     class PrivateData;
00130     PrivateData *d_data;
00131 };
00132             
00133 #endif

Generated on Wed Aug 31 23:02:29 2005 for Qwt User's Guide by  doxygen 1.4.1