copasi API  0.1
copasi/plotUI/scrollbar.h
Go to the documentation of this file.
00001 /* Begin CVS Header
00002    $Source: /fs/turing/cvs/copasi_dev/copasi/plotUI/scrollbar.h,v $
00003    $Revision: 1.4 $
00004    $Name: Build-33 $
00005    $Author: shoops $
00006    $Date: 2006/06/20 13:19:33 $
00007    End CVS Header */
00008 
00009 // Copyright © 1997   Josef Wilgen
00010 // Copyright © 2002   Uwe Rathmann
00011 //
00012 // This file is published under the Qwt License, Version 1.0.
00013 // You should have received a copy of this licence in the file
00014 // QwtLicense.
00015 //
00016 // Modifications made to the original are
00017 // Copyright © 2006 by Pedro Mendes, Virginia Tech Intellectual
00018 // Properties, Inc. and EML Research, gGmbH.
00019 // All rights reserved.
00020 
00021 #ifndef _SCROLLBAR_H
00022 #define _SCROLLBAR_H 1
00023 
00024 #include <qscrollbar.h>
00025 
00026 class ScrollBar: public QScrollBar
00027   {
00028     Q_OBJECT
00029 
00030   public:
00031     ScrollBar(QWidget *parent = NULL);
00032     ScrollBar(Qt::Orientation, QWidget *parent = NULL);
00033     ScrollBar(double minBase, double maxBase, bool logscale,
00034               Qt::Orientation o, QWidget *parent = NULL);
00035 
00036     void setInverted(bool);
00037     bool isInverted() const;
00038 
00039     void setLogScale(bool l);
00040     bool isLogScale() const;
00041 
00042     double minBaseValue() const;
00043     double maxBaseValue() const;
00044 
00045     double minSliderValue() const;
00046     double maxSliderValue() const;
00047 
00048     int extent() const;
00049 
00050   signals:
00051     void sliderMoved(Qt::Orientation, double, double);
00052     void valueChanged(Qt::Orientation, double, double);
00053 
00054   public slots:
00055     virtual void setBase(double min, double max);
00056     virtual void moveSlider(double min, double max);
00057 
00058   protected:
00059     void sliderRange(int value, double &min, double &max) const;
00060     int mapToTick(double) const;
00061     double mapFromTick(int) const;
00062 
00063   private slots:
00064     void catchValueChanged(int value);
00065     void catchSliderMoved(int value);
00066 
00067   private:
00068     void init();
00069 
00070     bool d_inverted;
00071     double d_minBase;
00072     double d_maxBase;
00073     int d_baseTicks;
00074     bool mLogScale;
00075   };
00076 
00077 #endif
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines