00001 /*************************************************************************** 00002 File : FunctionDialog.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2006 - 2009 by Ion Vasilief 00006 Email (use @ for *) : ion_vasilief*yahoo.fr 00007 Description : Function dialog 00008 00009 ***************************************************************************/ 00010 00011 /*************************************************************************** 00012 * * 00013 * This program is free software; you can redistribute it and/or modify * 00014 * it under the terms of the GNU General Public License as published by * 00015 * the Free Software Foundation; either version 2 of the License, or * 00016 * (at your option) any later version. * 00017 * * 00018 * This program is distributed in the hope that it will be useful, * 00019 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00020 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00021 * GNU General Public License for more details. * 00022 * * 00023 * You should have received a copy of the GNU General Public License * 00024 * along with this program; if not, write to the Free Software * 00025 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00026 * Boston, MA 02110-1301 USA * 00027 * * 00028 ***************************************************************************/ 00029 #ifndef FUNCTIONDIALOG_H 00030 #define FUNCTIONDIALOG_H 00031 00032 #include <Graph.h> 00033 00034 class QTableWidget; 00035 class QStackedWidget; 00036 class QWidget; 00037 class QLineEdit; 00038 class QComboBox; 00039 class QPushButton; 00040 class QSpinBox; 00041 class QLabel; 00042 class QTextEdit; 00043 class DoubleSpinBox; 00044 00046 class FunctionDialog : public QDialog 00047 { 00048 Q_OBJECT 00049 00050 public: 00051 FunctionDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); 00052 00053 protected slots: 00054 void raiseWidget(int index); 00055 void insertFunction(); 00056 void updateFunctionExplain(int); 00057 00058 public slots: 00059 void accept(); 00060 void acceptFunction(); 00061 void acceptParametric(); 00062 void acceptPolar(); 00063 void setCurveToModify(Graph *g, int curve); 00064 void insertParamFunctionsList(const QStringList& xList, const QStringList& yList); 00065 void insertPolarFunctionsList(const QStringList& rList, const QStringList& thetaList); 00066 void clearList(); 00067 void setGraph(Graph *g){graph = g;}; 00068 00069 signals: 00070 void clearParamFunctionsList(); 00071 void clearPolarFunctionsList(); 00072 00073 private: 00074 Graph *graph; 00075 int curveID; 00076 00077 QComboBox* boxXFunction; 00078 QComboBox* boxYFunction; 00079 QComboBox* boxPolarRadius; 00080 QComboBox* boxPolarTheta; 00081 QComboBox* boxType; 00082 QLabel* textFunction; 00083 DoubleSpinBox* boxFrom; 00084 DoubleSpinBox* boxTo; 00085 QLineEdit* boxParameter; 00086 QLineEdit* boxParFrom; 00087 QLineEdit* boxParTo; 00088 QLineEdit* boxPolarParameter; 00089 QLineEdit* boxPolarFrom; 00090 QLineEdit* boxPolarTo; 00091 QPushButton* buttonClear; 00092 QPushButton* buttonCancel; 00093 QPushButton* buttonOk; 00094 QSpinBox* boxPoints; 00095 QSpinBox* boxParPoints; 00096 QSpinBox* boxPolarPoints; 00097 QStackedWidget* optionStack; 00098 QTextEdit* boxFunction; 00099 QWidget* functionPage; 00100 QWidget* polarPage; 00101 QWidget* parametricPage; 00102 QTableWidget *boxConstants; 00103 QPushButton *addFunctionBtn; 00104 QComboBox* boxMathFunctions; 00105 QTextEdit* boxFunctionExplain; 00106 }; 00107 00108 #endif // FUNCTIONDIALOG_H