Skip to content

Commit

Permalink
Re #11422 Add warning message to GUI about axis range
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthew D Jones authored and Matthew D Jones committed Aug 12, 2015
1 parent e95efbc commit 565d3d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion Code/Mantid/MantidPlot/src/ScaleDetails.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ ScaleDetails::ScaleDetails(ApplicationWindow* app, Graph* graph, int mappedaxis,
middleLayout->addWidget(m_lblN, 3, 0);
middleLayout->addWidget(m_dspnN, 3, 1);

m_lblWarn = new QLabel(tr("Ensure axis and data ranges are\ncompatible with chosen axis scale."));
middleLayout->addWidget(m_lblWarn, 4, 0, 1, 2);
m_lblWarn->setVisible(false);

m_chkInvert = new QCheckBox();
m_chkInvert->setText(tr("Inverted"));
m_chkInvert->setChecked(false);
Expand Down Expand Up @@ -638,18 +642,21 @@ void ScaleDetails::checkstep()
}

/*
* Enable the "n =" widget if X^n scale type is selected
* Enable the "n =" widget and display warning message
* if power scale type is selected
*/
void ScaleDetails::checkscaletype()
{
// If "power X^n" scale option is selected
if (m_cmbScaleType->currentIndex() == 2)
{
m_dspnN->setEnabled(true);
m_lblWarn->setVisible(true);
}
else
{
m_dspnN->setEnabled(false);
m_lblWarn->setVisible(false);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Code/Mantid/MantidPlot/src/ScaleDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private slots:
QSpinBox *m_spnMajorValue, *m_spnBreakPosition, *m_spnBreakWidth;
QGroupBox *m_grpAxesBreaks;
QComboBox *m_cmbMinorTicksBeforeBreak, *m_cmbMinorTicksAfterBreak, *m_cmbScaleType, *m_cmbMinorValue, *m_cmbUnit;
QLabel *m_lblScaleTypeLabel, *m_lblMinorBox, *m_lblStart, *m_lblEnd, *m_lblN;
QLabel *m_lblScaleTypeLabel, *m_lblMinorBox, *m_lblStart, *m_lblEnd, *m_lblN, *m_lblWarn;
QDateTimeEdit *m_dteStartDateTime, *m_dteEndDateTime;
QTimeEdit *m_timStartTime, *m_timEndTime;

Expand Down

0 comments on commit 565d3d4

Please sign in to comment.