[Kst] kdeextragear-2/kst/kst
Rick Chern
rchern at interchange.ubc.ca
Wed Aug 11 20:52:32 CEST 2004
CVS commit by rchern:
Show image coordinates in data mode even if there is a curve on top
M +22 -24 kst2dplot.cpp 1.218
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.217:1.218
@@ -2195,4 +2195,5 @@ void Kst2DPlot::highlightNearestDataPoin
}
+ QString msg = QString::null;
if (curve.data()) {
if (_copy_x != newxpos || _copy_y != newypos) {
@@ -2206,13 +2207,12 @@ void Kst2DPlot::highlightNearestDataPoin
p.setClipRegion(_lastClipRegion);
drawDotAt(p, newxpos, newypos);
-
- QString msg = i18n("%3 (%1, %2)").arg(newxpos).arg(newypos,0,'G').arg(curve->tagName());
- KstApp::inst()->slotUpdateDataMsg(msg);
}
+ msg = i18n("%3 (%1, %2)").arg(newxpos).arg(newypos,0,'G').arg(curve->tagName());
} else {
_copy_x = KST::NOPOINT;
_copy_y = KST::NOPOINT;
- //if no curves to display points for, display the z value of the topmost image
- //underneath cursor
+ static_cast<KstViewWidget*>(view)->paint();
+ }
+ //display the z value of the topmost image underneath cursor, if available
if (_images.count() > 0) {
double Z;
@@ -2225,17 +2225,15 @@ void Kst2DPlot::highlightNearestDataPoin
i--;
}
- static_cast<KstViewWidget*>(view)->paint();
if (found) {
- QString msg = i18n("%4 (%1, %2, %3)").arg(xpos).arg(ypos).arg(Z).arg(_images[i+1]->tagName());
- KstApp::inst()->slotUpdateDataMsg(msg);
+ QString comma;
+ if (msg.isEmpty()) {
+ comma = QString::null;
} else {
- KstApp::inst()->slotUpdateDataMsg(QString::null);
+ comma = ", ";
}
- } else {
- static_cast<KstViewWidget*>(view)->paint();
- KstApp::inst()->slotUpdateDataMsg(QString::null);
+ msg += comma + QString("%4 (%1, %2, %3)").arg(xpos).arg(ypos).arg(Z).arg(_images[i+1]->tagName());
}
}
-
+ KstApp::inst()->slotUpdateDataMsg(msg);
_highlighting = false;
}
More information about the Kst
mailing list