17 #include <QtGui/QLabel>
18 #include <QtCore/QString>
19 #include <QtGui/QSlider>
20 #include <QtGui/QPixmap>
21 #include <QtGui/QToolButton>
22 #include <QtGui/QVBoxLayout>
23 #include <QtGui/QHBoxLayout>
24 #include <QtGui/QToolTip>
41 mValueOutOfRange(false),
44 this->setLayout(
new QHBoxLayout);
45 this->setFrameShape(QFrame::Box);
46 this->layout()->setContentsMargins(2, 2, 2, 2);
49 QFrame* pFrame =
new QFrame(NULL);
50 pFrame->setLayout(
new QVBoxLayout);
51 pFrame->layout()->setContentsMargins(2, 2, 2, 2);
52 this->
mpLabel =
new QLabel(NULL);
53 this->
mpLabel->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
54 pFrame->layout()->addWidget(this->
mpLabel);
55 this->
mpQSlider =
new QSlider(Qt::Horizontal);
56 mpQSlider->setFocusPolicy(Qt::WheelFocus);
57 this->
mpQSlider->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
61 pFrame->layout()->addWidget(this->
mpQSlider);
62 this->layout()->addWidget(pFrame);
64 pFrame =
new QFrame(NULL);
65 pFrame->setLayout(
new QVBoxLayout);
66 pFrame->layout()->setContentsMargins(2, 2, 2, 2);
76 this->layout()->addWidget(pFrame);
93 setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
106 mpQSlider->setFocus(Qt::OtherFocusReason);
124 if (this->
mpQSlider->isEnabled() ==
false)
157 if (pObject == NULL)
return;
194 this->
mpQSlider->setMaximum(numMinorTicks);
249 QString labelString =
"";
254 labelString +=
" : [";
255 labelString += QString::number(minValue);
257 labelString += QString::number(maxValue);
258 labelString +=
"] {";
259 labelString += QString::number(currValue);
264 labelString +=
" (Value out of range!)";
269 labelString +=
"Object not available!";
272 this->
mpLabel->setText(labelString);
310 if ((value > maxValue) || (value < minValue))
326 if (pObject == NULL)
return;
336 if (updateDependencies)
bool compile(const std::vector< CCopasiContainer * > &listOfContainer=CCopasiContainer::EmptyList)
CSlider * getCSlider() const
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
void setObjectValue(const C_FLOAT64 &value)
void setNumMinorTicks(unsigned C_INT32 numMinorTicks)
bool setSliderObject(CCopasiObject *pObject)
bool setOriginalValue(const C_FLOAT64 value)
void valueChanged(double)
CCopasiObject * object() const
bool setMaxValue(const C_FLOAT64 maxValue)
C_FLOAT64 minorTickInterval() const
CSlider::Type type() const
CSlider::Type getSliderType() const
void setType(CSlider::Type type)
bool setTickFactor(const unsigned C_INT32 tickFactor)
void editClicked(CopasiSlider *slider)
void updateValue(bool modifyRange, bool updateDependencies)
int calculatePositionFromValue(C_FLOAT64 value)
void setOriginalValue(C_FLOAT64 value)
bool setSliderType(const CSlider::Type type)
void closeClicked(CopasiSlider *slider)
unsigned C_INT32 minorMajorFactor() const
void setMinorMajorFactor(unsigned C_INT32 factor)
static const QIcon & icon(const IconID &id)
const C_FLOAT64 & getSliderValue() const
void refreshInitialValues()
const C_FLOAT64 & getOriginalValue() const
C_FLOAT64 calculateValueFromPosition(int position)
void closeButtonClicked()
const C_FLOAT64 & getMaxValue() const
bool setTickNumber(const unsigned C_INT32 tickNumber)
void setMinValue(C_FLOAT64 value)
C_FLOAT64 minValue() const
unsigned C_INT32 numMinorTicks() const
void setObject(CCopasiObject *object)
C_FLOAT64 maxValue() const
bool setMinValue(const C_FLOAT64 minValue)
void setValue(C_FLOAT64 value)
unsigned C_INT32 getTickNumber() const
C_FLOAT64 originalValue() const
QToolButton * mpCloseButton
QToolButton * mpEditButton
const C_FLOAT64 & getMinValue() const
bool setSliderValue(const C_FLOAT64 value, const bool &writeToObject=true)
void setMaxValue(C_FLOAT64 value)
unsigned C_INT32 getTickFactor() const
void sliderValueChanged(int value)
CCopasiObject * getSliderObject()
CopasiSlider(CSlider *pSlider, DataModelGUI *pDM, QWidget *parent=0)