Skip to content
Snippets Groups Projects
Commit 11351324 authored by Matthew D Jones's avatar Matthew D Jones
Browse files

Re #11422 Enable "n=" GUI element when power scale type selected

parent f2312c5e
No related branches found
No related tags found
No related merge requests found
......@@ -403,6 +403,7 @@ void ScaleDetails::initWidgets()
m_spnMajorValue->setValue(lst.count());
checkstep();
checkscaletype();
connect(m_grpAxesBreaks,SIGNAL(clicked()), this, SLOT(setModified()));
connect(m_chkInvert,SIGNAL(clicked()), this, SLOT(setModified()));
......@@ -415,8 +416,10 @@ void ScaleDetails::initWidgets()
connect(m_cmbMinorValue,SIGNAL(currentIndexChanged(int)), this, SLOT(setModified()));
connect(m_cmbUnit,SIGNAL(currentIndexChanged(int)), this, SLOT(setModified()));
connect(m_cmbScaleType,SIGNAL(currentIndexChanged(int)), this, SLOT(setModified()));
connect(m_cmbScaleType,SIGNAL(currentIndexChanged(int)), this, SLOT(checkscaletype()));
connect(m_dspnEnd, SIGNAL(valueChanged(double)), this, SLOT(setModified()));
connect(m_dspnStart, SIGNAL(valueChanged(double)), this, SLOT(setModified()));
connect(m_dspnN, SIGNAL(valueChanged(double)), this, SLOT(setModified()));
connect(m_dspnStep, SIGNAL(valueChanged(double)), this, SLOT(setModified()));
connect(m_dspnBreakStart, SIGNAL(valueChanged(double)), this, SLOT(setModified()));
connect(m_dspnStepBeforeBreak, SIGNAL(valueChanged(double)), this, SLOT(setModified()));
......@@ -632,6 +635,22 @@ void ScaleDetails::checkstep()
}
}
/*
* Enable the "n =" widget if X^n scale type is selected
*/
void ScaleDetails::checkscaletype()
{
// If "power X^n" scale option is selected
if (m_cmbScaleType->currentIndex() == 2)
{
m_dspnN->setEnabled(true);
}
else
{
m_dspnN->setEnabled(false);
}
}
/**
* Recalculates the minimum value allowed in step to stop too many labels being rendered
*/
......
......@@ -67,6 +67,7 @@ private slots:
void radiosSwitched();
void setModified();
void recalcStepMin();
void checkscaletype();
private:
bool m_modified, m_initialised;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment