00001 /*************************************************************************** 00002 File : MatrixValuesDialog.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2006 by Ion Vasilief, 00006 Knut Franke 00007 Email (use @ for *) : ion_vasilief*yahoo.fr, knut.franke*gmx.de 00008 Description : Set matrix values dialog 00009 00010 ***************************************************************************/ 00011 00012 /*************************************************************************** 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 * This program is distributed in the hope that it will be useful, * 00020 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00021 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00022 * GNU General Public License for more details. * 00023 * * 00024 * You should have received a copy of the GNU General Public License * 00025 * along with this program; if not, write to the Free Software * 00026 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00027 * Boston, MA 02110-1301 USA * 00028 * * 00029 ***************************************************************************/ 00030 #ifndef MVALUESDIALOG_H 00031 #define MVALUESDIALOG_H 00032 00033 #include <QDialog> 00034 #include "ScriptingEnv.h" 00035 #include "Script.h" 00036 #include "ScriptEdit.h" 00037 #include "Matrix.h" 00038 00039 class QComboBox; 00040 class QTextEdit; 00041 class QSpinBox; 00042 class QPushButton; 00043 class ScriptEdit; 00044 class Matrix; 00045 00047 class MatrixValuesDialog : public QDialog, public scripted 00048 { 00049 Q_OBJECT 00050 00051 public: 00052 MatrixValuesDialog( ScriptingEnv *env, QWidget* parent = 0, Qt::WFlags fl = 0 ); 00053 void setMatrix(Matrix *m); 00054 00055 private slots: 00056 bool apply(); 00057 void addCell(); 00058 void insertFunction(); 00059 void insertExplain(int index); 00060 00061 private: 00062 Matrix *matrix; 00063 00064 QSize sizeHint() const ; 00065 void customEvent( QEvent *e); 00066 00067 ScriptEdit* commands; 00068 QComboBox* functions; 00069 QPushButton* btnAddFunction; 00070 QPushButton* btnAddCell; 00071 QPushButton* btnCancel; 00072 QTextEdit* explain; 00073 QSpinBox *startRow, *endRow, *startCol, *endCol; 00074 QPushButton *btnApply; 00075 }; 00076 00077 #endif //