00001
00002
00003 #ifndef FUNCTIONDIALOG_H
00004 #define FUNCTIONDIALOG_H
00005
00006 #include <klineedit.h>
00007 #include <qtoolbutton.h>
00008 #include <qcheckbox.h>
00009 #include <qcolor.h>
00010 #include "Dialog.h"
00011 #include "Worksheet.h"
00012 #include "GraphListDialog.h"
00013 #include "Graph2D.h"
00014
00015 class FunctionDialog: public Dialog
00016 {
00017 Q_OBJECT
00018 public:
00019 FunctionDialog(MainWin *mw, const char *name, ListDialog *l, int item, PType newtype);
00020 public slots:
00021 int addFunction();
00022 void updateLabel() { labelle->setText(funle->text()); }
00023
00024 void setFunction(QString fun) { funle->setText(fun); }
00025 void recreate(bool b=true) { reread->setChecked(b); }
00026 void setLabel(QString l=0) {
00027 if(l==0)
00028 updateLabel();
00029 else
00030 labelle->setText(l);
00031 }
00032 void setRange(double a, double b) { xmin->setText(QString::number(a)); xmax->setText(QString::number(b)); }
00034 void setYRange(double a, double b) { ymin->setText(QString::number(a)); ymax->setText(QString::number(b)); }
00036 void setPoints(int nr) { nx->setText(QString::number(nr)); }
00037 void setYPoints(int nr) { ny->setText(QString::number(nr)); }
00038
00039 int Apply() { return apply_clicked(); }
00040 private slots :
00041 int apply_clicked();
00042 void ok_clicked() { if (!apply_clicked()) accept(); }
00043 private:
00044 void findPlot();
00045 KLineEdit *funle, *labelle, *xmin, *xmax, *ymin, *ymax, *nx, *ny;
00046 QCheckBox *reread;
00047 ListDialog *l;
00048 int item;
00049 PType type;
00050 Graph *graph;
00051 };
00052 #endif //FUNCTIONDIALOG_H