summaryrefslogtreecommitdiffstats
path: root/clients/tde
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-16 01:19:24 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-07-16 01:19:24 -0500
commitad848a97a8c48b12faecb42bdb9b77c8aff937d9 (patch)
tree5a11a275dd7e415f31327c0a7a716f716cccc3fe /clients/tde
parent646a7accac7c2f0072770401312c2365865142ad (diff)
downloadulab-ad848a97a8c48b12faecb42bdb9b77c8aff937d9.tar.gz
ulab-ad848a97a8c48b12faecb42bdb9b77c8aff937d9.zip
Enhance cursor highlighting
Diffstat (limited to 'clients/tde')
-rw-r--r--clients/tde/src/widgets/tracewidget.cpp29
-rw-r--r--clients/tde/src/widgets/tracewidget.h3
2 files changed, 28 insertions, 4 deletions
diff --git a/clients/tde/src/widgets/tracewidget.cpp b/clients/tde/src/widgets/tracewidget.cpp
index 6754896..115169b 100644
--- a/clients/tde/src/widgets/tracewidget.cpp
+++ b/clients/tde/src/widgets/tracewidget.cpp
@@ -270,6 +270,11 @@ CursorData::CursorData(TraceWidget* parent, TQWidget* labelParent) : TQObject(),
singleDecrBtn->hide();
multiIncrBtn->hide();
multiDecrBtn->hide();
+ paramLabel->installEventFilter(this);
+ singleIncrBtn->installEventFilter(this);
+ singleDecrBtn->installEventFilter(this);
+ multiIncrBtn->installEventFilter(this);
+ multiDecrBtn->installEventFilter(this);
connect(singleIncrBtn, SIGNAL(clicked()), this, SLOT(movePosOneTick()));
connect(singleDecrBtn, SIGNAL(clicked()), this, SLOT(moveNegOneTick()));
connect(multiIncrBtn, SIGNAL(clicked()), this, SLOT(movePosMultiTicks()));
@@ -394,6 +399,26 @@ void CursorData::moveNegMultiTicks() {
parentWidget->m_graticuleWidget->repaint(true);
}
+bool CursorData::eventFilter(TQObject *o, TQEvent *e) {
+ // Intercept mouse entry/leave events for cursor labels and movement buttons
+ if ((o == paramLabel) || (o == singleIncrBtn) || (o == singleDecrBtn) || (o == multiIncrBtn) || (o == multiDecrBtn)) {
+ if (e->type() == TQEvent::Enter) {
+ highlighted = true;
+ parentWidget->updateCursorText();
+ parentWidget->m_graticuleWidget->updateGraticule();
+ parentWidget->m_graticuleWidget->repaint(true);
+ }
+ if (e->type() == TQEvent::Leave) {
+ highlighted = false;
+ parentWidget->updateCursorText();
+ parentWidget->m_graticuleWidget->updateGraticule();
+ parentWidget->m_graticuleWidget->repaint(true);
+ }
+ }
+ // Allow event processing by other routines
+ return FALSE;
+}
+
GraticuleWidget::GraticuleWidget(TraceWidget* parent, const char* name) : TQWidget(parent, name),
m_base(parent),
m_graticulePixmap(0),
@@ -622,10 +647,6 @@ void GraticuleWidget::mouseMoveEvent(TQMouseEvent *e) {
}
else {
setCursor(tqcrossCursor);
- if (m_base->m_cursorArray[m_closestCursor]->highlighted) {
- cursorHighlightChanged = true;
- }
- m_base->m_cursorArray[m_closestCursor]->highlighted = false;
}
}
diff --git a/clients/tde/src/widgets/tracewidget.h b/clients/tde/src/widgets/tracewidget.h
index 649077b..f3e093b 100644
--- a/clients/tde/src/widgets/tracewidget.h
+++ b/clients/tde/src/widgets/tracewidget.h
@@ -102,6 +102,9 @@ class CursorData : public TQObject
void movePosMultiTicks();
void moveNegMultiTicks();
+ protected:
+ virtual bool eventFilter(TQObject *o, TQEvent *e);
+
private:
TQColor color;
TQColor highlightColor;