diff options
Diffstat (limited to 'clients/tde/src/widgets')
-rw-r--r-- | clients/tde/src/widgets/tracewidget.cpp | 15 | ||||
-rw-r--r-- | clients/tde/src/widgets/tracewidget.h | 3 |
2 files changed, 17 insertions, 1 deletions
diff --git a/clients/tde/src/widgets/tracewidget.cpp b/clients/tde/src/widgets/tracewidget.cpp index 6ce3fa2..f875571 100644 --- a/clients/tde/src/widgets/tracewidget.cpp +++ b/clients/tde/src/widgets/tracewidget.cpp @@ -1374,7 +1374,12 @@ void GraticuleWidget::mouseMoveEvent(TQMouseEvent *e) { #if 0 m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>%1<br>@%2,%3</qt>").arg(m_base->m_traceArray[trace]->traceName).arg(TraceWidget::prettyFormat(realCursorXPosition, horizontal_range, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits))); #else - m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>@%2,%3</qt>").arg(TraceWidget::prettyFormat(realCursorXPosition, (m_base->m_useAbsoluteHorizontalRange)?m_base->m_traceArray[trace]->rightEdge:horizontal_range, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits))); + if (m_base->m_useAbsoluteHorizontalRange) { + m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>@%2,%3</qt>").arg(TraceWidget::prettyFormat(realCursorXPosition, m_base->m_traceArray[trace]->rightEdge, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits))); + } + else { + m_base->m_traceArray[trace]->graphStatusLabel->setText(TQString("<qt><nobr>@%2[%3+%4],%5</qt>").arg(TraceWidget::prettyFormat(realCursorXPosition, m_base->m_traceArray[trace]->rightEdge, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(m_base->m_traceArray[trace]->leftEdge, m_base->m_traceArray[trace]->rightEdge, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorXPosition - m_base->m_traceArray[trace]->leftEdge, horizontal_range, m_base->m_traceArray[trace]->horizontalUnits)).arg(TraceWidget::prettyFormat(realCursorYPosition, vertical_range, m_base->m_traceArray[trace]->verticalUnits))); + } #endif m_base->m_traceArray[trace]->graphStatusLabelInner->setText(m_base->m_traceArray[trace]->graphStatusLabel->text()); } @@ -2469,6 +2474,14 @@ void TraceWidget::setTraceTextOffset(uint traceNumber, double offset) { setTraceOffset(traceNumber, offset, false); } +bool TraceWidget::horizontalRangeModeAbsolute() { + return m_useAbsoluteHorizontalRange; +} + +void TraceWidget::setHorizontalRangeModeAbsolute(bool absolute) { + m_useAbsoluteHorizontalRange = absolute; +} + void TraceWidget::setTraceTextOffset(uint traceNumber, double offset, bool deferUpdate) { VERIFY_TRACE_ARRAY_SIZE diff --git a/clients/tde/src/widgets/tracewidget.h b/clients/tde/src/widgets/tracewidget.h index 2f58891..7f63307 100644 --- a/clients/tde/src/widgets/tracewidget.h +++ b/clients/tde/src/widgets/tracewidget.h @@ -320,6 +320,9 @@ class TraceWidget : public TQWidget double traceTextOffset(uint traceNumber); void setTraceTextOffset(uint traceNumber, double offset, bool deferUpdate); + bool horizontalRangeModeAbsolute(); + void setHorizontalRangeModeAbsolute(bool absolute=true); + bool userIsInteractingWithCursor(); static TQString prettyFormat(double value, double rangeDetectValue, TQString baseUnits, unsigned int precision=3); |