17 #include <QtGui/QValidator>
66 for (i = 0; i < iMax; ++i)
85 mpObjectNameLineEdit->setText(
"Object not avalable!");
94 mpObjectNameLineEdit->setText(
"NULL");
95 mpObjectBrowseButton->show();
110 mpObjectValueEdit->setText(QString::number(
mValue));
116 mpMinValueEdit->setText(QString::number(
mMinValue));
119 mpMaxValueEdit->setText(QString::number(
mMaxValue));
131 mpLogCheckBox->setChecked(
true);
135 mpLogCheckBox->setChecked(
false);
145 mpObjectNameLineEdit->setEnabled(
false);
146 mpMaxValueEdit->setEnabled(
true);
147 mpMinValueEdit->setEnabled(
true);
148 mpMinorMajorFactorEdit->setEnabled(
true);
149 mpMinorTickSizeEdit->setEnabled(
true);
150 mpNumMinorTicksEdit->setEnabled(
true);
151 mpObjectValueEdit->setEnabled(
true);
152 mpLogCheckBox->setEnabled(
true);
153 mpOriginalValueEdit->setEnabled(
true);
157 mpObjectNameLineEdit->setEnabled(
true);
158 mpMaxValueEdit->setEnabled(
false);
159 mpMinValueEdit->setEnabled(
false);
160 mpMinorMajorFactorEdit->setEnabled(
false);
161 mpMinorTickSizeEdit->setEnabled(
false);
162 mpNumMinorTicksEdit->setEnabled(
false);
163 mpObjectValueEdit->setEnabled(
false);
164 mpOriginalValueEdit->setEnabled(
false);
165 mpLogCheckBox->setEnabled(
false);
175 disconnect(mpMinValueEdit, 0, 0, 0);
176 disconnect(mpMaxValueEdit, 0, 0, 0);
180 done(QDialog::Accepted);
234 double value = mpMinValueEdit->text().toDouble();
238 "The minimum value you set is larger than the default value of the slider. The new default will be set to the minimum. Do you want to procceed?",
239 QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel) != QMessageBox::Ok)
242 mpMinValueEdit->setText(QString::number(
mMinValue));
253 mpMaxValueEdit->setText(QString::number(
mMaxValue));
259 mpObjectValueEdit->setText(QString::number(
mValue));
265 if (mMinValue <= 0.0 && mpLogCheckBox->isChecked())
268 "For logarithmic sliders, the minimum value may not be 0.0 or negative. Please set the minimum value to some (possibly very small) positive number first.",
269 QMessageBox::Ok, QMessageBox::Ok);
270 mpLogCheckBox->setChecked(
false);
282 double value = mpMaxValueEdit->text().toDouble();
287 "The maximum value you set is smaller than the default value of the slider. The new default will be set to the maximum. Do you want to procceed?",
288 QMessageBox::Ok | QMessageBox::Cancel, QMessageBox::Cancel) != QMessageBox::Ok)
290 mpMaxValueEdit->setText(QString::number(
mMaxValue));
304 mpMinValueEdit->setText(QString::number(
mMinValue));
310 mpObjectValueEdit->setText(QString::number(
mValue));
322 mValue = mpObjectValueEdit->text().toDouble();
327 mpMaxValueEdit->setText(QString::number(
mMaxValue));
333 mpMinValueEdit->setText(QString::number(
mMinValue));
352 mpExtendedOptionsButton->setText(
"Advanced >>");
354 this->setFixedSize(minimumSizeHint());
355 mpObjectValueEdit->setValidator(
new QDoubleValidator(
this));
356 mpOriginalValueEdit->setValidator(
new QDoubleValidator(
this));
357 mpMinValueEdit->setValidator(
new QDoubleValidator(
this));
358 mpMaxValueEdit->setValidator(
new QDoubleValidator(
this));
359 mpMinorTickSizeEdit->setValidator(
new QDoubleValidator(
this));
360 QIntValidator* v =
new QIntValidator(
this);
362 mpNumMinorTicksEdit->setValidator(v);
363 v =
new QIntValidator(
this);
365 mpMinorMajorFactorEdit->setValidator(v);
381 "You chose an object that does not correspond to an integer or float value. Please choose an object that corresponds to an integet or float value.",
382 QMessageBox::Ok, QMessageBox::Ok);
384 mpObjectNameLineEdit->setText(
"");
396 "You chose an object that cannot be used as a slider. Please choose an other object.",
397 QMessageBox::Ok, QMessageBox::Ok);
399 mpObjectNameLineEdit->setText(
"");
428 for (i = 0; i < iMax; ++i)
458 mpObjectBrowseButton->setHidden(disableChoosing);
467 if (mMinValue < mpSlider->getMaxValue())
488 if (mpExtendedOptionsButton->text() ==
"Advanced >>")
490 mpExtendedOptionsButton->setText(
"Advanced <<");
492 this->setFixedSize(minimumSizeHint());
496 mpExtendedOptionsButton->setText(
"Advanced >>");
498 int heightChange = mpOptionsGridLayout->geometry().height();
499 QSize size = this->size() - QSize(0, heightChange);
500 this->setFixedSize(size);
515 "For logarithmic sliders, the minimum value may not be 0.0 or negative. Please set the minimum value to some (possibly very small) positive number first.",
516 QMessageBox::Ok, QMessageBox::Ok);
517 mpLogCheckBox->setChecked(
false);
575 mpMaxValueEdit->setText(QString::number(
mMaxValue));
581 mpMinValueEdit->setText(QString::number(
mMinValue));
624 mpNumMinorTicksLabel->show();
625 mpNumMinorTicksEdit->show();
626 mpMinorTickSizeLabel->show();
627 mpMinorTickSizeEdit->show();
629 mpMinorMajorFactorLabel->show();
630 mpMinorMajorFactorEdit->show();
631 mpOriginalValueLabel->show();
632 mpOriginalValueEdit->show();
634 mpObjectValueLabel->show();
635 mpObjectValueEdit->show();
640 mpNumMinorTicksLabel->hide();
641 mpNumMinorTicksEdit->hide();
642 mpMinorTickSizeLabel->hide();
643 mpMinorTickSizeEdit->hide();
645 mpMinorMajorFactorLabel->hide();
646 mpMinorMajorFactorEdit->hide();
647 mpOriginalValueLabel->hide();
648 mpOriginalValueEdit->hide();
650 mpObjectValueLabel->hide();
651 mpObjectValueEdit->hide();
CCopasiContainer * getObjectAncestor(const std::string &type) const
virtual void minValueChanged()
virtual void numMinorTicksChanged()
unsigned int mNumMinorTicks
virtual std::string getObjectDisplayName(bool regular=true, bool richtext=false) const
virtual void maxValueTextChanged()
bool setScaling(Scale scaling)
virtual void cancelButtonPressed()
virtual void numTicksTextChanged()
bool setSliderObject(CCopasiObject *pObject)
SliderSettingsDialog(QWidget *pParent=NULL)
void updateInputFieldsValues()
virtual void tickFactorTextChanged()
bool setOriginalValue(const C_FLOAT64 value)
virtual void setSlider(CSlider *slider)
bool setMaxValue(const C_FLOAT64 maxValue)
void showOptionsControls()
static StandardButton information(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
virtual void okButtonPressed()
virtual void valueTextChanged()
bool setTickFactor(const unsigned C_INT32 tickFactor)
std::vector< CSlider * > mDefinedSliders
virtual const std::string & getKey() const
void hideOptionsControls()
virtual void minorTickSizeChanged()
virtual void setDefinedSliders(std::vector< CSlider * > sliderVect)
virtual void maxValueChanged()
bool setAssociatedEntityKey(const std::string &associatedEntityKey)
virtual void origValueTextChanged()
static const QIcon & icon(const IconID &id)
const C_FLOAT64 & getSliderValue() const
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
virtual void setModel(CModel *model)
const C_FLOAT64 & getOriginalValue() const
virtual void originalValueChanged()
virtual void browseButtonPressed()
const C_FLOAT64 & getMaxValue() const
bool setTickNumber(const unsigned C_INT32 tickNumber)
virtual ~SliderSettingsDialog()
virtual void logCheckBoxToggled(bool on)
unsigned int mMinorMajorFactor
virtual void minorMajorFactorChanged()
virtual void globalCheckBoxToggled()
virtual void updateSlider()
virtual void disableObjectChoosing(bool disableChoosing)
bool setMinValue(const C_FLOAT64 minValue)
virtual void objectValueChanged()
virtual CSlider * getSlider()
unsigned C_INT32 getTickNumber() const
virtual void tickSizeTextChanged()
virtual void minValueTextChanged()
const C_FLOAT64 & getMinValue() const
bool setSliderValue(const C_FLOAT64 value, const bool &writeToObject=true)
virtual void extendedOptionsClicked()
unsigned C_INT32 getTickFactor() const
void updateInternalValues()
static const CCopasiObject * getObjectSingle(QWidget *pParent, const CQSimpleSelectionTree::ObjectClasses &classes, const CCopasiObject *pCurrentObject=NULL)
static StandardButton question(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
CCopasiObject * getSliderObject()