|
|
|
|
@ -206,7 +206,7 @@ void TraceData::movePosOneTick() {
|
|
|
|
|
emit(offsetChanged(offset));
|
|
|
|
|
|
|
|
|
|
parentWidget->updateTraceText();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TraceData::moveNegOneTick() {
|
|
|
|
|
@ -216,7 +216,7 @@ void TraceData::moveNegOneTick() {
|
|
|
|
|
emit(offsetChanged(offset));
|
|
|
|
|
|
|
|
|
|
parentWidget->updateTraceText();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TraceData::resetVPosition() {
|
|
|
|
|
@ -224,7 +224,7 @@ void TraceData::resetVPosition() {
|
|
|
|
|
emit(offsetChanged(offset));
|
|
|
|
|
|
|
|
|
|
parentWidget->updateTraceText();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CursorData::CursorData(TraceWidget* parent, TQWidget* labelParent) : TQObject(), parentWidget(parent) {
|
|
|
|
|
@ -330,7 +330,7 @@ void CursorData::movePosOneTick() {
|
|
|
|
|
|
|
|
|
|
parentWidget->updateCursorText();
|
|
|
|
|
parentWidget->m_graticuleWidget->updateGraticule();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CursorData::moveNegOneTick() {
|
|
|
|
|
@ -352,7 +352,7 @@ void CursorData::moveNegOneTick() {
|
|
|
|
|
|
|
|
|
|
parentWidget->updateCursorText();
|
|
|
|
|
parentWidget->m_graticuleWidget->updateGraticule();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CursorData::movePosMultiTicks() {
|
|
|
|
|
@ -374,7 +374,7 @@ void CursorData::movePosMultiTicks() {
|
|
|
|
|
|
|
|
|
|
parentWidget->updateCursorText();
|
|
|
|
|
parentWidget->m_graticuleWidget->updateGraticule();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CursorData::moveNegMultiTicks() {
|
|
|
|
|
@ -396,7 +396,7 @@ void CursorData::moveNegMultiTicks() {
|
|
|
|
|
|
|
|
|
|
parentWidget->updateCursorText();
|
|
|
|
|
parentWidget->m_graticuleWidget->updateGraticule();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool CursorData::eventFilter(TQObject *o, TQEvent *e) {
|
|
|
|
|
@ -406,13 +406,13 @@ bool CursorData::eventFilter(TQObject *o, TQEvent *e) {
|
|
|
|
|
highlighted = true;
|
|
|
|
|
parentWidget->updateCursorText();
|
|
|
|
|
parentWidget->m_graticuleWidget->updateGraticule();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
if (e->type() == TQEvent::Leave) {
|
|
|
|
|
highlighted = false;
|
|
|
|
|
parentWidget->updateCursorText();
|
|
|
|
|
parentWidget->m_graticuleWidget->updateGraticule();
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(true);
|
|
|
|
|
parentWidget->m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// Allow event processing by other routines
|
|
|
|
|
@ -481,12 +481,13 @@ void GraticuleWidget::updateGraticule() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Repaint the widget
|
|
|
|
|
repaint();
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraticuleWidget::paintEvent(TQPaintEvent*) {
|
|
|
|
|
TQPainter p(this);
|
|
|
|
|
|
|
|
|
|
// Paint onto background pixmap before painting to window to reduce flickering
|
|
|
|
|
TQPixmap updatePixmap(width(), height());
|
|
|
|
|
TQPainter p(&updatePixmap);
|
|
|
|
|
if (m_graticulePixmap) {
|
|
|
|
|
// Draw the graticule pixmap to erase the widget
|
|
|
|
|
p.drawPixmap(0, 0, *m_graticulePixmap);
|
|
|
|
|
@ -504,6 +505,9 @@ void GraticuleWidget::paintEvent(TQPaintEvent*) {
|
|
|
|
|
else {
|
|
|
|
|
p.fillRect(x(), y(), width(), height(), backgroundColor());
|
|
|
|
|
}
|
|
|
|
|
p.end();
|
|
|
|
|
// Paint to window
|
|
|
|
|
bitBlt(this, 0, 0, &updatePixmap, 0, 0, updatePixmap.width(), updatePixmap.height(), TQt::CopyROP);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraticuleWidget::resizeEvent(TQResizeEvent *) {
|
|
|
|
|
@ -585,7 +589,7 @@ void GraticuleWidget::mouseReleaseEvent(TQMouseEvent *e) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updateGraticule();
|
|
|
|
|
repaint(true);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GraticuleWidget::mouseDoubleClickEvent(TQMouseEvent *) {
|
|
|
|
|
@ -704,7 +708,7 @@ void GraticuleWidget::mouseMoveEvent(TQMouseEvent *e) {
|
|
|
|
|
m_base->m_cursorArray[m_movingCursor]->position = 100.0;
|
|
|
|
|
}
|
|
|
|
|
updateGraticule();
|
|
|
|
|
repaint(true);
|
|
|
|
|
repaint(false);
|
|
|
|
|
cursorHighlightChanged = false;
|
|
|
|
|
}
|
|
|
|
|
else if (m_middleMouseDown) {
|
|
|
|
|
@ -716,7 +720,7 @@ void GraticuleWidget::mouseMoveEvent(TQMouseEvent *e) {
|
|
|
|
|
m_base->updateCursorText();
|
|
|
|
|
if (cursorHighlightChanged) {
|
|
|
|
|
updateGraticule();
|
|
|
|
|
repaint(true);
|
|
|
|
|
repaint(false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -829,7 +833,7 @@ void TraceWidget::setDisplayLimits(uint traceNumber, TQRectF limits) {
|
|
|
|
|
m_traceArray[traceNumber]->bottomEdge = limits.height();
|
|
|
|
|
|
|
|
|
|
m_graticuleWidget->updateGraticule();
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
updateTraceText();
|
|
|
|
|
updateCursorText();
|
|
|
|
|
}
|
|
|
|
|
@ -940,7 +944,7 @@ void TraceWidget::setSamples(uint traceNumber, TQDoubleArray& tqda) {
|
|
|
|
|
m_traceArray[traceNumber]->sampleArray = tqda;
|
|
|
|
|
m_traceArray[traceNumber]->numberOfSamples = tqda.size();
|
|
|
|
|
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQDoubleArray& TraceWidget::positions(uint traceNumber) {
|
|
|
|
|
@ -955,7 +959,7 @@ void TraceWidget::setPositions(uint traceNumber, TQDoubleArray& tqda) {
|
|
|
|
|
m_traceArray[traceNumber]->positionArray = tqda;
|
|
|
|
|
m_traceArray[traceNumber]->numberOfSamples = tqda.size();
|
|
|
|
|
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
TQColor TraceWidget::traceColor(uint traceNumber) {
|
|
|
|
|
@ -970,7 +974,7 @@ void TraceWidget::setTraceColor(uint traceNumber, TQColor color) {
|
|
|
|
|
m_traceArray[traceNumber]->color = color;
|
|
|
|
|
|
|
|
|
|
m_graticuleWidget->updateGraticule();
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
updateTraceText();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1003,7 +1007,7 @@ void TraceWidget::setTraceEnabled(uint traceNumber, bool enabled, bool showText)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_graticuleWidget->updateGraticule();
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
updateTraceText();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1061,7 +1065,7 @@ void TraceWidget::setCursorPosition(uint cursorNumber, double position) {
|
|
|
|
|
m_cursorArray[cursorNumber]->position = position;
|
|
|
|
|
updateCursorText();
|
|
|
|
|
m_graticuleWidget->updateGraticule();
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool TraceWidget::cursorEnabled(uint cursorNumber) {
|
|
|
|
|
@ -1287,7 +1291,7 @@ void TraceWidget::setZoomCursorBox(const TQRectF rect) {
|
|
|
|
|
|
|
|
|
|
updateCursorText();
|
|
|
|
|
m_graticuleWidget->updateGraticule();
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
@ -1369,7 +1373,7 @@ void TraceWidget::setTraceOffset(uint traceNumber, double offset) {
|
|
|
|
|
|
|
|
|
|
m_traceArray[traceNumber]->offset = offset;
|
|
|
|
|
|
|
|
|
|
m_graticuleWidget->repaint(true);
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
|
updateTraceText();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|