[Kst] kdeextragear-2/kst/kst

Rick Chern rchern at interchange.ubc.ca
Tue Aug 3 20:14:29 CEST 2004


CVS commit by rchern: 

Use Insert to insert a plot marker at current cursor position


  M +13 -13    kst2dplot.cpp   1.193


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.192:1.193
@@ -2651,16 +2651,5 @@ void Kst2DPlot::mousePressEvent(QWidget 
   } else if (e->button() == Qt::MidButton) {
     win_rect = GetWinRegion();
-    plot_rect = GetPlotRegion();
-    if (plot_rect.contains(e->pos())) {
-      if (_xLog) {
-        setPlotMarker(pow(10,((e->pos().x() - position().x() - _b_X) / _m_X)));
-      } else {
-        setPlotMarker((e->pos().x() - position().x() - _b_X) / _m_X);
-      }
-      setDirty();
-      emit modified();
-      static_cast<KstViewWidget*>(view)->paint();
-      return;
-    } else if (win_rect.contains(e->pos())) {
+    if (win_rect.contains(e->pos())) {
       _mouse.mode = INACTIVE;
       _mouse.pressLocation = e->pos();
@@ -3416,4 +3404,5 @@ void Kst2DPlot::keyPressEvent(QWidget *v
   ButtonState s = e->stateAfter();
   KstViewWidget *view = static_cast<KstViewWidget*>(vw);
+  QPoint cursorPos = view->mapFromGlobal(QCursor::pos());
   switch (e->key()) {
     case Key_A:
@@ -3482,4 +3471,15 @@ void Kst2DPlot::keyPressEvent(QWidget *v
       }
       break;
+    case Key_Insert:
+      if (GetPlotRegion().contains(cursorPos)) {
+        if (_xLog) {
+          setPlotMarker(pow(10,((cursorPos.x() - position().x() - _b_X) / _m_X)));
+        } else {
+          setPlotMarker((cursorPos.x() - position().x() - _b_X) / _m_X);
+        }
+        setDirty();
+        emit modified();
+      }
+      break;
     default:
       handled = false;





More information about the Kst mailing list