copasi API  0.1
copasi/plotUI/scrollzoomer.h
Go to the documentation of this file.
00001 /* Begin CVS Header
00002  $Source: /fs/turing/cvs/copasi_dev/copasi/plotUI/scrollzoomer.h,v $
00003  $Revision: 1.6 $
00004  $Name: Build-33 $
00005  $Author: shoops $
00006  $Date: 2008/12/18 19:04:22 $
00007  End CVS Header */
00008 
00009 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
00010 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
00011 // and The University of Manchester.
00012 // All rights reserved.
00013 
00014 // Copyright © 1997   Josef Wilgen
00015 // Copyright © 2002   Uwe Rathmann
00016 //
00017 // This file is published under the Qwt License, Version 1.0.
00018 // You should have received a copy of this licence in the file
00019 // QwtLicense.
00020 //
00021 // Modifications made to the original are
00022 // Copyright © 2006 by Pedro Mendes, Virginia Tech Intellectual
00023 // Properties, Inc. and EML Research, gGmbH.
00024 // All rights reserved.
00025 
00026 #ifndef _SCROLLZOOMER_H
00027 #define _SCROLLZOOMER_H
00028 
00029 #include <qglobal.h>
00030 
00031 #if QT_VERSION < 0x040000
00032 # include <q3scrollview.h>
00033 #endif
00034 
00035 #include <qwt_plot_zoomer.h>
00036 //Added by qt3to4:
00037 #include <QEvent>
00038 
00039 class ScrollData;
00040 class ScrollBar;
00041 
00042 class LogPlotZoomer: public QwtPlotZoomer
00043   {
00044     Q_OBJECT
00045 
00046   public:
00047     LogPlotZoomer(QwtPlotCanvas *canvas);
00048 
00049   public slots:
00050     virtual
00051     void move(double x, double y);
00052 
00053   protected:
00054     virtual QwtText trackerText(const QwtDoublePoint &pos) const;
00055   };
00056 
00057 class ScrollZoomer: public LogPlotZoomer
00058   {
00059     Q_OBJECT
00060   public:
00061     enum ScrollBarPosition
00062     {
00063       AttachedToScale,
00064       OppositeToScale
00065     };
00066 
00067     ScrollZoomer(QwtPlotCanvas *);
00068     virtual ~ScrollZoomer();
00069 
00070     ScrollBar *horizontalScrollBar() const;
00071     ScrollBar *verticalScrollBar() const;
00072 
00073 #if QT_VERSION < 0x040000
00074     void setHScrollBarMode(Q3ScrollView::ScrollBarMode);
00075     void setVScrollBarMode(Q3ScrollView::ScrollBarMode);
00076 
00077     Q3ScrollView::ScrollBarMode vScrollBarMode () const;
00078     Q3ScrollView::ScrollBarMode hScrollBarMode () const;
00079 #else
00080     void setHScrollBarMode(Qt::ScrollBarPolicy);
00081     void setVScrollBarMode(Qt::ScrollBarPolicy);
00082 
00083     Qt::ScrollBarPolicy vScrollBarMode () const;
00084     Qt::ScrollBarPolicy hScrollBarMode () const;
00085 #endif
00086 
00087     void setHScrollBarPosition(ScrollBarPosition);
00088     void setVScrollBarPosition(ScrollBarPosition);
00089 
00090     ScrollBarPosition hScrollBarPosition() const;
00091     ScrollBarPosition vScrollBarPosition() const;
00092 
00093     QWidget* cornerWidget() const;
00094     virtual void setCornerWidget(QWidget *);
00095 
00096     virtual bool eventFilter(QObject *, QEvent *);
00097 
00098     virtual void rescale();
00099 
00100   protected:
00101     virtual ScrollBar *scrollBar(Qt::Orientation);
00102     virtual void updateScrollBars();
00103     virtual void layoutScrollBars(const QRect &);
00104 
00105   private slots:
00106     void scrollBarMoved(Qt::Orientation o, double min, double max);
00107 
00108   private:
00109     bool needScrollBar(Qt::Orientation) const;
00110     int oppositeAxis(int) const;
00111 
00112     QWidget *d_cornerWidget;
00113 
00114     ScrollData *d_hScrollData;
00115     ScrollData *d_vScrollData;
00116   };
00117 
00118 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines