QtiPlot 0.9.8.2
CurvesDialog.h
Go to the documentation of this file.
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 #include <QTreeWidget>
00034 
00035 class QComboBox;
00036 class QListWidget;
00037 class QPushButton;
00038 class QCheckBox;
00039 class QTreeWidget;
00040 class TreeWidgetFolderItem;
00041 class Graph;
00042 class Folder;
00043 class Matrix;
00044 class Table;
00045 class ApplicationWindow;
00046 
00048 class CurvesDialog : public QDialog
00049 {
00050     Q_OBJECT
00051 
00052 public:
00053     enum TreeItemType{FolderItem, ColumnItem, TableItem, MatrixItem};
00054     CurvesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
00055 
00056     void setGraph(Graph *graph);
00057 
00058 private slots:
00059     void addCurves();
00060     void removeCurves();
00061     int curveStyle();
00062     void showCurveRangeDialog();
00063     void showPlotAssociations();
00064     void showFunctionDialog();
00065     void showCurveBtn(int);
00066     void enableAddBtn();
00067     void enableContentsBtns();
00068     void showCurveRange(bool);
00069     void updateCurveRange();
00070     void showCurrentFolder(bool);
00071     void raiseCurve();
00072     void shiftCurveBy(int offset = 1);
00073 
00074 private:
00075     void closeEvent(QCloseEvent*);
00076     void addFolderItems(Folder *f, QTreeWidgetItem* parent = 0);
00077 
00078     void init();
00079 
00080     bool addCurveFromMatrix(Matrix *m);
00081     bool addCurveFromTable(ApplicationWindow *app, Table *t, const QString& name);
00082 
00083     QSize sizeHint() const;
00084     void contextMenuEvent(QContextMenuEvent *);
00085 
00086     Graph *d_graph;
00087 
00088     QPushButton* btnAdd;
00089     QPushButton* btnRemove;
00090     QPushButton* btnOK;
00091     QPushButton* btnCancel;
00092     QPushButton* btnAssociations;
00093     QPushButton* btnEditFunction;
00094     QPushButton* btnRange;
00095     QTreeWidget* available;
00096     QListWidget* contents;
00097     QComboBox* boxStyle;
00098     QComboBox* boxMatrixStyle;
00099     QCheckBox* boxShowRange;
00100     QCheckBox* boxShowCurrentFolder;
00101     QPushButton* btnUp;
00102     QPushButton* btnDown;
00103     QComboBox* boxXAxis;
00104     QComboBox* boxYAxis;
00105 };
00106 
00107 /*****************************************************************************
00108  *
00109  * Class TreeWidgetFolderItem
00110  *
00111  *****************************************************************************/
00113 class TreeWidgetFolderItem : public QTreeWidgetItem
00114 {
00115 public:
00116     TreeWidgetFolderItem( QTreeWidget *parent, Folder *f );
00117     TreeWidgetFolderItem( QTreeWidgetItem *parent, Folder *f );
00118 
00119     Folder *folder() { return myFolder; };
00120 
00121 protected:
00122     Folder *myFolder;
00123 };
00124 
00125 #endif // CurvesDialog_H