[Kst] kdeextragear-2/kst/kst

Andrew Walker arwalker at sumusltd.com
Thu May 13 03:06:53 CEST 2004


CVS commit by arwalker: 

Add edit curve functionality


  M +29 -4     kst2dplot.cpp   1.15
  M +3 -1      kst2dplot.h   1.8


--- kdeextragear-2/kst/kst/kst2dplot.cpp  #1.14:1.15
@@ -34,5 +34,5 @@
 #include "kstlinestyle.h"
 #include "kstdatacollection.h"
-
+#include "kstcurvedialog_i.h"
 
 
@@ -1624,4 +1624,27 @@ void Kst2DPlot::setTied(bool in_tied) {
 }
 
+void Kst2DPlot::editCurve( int id )
+{
+  QString strCurve;
+
+  if( _pMenuEditCurve ) {
+    strCurve = _pMenuEditCurve->text( id );
+    if( !strCurve.isEmpty() ) {
+      KstCurveDialogI::globalInstance()->show_I(strCurve);
+    }
+  }
+}
+
+void Kst2DPlot::fitCurve( int id )
+{
+  QString strCurve;
+
+  if( _pMenuFitCurve ) {
+    strCurve = _pMenuFitCurve->text( id );
+    if( !strCurve.isEmpty() ) {
+    }
+  }  
+}
+
 bool Kst2DPlot::popupMenu(KPopupMenu *menu, const QPoint& pos, KstViewObjectPtr topLevelParent) {
   _standardActions |= Delete;
@@ -1641,5 +1664,6 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
       }
       for (i = 0; i < n_curves; i++) {
-        _pMenuEditCurve->insertItem( Curves[i]->tagLabel() );
+        _pMenuEditCurve->insertItem( Curves[i]->tagLabel(), i );
+        _pMenuEditCurve->connectItem( i, this, SLOT( editCurve(int) ) );
       }
       menu->insertItem( i18n("Edit"), _pMenuEditCurve );
@@ -1654,5 +1678,6 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
       }
       for (i = 0; i < n_curves; i++) {
-        _pMenuFitCurve->insertItem( Curves[i]->tagLabel() );
+        _pMenuFitCurve->insertItem( Curves[i]->tagLabel(), i );
+        _pMenuFitCurve->connectItem( i, this, SLOT( fitCurve(int) ) );
       }
       menu->insertItem( i18n("Fit"), _pMenuFitCurve );

--- kdeextragear-2/kst/kst/kst2dplot.h  #1.7:1.8
@@ -137,4 +137,6 @@ public slots:
   virtual void paint(QPainter& p);
   virtual void paint(QPainter& p, double X_LeftBorder);
+  void editCurve( int id );
+  void fitCurve( int id );
 
 protected:





More information about the Kst mailing list