COPASI API  4.16.103
CopasiSlider.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) 2004 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef CopasiSlider_H__
16 #define CopasiSlider_H__
17 
18 #include <QtGui/QFrame>
19 #include <QtGui/QLabel>
20 
21 #include "copasi.h"
22 
24 #include "utilities/CSlider.h"
25 
26 class QSlider;
27 class QWidget;
28 class CCopasiObject;
29 class QLabel;
31 class QToolButton;
32 class DataModelGUI;
33 
34 class CopasiSlider: public QFrame
35 {
36  Q_OBJECT
37 public:
38  CopasiSlider(CSlider* pSlider, DataModelGUI * pDM, QWidget* parent = 0);
39  virtual ~CopasiSlider();
40 
41  CSlider::Type type() const;
42  void setType(CSlider::Type type);
43 
44  C_FLOAT64 value() const;
45  void setValue(C_FLOAT64 value);
46  unsigned C_INT32 minorMajorFactor() const;
47  void setMinorMajorFactor(unsigned C_INT32 factor);
49  unsigned C_INT32 numMinorTicks() const;
50  void setNumMinorTicks(unsigned C_INT32 numMinorTicks);
51  void setMinValue(C_FLOAT64 value);
52  void setMaxValue(C_FLOAT64 value);
53  void setOriginalValue(C_FLOAT64 value);
54  C_FLOAT64 minValue() const;
55  C_FLOAT64 maxValue() const;
56  C_FLOAT64 originalValue() const;
57  void updateValue(bool modifyRange, bool updateDependencies);
58  CCopasiObject* object() const;
59  void setObject(CCopasiObject* object);
60  CSlider* getCSlider() const;
61  void updateLabel();
62  void updateSliderData();
63  void resetValue();
64  void focusSlider();
65 
66  /**
67  * Checks whether the slider is actually valid.
68  * This is mainly done by calling isValid on the underlying CSlider object.
69  */
70  bool isValid() const;
71 
72 public slots:
73  void sliderValueChanged(int value);
74  void qSliderReleased();
75  void qSliderPressed();
76  void closeButtonClicked();
77  void editButtonClicked();
78 
79 signals:
80  void valueChanged(double);
81  void sliderReleased();
82  void sliderPressed();
83  void closeClicked(CopasiSlider* slider);
84  void editClicked(CopasiSlider* slider);
85 
86 protected:
88  QSlider* mpQSlider;
89  QLabel* mpLabel;
90  QToolButton* mpCloseButton;
91  QToolButton* mpEditButton;
94 
97 };
98 
99 #endif // CopasiSlider_H__
CSlider * getCSlider() const
void updateLabel()
void qSliderPressed()
void sliderPressed()
void setNumMinorTicks(unsigned C_INT32 numMinorTicks)
virtual ~CopasiSlider()
void valueChanged(double)
CCopasiObject * object() const
void updateSliderData()
C_FLOAT64 minorTickInterval() const
CSlider::Type type() const
void setType(CSlider::Type type)
#define C_INT32
Definition: copasi.h:90
bool mValueOutOfRange
Definition: CopasiSlider.h:92
void editClicked(CopasiSlider *slider)
void updateValue(bool modifyRange, bool updateDependencies)
QLabel * mpLabel
Definition: CopasiSlider.h:89
int calculatePositionFromValue(C_FLOAT64 value)
void setOriginalValue(C_FLOAT64 value)
void closeClicked(CopasiSlider *slider)
unsigned C_INT32 minorMajorFactor() const
void sliderReleased()
void setMinorMajorFactor(unsigned C_INT32 factor)
C_FLOAT64 value() const
void editButtonClicked()
DataModelGUI * mpDM
Definition: CopasiSlider.h:93
C_FLOAT64 calculateValueFromPosition(int position)
void closeButtonClicked()
void setMinValue(C_FLOAT64 value)
C_FLOAT64 minValue() const
CSlider * mpCSlider
Definition: CopasiSlider.h:87
void qSliderReleased()
#define C_FLOAT64
Definition: copasi.h:92
bool isValid() const
unsigned C_INT32 numMinorTicks() const
void setObject(CCopasiObject *object)
C_FLOAT64 maxValue() const
void setValue(C_FLOAT64 value)
void focusSlider()
C_FLOAT64 originalValue() const
QToolButton * mpCloseButton
Definition: CopasiSlider.h:90
QToolButton * mpEditButton
Definition: CopasiSlider.h:91
void setMaxValue(C_FLOAT64 value)
void sliderValueChanged(int value)
QSlider * mpQSlider
Definition: CopasiSlider.h:88
CopasiSlider(CSlider *pSlider, DataModelGUI *pDM, QWidget *parent=0)