COPASI API  4.16.103
scrollbar.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2006 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 // Copyright � 1997 Josef Wilgen
16 // Copyright � 2002 Uwe Rathmann
17 //
18 // This file is published under the Qwt License, Version 1.0.
19 // You should have received a copy of this licence in the file
20 // QwtLicense.
21 //
22 // Modifications made to the original are
23 #ifndef _SCROLLBAR_H
24 #define _SCROLLBAR_H 1
25 
26 #include <QtGui/QScrollBar>
27 
28 class ScrollBar: public QScrollBar
29 {
30  Q_OBJECT
31 
32 public:
33  ScrollBar(QWidget *parent = NULL);
34  ScrollBar(Qt::Orientation, QWidget *parent = NULL);
35  ScrollBar(double minBase, double maxBase, bool logscale,
36  Qt::Orientation o, QWidget *parent = NULL);
37 
38  void setInverted(bool);
39  bool isInverted() const;
40 
41  void setLogScale(bool l);
42  bool isLogScale() const;
43 
44  double minBaseValue() const;
45  double maxBaseValue() const;
46 
47  double minSliderValue() const;
48  double maxSliderValue() const;
49 
50  int extent() const;
51 
52 signals:
53  void sliderMoved(Qt::Orientation, double, double);
54  void valueChanged(Qt::Orientation, double, double);
55 
56 public slots:
57  virtual void setBase(double min, double max);
58  virtual void moveSlider(double min, double max);
59 
60 protected:
61  void sliderRange(int value, double &min, double &max) const;
62  int mapToTick(double) const;
63  double mapFromTick(int) const;
64 
65 private slots:
66  void catchValueChanged(int value);
67  void catchSliderMoved(int value);
68 
69 private:
70  void init();
71 
72  bool d_inverted;
73  double d_minBase;
74  double d_maxBase;
76  bool mLogScale;
77 };
78 
79 #endif
double maxBaseValue() const
Definition: scrollbar.cpp:153
int extent() const
Definition: scrollbar.cpp:218
double maxSliderValue() const
Definition: scrollbar.cpp:186
void init()
Definition: scrollbar.cpp:56
void sliderRange(int value, double &min, double &max) const
Definition: scrollbar.cpp:161
double mapFromTick(int) const
Definition: scrollbar.cpp:199
int d_baseTicks
Definition: scrollbar.h:75
bool mLogScale
Definition: scrollbar.h:76
bool d_inverted
Definition: scrollbar.h:72
void setInverted(bool)
Definition: scrollbar.cpp:68
void sliderMoved(Qt::Orientation, double, double)
double minSliderValue() const
Definition: scrollbar.cpp:178
bool isLogScale() const
Definition: scrollbar.cpp:248
void catchValueChanged(int value)
Definition: scrollbar.cpp:204
bool isInverted() const
Definition: scrollbar.cpp:77
void setLogScale(bool l)
Definition: scrollbar.cpp:243
void catchSliderMoved(int value)
Definition: scrollbar.cpp:211
virtual void moveSlider(double min, double max)
Definition: scrollbar.cpp:99
int mapToTick(double) const
Definition: scrollbar.cpp:194
ScrollBar(QWidget *parent=NULL)
Definition: scrollbar.cpp:31
double d_minBase
Definition: scrollbar.h:73
double d_maxBase
Definition: scrollbar.h:74
void valueChanged(Qt::Orientation, double, double)
virtual void setBase(double min, double max)
Definition: scrollbar.cpp:82
#define min(a, b)
Definition: f2c.h:175
double minBaseValue() const
Definition: scrollbar.cpp:145
#define max(a, b)
Definition: f2c.h:176