[Kst] kdeextragear-2/kst/kst
Andrew Walker
arwalker at sumusltd.com
Fri May 14 02:50:48 CEST 2004
CVS commit by arwalker:
Continue with fit dialog
M +10 -5 kst2dplot.cpp 1.16
M +17 -1 kstfitdialog_i.cpp 1.3
M +5 -0 kstfitdialog_i.h 1.2
--- kdeextragear-2/kst/kst/kst2dplot.cpp #1.15:1.16
@@ -35,5 +35,5 @@
#include "kstdatacollection.h"
#include "kstcurvedialog_i.h"
-
+#include "kstfitdialog_i.h"
Kst2DPlot::Kst2DPlot(const QString &in_tag,
@@ -1643,4 +1643,6 @@ void Kst2DPlot::fitCurve( int id )
strCurve = _pMenuFitCurve->text( id );
if( !strCurve.isEmpty() ) {
+ KstFitDialogI::globalInstance()->setCurve(strCurve);
+ KstFitDialogI::globalInstance()->show_I();
}
}
@@ -1664,5 +1666,5 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
}
for (i = 0; i < n_curves; i++) {
- _pMenuEditCurve->insertItem( Curves[i]->tagLabel(), i );
+ _pMenuEditCurve->insertItem( Curves[i]->tagName(), i );
_pMenuEditCurve->connectItem( i, this, SLOT( editCurve(int) ) );
}
@@ -1678,7 +1680,10 @@ bool Kst2DPlot::popupMenu(KPopupMenu *me
}
for (i = 0; i < n_curves; i++) {
- _pMenuFitCurve->insertItem( Curves[i]->tagLabel(), i );
+ KstVCurve* curve = dynamic_cast<KstVCurve*>(Curves[i].data());
+ if( curve ) {
+ _pMenuFitCurve->insertItem( curve->tagName(), i );
_pMenuFitCurve->connectItem( i, this, SLOT( fitCurve(int) ) );
}
+ }
menu->insertItem( i18n("Fit"), _pMenuFitCurve );
}
--- kdeextragear-2/kst/kst/kstfitdialog_i.cpp #1.2:1.3
@@ -17,4 +17,5 @@
#include "kstfitdialog_i.h"
+#include "kstvcurve.h"
#include <qcheckbox.h>
@@ -33,4 +34,5 @@
#include <qwhatsthis.h>
#include <qwidget.h>
+#include <qmessagebox.h>
#include <kcolorbutton.h>
@@ -99,4 +101,17 @@ void KstFitDialogI::show_I(const QString
+void KstFitDialogI::setCurve(const QString& strCurve) {
+ KstVCurvePtr curve;
+ KstVCurveList curves = kstObjectSubList<KstDataObject, KstVCurve>(KST::dataObjectList);
+
+ if (curves.findTag(strCurve) != curves.end()) {
+ curve = *(curves.findTag(strCurve));
+ _xvector = curve->getXVTag();
+ _yvector = curve->getYVTag();
+ _evector = curve->getYETag();
+ }
+}
+
+
void KstFitDialogI::updatePluginList() {
PluginCollection *pc = PluginCollection::self();
@@ -173,4 +188,5 @@ void KstFitDialogI::updatePlugin(int new
int oldSelect = Select->currentItem();
int oldCount = Select->count();
+ int iVector = 0;
KstPluginList pl = kstObjectSubList<KstDataObject, KstPlugin>(KST::dataObjectList);
--- kdeextragear-2/kst/kst/kstfitdialog_i.h #1.1:1.2
@@ -36,4 +36,5 @@ public slots:
void update(int new_index = -1);
void updatePlugin(int new_index = -1);
+ void setCurve(const QString& strCurve);
/** Calls update(), then shows/raises the dialog */
@@ -58,4 +59,8 @@ private:
QStringList _pluginList;
QWidget *_frameWidget;
+ QString _xvector;
+ QString _yvector;
+ QString _evector;
+
static KstFitDialogI* _inst;
More information about the Kst
mailing list