|
|
|
@ -336,20 +336,22 @@ CursorData::~CursorData() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CursorData::drawCursor(TQPainter* p, int graticule_width, int graticule_height) {
|
|
|
|
|
if (highlighted) {
|
|
|
|
|
p->setPen(highlightColor.dark(parentWidget->m_cursorDarkness));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
p->setPen(color.dark(parentWidget->m_cursorDarkness));
|
|
|
|
|
}
|
|
|
|
|
if (enabled) {
|
|
|
|
|
if (highlighted) {
|
|
|
|
|
p->setPen(highlightColor.dark(parentWidget->m_cursorDarkness));
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
p->setPen(color.dark(parentWidget->m_cursorDarkness));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (orientation == TQt::Vertical) {
|
|
|
|
|
int x = abs(((position)/(100.0))*(graticule_width));
|
|
|
|
|
p->drawLine(x, 0, x, graticule_height);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int y = abs(((position)/(100.0))*(graticule_height));
|
|
|
|
|
p->drawLine(0, y, graticule_width, y);
|
|
|
|
|
if (orientation == TQt::Vertical) {
|
|
|
|
|
int x = abs(((position)/(100.0))*(graticule_width));
|
|
|
|
|
p->drawLine(x, 0, x, graticule_height);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
int y = abs(((position)/(100.0))*(graticule_height));
|
|
|
|
|
p->drawLine(0, y, graticule_width, y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -603,6 +605,7 @@ void GraticuleWidget::mouseReleaseEvent(TQMouseEvent *e) {
|
|
|
|
|
if (m_base->m_cursorArray[m_movingCursor]->position > 100.0) {
|
|
|
|
|
m_base->m_cursorArray[m_movingCursor]->position = 100.0;
|
|
|
|
|
}
|
|
|
|
|
emit(cursorPositionChanged(m_movingCursor, m_base->m_cursorArray[m_movingCursor]->position));
|
|
|
|
|
m_movingCursor = -1;
|
|
|
|
|
updateGraticule();
|
|
|
|
|
repaint(false);
|
|
|
|
@ -770,6 +773,7 @@ void GraticuleWidget::mouseMoveEvent(TQMouseEvent *e) {
|
|
|
|
|
if (m_base->m_cursorArray[m_movingCursor]->position > 100.0) {
|
|
|
|
|
m_base->m_cursorArray[m_movingCursor]->position = 100.0;
|
|
|
|
|
}
|
|
|
|
|
emit(cursorPositionChanged(m_movingCursor, m_base->m_cursorArray[m_movingCursor]->position));
|
|
|
|
|
updateGraticule();
|
|
|
|
|
repaint(false);
|
|
|
|
|
cursorHighlightChanged = false;
|
|
|
|
@ -811,6 +815,7 @@ TraceWidget::TraceWidget(TQWidget* parent, const char* name) : TQWidget(parent,
|
|
|
|
|
|
|
|
|
|
m_primaryLayout = new TQGridLayout(this);
|
|
|
|
|
m_graticuleWidget = new GraticuleWidget(this);
|
|
|
|
|
connect(m_graticuleWidget, SIGNAL(cursorPositionChanged(uint, double)), this, SLOT(processChangedCursor(uint, double)));
|
|
|
|
|
m_primaryLayout->addMultiCellWidget(m_graticuleWidget, 0, 254, 0, 254);
|
|
|
|
|
m_rightPaneLayout = new TQGridLayout;
|
|
|
|
|
m_traceLabelLayout = new TQGridLayout;
|
|
|
|
@ -1139,6 +1144,7 @@ void TraceWidget::setCursorPosition(uint cursorNumber, double position) {
|
|
|
|
|
if (position > 100.0) position = 100.0;
|
|
|
|
|
|
|
|
|
|
m_cursorArray[cursorNumber]->position = position;
|
|
|
|
|
emit(cursorPositionChanged(cursorNumber, m_cursorArray[cursorNumber]->position));
|
|
|
|
|
updateCursorText();
|
|
|
|
|
m_graticuleWidget->updateGraticule();
|
|
|
|
|
m_graticuleWidget->repaint(false);
|
|
|
|
@ -1376,18 +1382,22 @@ void TraceWidget::setZoomCursorBox(const TQRectF rect) {
|
|
|
|
|
// If two of each cannot be found, return TQRectF()
|
|
|
|
|
CursorData* horiz[2];
|
|
|
|
|
CursorData* vert[2];
|
|
|
|
|
uint horizIndex[2];
|
|
|
|
|
uint vertIndex[2];
|
|
|
|
|
int j = 0;
|
|
|
|
|
int k = 0;
|
|
|
|
|
for (i=m_zoomCursorStartIndex;i<m_cursorArray.count(); i++) {
|
|
|
|
|
if (m_cursorArray[i]->orientation == TQt::Horizontal) {
|
|
|
|
|
if (j<2) {
|
|
|
|
|
vert[j] = m_cursorArray[i];
|
|
|
|
|
vertIndex[j] = i;
|
|
|
|
|
j++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if (k<2) {
|
|
|
|
|
horiz[k] = m_cursorArray[i];
|
|
|
|
|
horizIndex[j] = i;
|
|
|
|
|
k++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1398,9 +1408,13 @@ void TraceWidget::setZoomCursorBox(const TQRectF rect) {
|
|
|
|
|
if ((j>1) && (k>1)) {
|
|
|
|
|
// Set cursors...
|
|
|
|
|
vert[0]->position = boundedRect.y();
|
|
|
|
|
emit(cursorPositionChanged(vertIndex[0], m_cursorArray[vertIndex[0]]->position));
|
|
|
|
|
vert[1]->position = boundedRect.height();
|
|
|
|
|
emit(cursorPositionChanged(vertIndex[1], m_cursorArray[vertIndex[1]]->position));
|
|
|
|
|
horiz[0]->position = boundedRect.x();
|
|
|
|
|
emit(cursorPositionChanged(horizIndex[0], m_cursorArray[horizIndex[0]]->position));
|
|
|
|
|
horiz[1]->position = boundedRect.width();
|
|
|
|
|
emit(cursorPositionChanged(horizIndex[1], m_cursorArray[horizIndex[1]]->position));
|
|
|
|
|
|
|
|
|
|
updateCursorText();
|
|
|
|
|
m_graticuleWidget->updateGraticule();
|
|
|
|
@ -1514,6 +1528,10 @@ void TraceWidget::processChangedOffset(double offset) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TraceWidget::processChangedCursor(uint cursorNumber, double newPosition) {
|
|
|
|
|
emit(cursorPositionChanged(cursorNumber, newPosition));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void TraceWidget::resizeTraceArray(uint newsize) {
|
|
|
|
|
uint oldcount = m_traceArray.count();
|
|
|
|
|
|
|
|
|
|