QtiPlot  0.9.8.2
CurvesDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : CurvesDialog.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Add/remove curves dialog
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef CURVESDIALOG_H
30 #define CURVESDIALOG_H
31 
32 #include <QDialog>
33 #include <QTreeWidget>
34 
35 class QComboBox;
36 class QListWidget;
37 class QPushButton;
38 class QCheckBox;
39 class QTreeWidget;
41 class Graph;
42 class Folder;
43 class Matrix;
44 class Table;
45 class ApplicationWindow;
46 
48 class CurvesDialog : public QDialog
49 {
50  Q_OBJECT
51 
52 public:
54  CurvesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
55 
56  void setGraph(Graph *graph);
57 
58 private slots:
59  void addCurves();
60  void removeCurves();
61  int curveStyle();
62  void showCurveRangeDialog();
63  void showPlotAssociations();
64  void showFunctionDialog();
65  void showCurveBtn(int);
66  void enableAddBtn();
67  void enableContentsBtns();
68  void showCurveRange(bool);
69  void updateCurveRange();
70  void showCurrentFolder(bool);
71  void raiseCurve();
72  void shiftCurveBy(int offset = 1);
73 
74 private:
75  void closeEvent(QCloseEvent*);
76  void addFolderItems(Folder *f, QTreeWidgetItem* parent = 0);
77 
78  void init();
79 
80  bool addCurveFromMatrix(Matrix *m);
81  bool addCurveFromTable(ApplicationWindow *app, Table *t, const QString& name);
82 
83  QSize sizeHint() const;
84  void contextMenuEvent(QContextMenuEvent *);
85 
87 
88  QPushButton* btnAdd;
89  QPushButton* btnRemove;
90  QPushButton* btnOK;
91  QPushButton* btnCancel;
92  QPushButton* btnAssociations;
93  QPushButton* btnEditFunction;
94  QPushButton* btnRange;
95  QTreeWidget* available;
96  QListWidget* contents;
97  QComboBox* boxStyle;
98  QComboBox* boxMatrixStyle;
99  QCheckBox* boxShowRange;
101  QPushButton* btnUp;
102  QPushButton* btnDown;
103  QComboBox* boxXAxis;
104  QComboBox* boxYAxis;
105 };
106 
107 /*****************************************************************************
108  *
109  * Class TreeWidgetFolderItem
110  *
111  *****************************************************************************/
113 class TreeWidgetFolderItem : public QTreeWidgetItem
114 {
115 public:
116  TreeWidgetFolderItem( QTreeWidget *parent, Folder *f );
117  TreeWidgetFolderItem( QTreeWidgetItem *parent, Folder *f );
118 
119  Folder *folder() { return myFolder; };
120 
121 protected:
122  Folder *myFolder;
123 };
124 
125 #endif // CurvesDialog_H