Main Page | Class Hierarchy | Alphabetical List | Class List | 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
00013 #define QWT_PLOT_ZOOMER
00014 
00015 #include <qvaluestack.h>
00016 #include "qwt_double_rect.h"
00017 #include "qwt_plot_picker.h"
00018 
00019 #if defined(QWT_TEMPLATEDLL)
00020 // MOC_SKIP_BEGIN
00021 template class QWT_EXPORT QValueStack<QwtDoubleRect>;
00022 // MOC_SKIP_END
00023 #endif
00024 
00059 class QWT_EXPORT QwtPlotZoomer: public QwtPlotPicker
00060 {
00061     Q_OBJECT
00062 public:
00063     QwtPlotZoomer(QwtPlotCanvas *, const char *name = 0);
00064     QwtPlotZoomer(int xAxis, int yAxis, 
00065         QwtPlotCanvas *, const char *name = 0);
00066     QwtPlotZoomer(int xAxis, int yAxis, int selectionFlags,
00067         DisplayMode cursorLabelMode, QwtPlotCanvas *, const char *name = 0);
00068 
00069     virtual void setZoomBase();
00070     virtual void setZoomBase(const QwtDoubleRect &);
00071 
00072     QwtDoubleRect zoomBase() const;
00073     QwtDoubleRect zoomRect() const;
00074 
00075     virtual void setAxis(int xAxis, int yAxis);
00076 
00077     void setMaxStackDepth(int);
00078     int maxStackDepth() const;
00079 
00080     const QValueStack<QwtDoubleRect> &zoomStack() const;
00081     uint zoomRectIndex() const;
00082 
00083     virtual void setSelectionFlags(int);
00084 
00085 public slots:
00086     void moveBy(double x, double y);
00087     virtual void move(double x, double y);
00088 
00089     virtual void zoom(const QwtDoubleRect &);
00090     virtual void zoom(int up);
00091 
00092 signals:
00102     void zoomed(const QwtDoubleRect &rect);
00103 
00104 protected:
00105     QValueStack<QwtDoubleRect> &zoomStack();
00106 
00107     virtual void rescale();
00108 
00109     virtual QwtDoubleSize minZoomSize() const;
00110 
00111     virtual void widgetMouseReleaseEvent(QMouseEvent *);
00112     virtual void widgetKeyPressEvent(QKeyEvent *);
00113 
00114     virtual void begin();
00115     virtual bool end(bool ok = TRUE);
00116     virtual bool accept(QPointArray &) const;
00117 
00118 private:
00119     void init(int selectionFlags = RectSelection & ClickSelection, 
00120         DisplayMode cursorLabelMode = ActiveOnly);
00121 
00122     uint d_zoomRectIndex;
00123     QValueStack<QwtDoubleRect> d_zoomStack;
00124 
00125     int d_maxStackDepth;
00126 };
00127             
00128 #endif
00129 
00130 // Local Variables:
00131 // mode: C++
00132 // c-file-style: "stroustrup"
00133 // indent-tabs-mode: nil
00134 // End:

Generated on Sun Nov 21 11:12:44 2004 for Qwt User's Guide by doxygen 1.3.5