00001 /*************************************************************************** 00002 File : CurvesDialog.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2006 by Ion Vasilief 00006 Email (use @ for *) : ion_vasilief*yahoo.fr 00007 Description : Add/remove curves 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 CURVESDIALOG_H 00030 #define CURVESDIALOG_H 00031 00032 #include <QDialog> 00033 00034 class QComboBox; 00035 class QListWidget; 00036 class QPushButton; 00037 class QCheckBox; 00038 class QTreeWidget; 00039 class QTreeWidgetItem; 00040 class Graph; 00041 class Folder; 00042 00044 class CurvesDialog : public QDialog 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 CurvesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); 00050 00051 void setGraph(Graph *graph); 00052 00053 private slots: 00054 void addCurves(); 00055 void removeCurves(); 00056 int curveStyle(); 00057 void showCurveRangeDialog(); 00058 void showPlotAssociations(); 00059 void showFunctionDialog(); 00060 void showCurveBtn(int); 00061 void enableAddBtn(); 00062 void enableContentsBtns(); 00063 void showCurveRange(bool); 00064 void updateCurveRange(); 00065 void showCurrentFolder(bool); 00066 void raiseCurve(); 00067 void shiftCurveBy(int offset = 1); 00068 00069 private: 00070 enum TreeItemType{FolderItem, ColumnItem, TableItem, MatrixItem}; 00071 00072 void closeEvent(QCloseEvent*); 00073 void addFolderItems(Folder *f, QTreeWidgetItem* parent = 0); 00074 00075 void init(); 00076 bool addCurve(const QString& name); 00077 QSize sizeHint() const; 00078 void contextMenuEvent(QContextMenuEvent *); 00079 00080 Graph *d_graph; 00081 00082 QPushButton* btnAdd; 00083 QPushButton* btnRemove; 00084 QPushButton* btnOK; 00085 QPushButton* btnCancel; 00086 QPushButton* btnAssociations; 00087 QPushButton* btnEditFunction; 00088 QPushButton* btnRange; 00089 QTreeWidget* available; 00090 QListWidget* contents; 00091 QComboBox* boxStyle; 00092 QComboBox* boxMatrixStyle; 00093 QCheckBox* boxShowRange; 00094 QCheckBox* boxShowCurrentFolder; 00095 QPushButton* btnUp; 00096 QPushButton* btnDown; 00097 }; 00098 00099 #endif // CurvesDialog_H