QtiPlot 0.9.8.2
|
00001 /*************************************************************************** 00002 File : ContourLinesEditor.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2009 by Ion Vasilief 00006 Email (use @ for *) : ion_vasilief*yahoo.fr 00007 Description : A Contour Lines Editor Widget 00008 ***************************************************************************/ 00009 00010 /*************************************************************************** 00011 * * 00012 * This program is free software; you can redistribute it and/or modify * 00013 * it under the terms of the GNU General Public License as published by * 00014 * the Free Software Foundation; either version 2 of the License, or * 00015 * (at your option) any later version. * 00016 * * 00017 * This program is distributed in the hope that it will be useful, * 00018 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00019 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00020 * GNU General Public License for more details. * 00021 * * 00022 * You should have received a copy of the GNU General Public License * 00023 * along with this program; if not, write to the Free Software * 00024 * Foundation, Inc., 51 Franklin Street, Fifth Floor, * 00025 * Boston, MA 02110-1301 USA * 00026 * * 00027 ***************************************************************************/ 00028 #ifndef CONTOURLINESEDITOR_H 00029 #define CONTOURLINESEDITOR_H 00030 00031 #include <QWidget> 00032 #include <QLocale> 00033 00034 class QPushButton; 00035 class QTableWidget; 00036 class QCheckBox; 00037 class DoubleSpinBox; 00038 class Spectrogram; 00039 class ColorButton; 00040 class PenStyleBox; 00041 00043 00049 class ContourLinesEditor: public QWidget 00050 { 00051 Q_OBJECT 00052 00053 public: 00055 00058 ContourLinesEditor(const QLocale& locale = QLocale::system(), int precision = 6, QWidget* parent = 0); 00059 ~ContourLinesEditor(); 00061 void setSpectrogram(Spectrogram *sp); 00063 void updateContourLevels(); 00064 void updateContourPens(); 00066 void updateContents(); 00067 void showPenColumn(bool on = true); 00068 00069 protected slots: 00070 void enableButtons(int row); 00071 void showPenDialog(int row, int col); 00072 void insertLevel(); 00073 void deleteLevel(); 00074 void spinBoxActivated(DoubleSpinBox *); 00075 void updatePen(); 00076 00077 bool eventFilter(QObject *object, QEvent *e); 00078 00079 private: 00080 void updatePenColumn(); 00081 00083 QTableWidget *table; 00084 QPushButton *insertBtn, *deleteBtn; 00085 Spectrogram *d_spectrogram; 00086 00088 QLocale d_locale; 00090 int d_precision; 00091 00092 QDialog *penDialog; 00093 ColorButton *penColorBox; 00094 PenStyleBox *penStyleBox; 00095 DoubleSpinBox *penWidthBox; 00096 QCheckBox *applyAllColorBox, *applyAllWidthBox, *applyAllStyleBox; 00097 00098 int d_pen_index; 00099 QList<QPen> d_pen_list; 00100 }; 00101 00102 #endif