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
void setGraph(Graph *graph)
Definition: CurvesDialog.cpp:341
QComboBox * boxYAxis
Definition: CurvesDialog.h:104
void contextMenuEvent(QContextMenuEvent *)
Definition: CurvesDialog.cpp:264
QComboBox * boxXAxis
Definition: CurvesDialog.h:103
void updateCurveRange()
Definition: CurvesDialog.cpp:630
void enableAddBtn()
Definition: CurvesDialog.cpp:539
Definition: CurvesDialog.h:53
Folders list item class.
Definition: CurvesDialog.h:113
Definition: CurvesDialog.h:53
CurvesDialog(QWidget *parent=0, Qt::WFlags fl=0)
Definition: CurvesDialog.cpp:55
QPushButton * btnAssociations
Definition: CurvesDialog.h:92
QPushButton * btnCancel
Definition: CurvesDialog.h:91
QListWidget * contents
Definition: CurvesDialog.h:96
Add/remove curves dialog.
Definition: CurvesDialog.h:48
void enableContentsBtns()
Definition: CurvesDialog.cpp:545
A 2D-plotting widget.
Definition: Graph.h:123
QPushButton * btnRemove
Definition: CurvesDialog.h:89
QPushButton * btnOK
Definition: CurvesDialog.h:90
QComboBox * boxMatrixStyle
Definition: CurvesDialog.h:98
QCheckBox * boxShowRange
Definition: CurvesDialog.h:99
void raiseCurve()
Definition: CurvesDialog.cpp:725
bool addCurveFromTable(ApplicationWindow *app, Table *t, const QString &name)
Definition: CurvesDialog.cpp:450
Definition: CurvesDialog.h:53
QComboBox * boxStyle
Definition: CurvesDialog.h:97
Folder for the project explorer.
Definition: Folder.h:53
QPushButton * btnEditFunction
Definition: CurvesDialog.h:93
Folder * myFolder
Definition: CurvesDialog.h:119
void addCurves()
Definition: CurvesDialog.cpp:349
QtiPlot&#39;s main window.
Definition: ApplicationWindow.h:133
QPushButton * btnDown
Definition: CurvesDialog.h:102
void showPlotAssociations()
Definition: CurvesDialog.cpp:236
TreeItemType
Definition: CurvesDialog.h:53
void shiftCurveBy(int offset=1)
Definition: CurvesDialog.cpp:730
void removeCurves()
Definition: CurvesDialog.cpp:525
QPushButton * btnRange
Definition: CurvesDialog.h:94
Matrix worksheet class.
Definition: Matrix.h:57
QSize sizeHint() const
Definition: CurvesDialog.cpp:259
void closeEvent(QCloseEvent *)
Definition: CurvesDialog.cpp:716
QTreeWidget * available
Definition: CurvesDialog.h:95
void addFolderItems(Folder *f, QTreeWidgetItem *parent=0)
Definition: CurvesDialog.cpp:677
QPushButton * btnAdd
Definition: CurvesDialog.h:88
QCheckBox * boxShowCurrentFolder
Definition: CurvesDialog.h:100
Graph * d_graph
Definition: CurvesDialog.h:86
QPushButton * btnUp
Definition: CurvesDialog.h:101
void showFunctionDialog()
Definition: CurvesDialog.cpp:249
MDI window providing a spreadsheet table with column logic.
Definition: Table.h:57
void showCurveBtn(int)
Definition: CurvesDialog.cpp:201
bool addCurveFromMatrix(Matrix *m)
Definition: CurvesDialog.cpp:423
void showCurveRange(bool)
Definition: CurvesDialog.cpp:597
int curveStyle()
Definition: CurvesDialog.cpp:555
void init()
Definition: CurvesDialog.cpp:306
Definition: CurvesDialog.h:53
void showCurveRangeDialog()
Definition: CurvesDialog.cpp:222
void showCurrentFolder(bool)
Definition: CurvesDialog.cpp:635