SciDAVis  1.D4
AxesDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : AxesDialog.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2006 by Ion Vasilief, Tilman Benkert
6  Email (use @ for *) : ion_vasilief*yahoo.fr, thzs*gmx.net
7  Description : General plot options 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 AXESDIALOG_H
30 #define AXESDIALOG_H
31 
32 #include <QDialog>
33 #include <QLabel>
34 #include <QList>
35 #include <QVector>
36 #include <QTextEdit>
37 
38 class QListWidget;
39 class QListWidgetItem;
40 class QCheckBox;
41 class QGroupBox;
42 class QComboBox;
43 class QLabel;
44 class QLineEdit;
45 class QPushButton;
46 class QRadioButton;
47 class QSpinBox;
48 class QTabWidget;
49 class QWidget;
50 class QStringList;
51 class ColorBox;
52 class ColorButton;
53 class Graph;
54 class TextFormatButtons;
55 
57 
60 class AxesDialog : public QDialog
61 {
62  Q_OBJECT
63 
64 public:
66 
70  AxesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
73 
74  void setGraph(Graph *g);
75 
77 
78 protected:
80  void initAxesPage();
82  void initScalesPage();
84  void initGridPage();
86  void initFramePage();
87 
88  QPushButton* buttonApply;
89  QPushButton* buttonOk;
90  QPushButton* buttonCancel;
91  QTabWidget* generalDialog;
92  QWidget* scalesPage;
93  QLineEdit* boxEnd;
94  QLineEdit* boxStart;
95  QComboBox* boxScaleType;
96  QComboBox* boxMinorValue;
97  QLineEdit* boxStep;
98  QCheckBox *btnInvert;
99  QSpinBox* boxMajorValue;
100  QRadioButton *btnStep, *btnMajor;
101  QListWidget* axesList;
102  QWidget* gridPage;
103  QCheckBox* boxMajorGrid;
104  QCheckBox* boxMinorGrid;
105  QComboBox* boxTypeMajor;
109  QSpinBox* boxWidthMajor;
110  QComboBox* boxTypeMinor;
111  QSpinBox* boxWidthMinor;
112  QCheckBox* boxXLine;
113  QCheckBox* boxYLine;
114  QListWidget* axesGridList;
115  QWidget* axesPage, *frame;
116  QListWidget* axesTitlesList;
117  QGroupBox *boxShowLabels;
118  QCheckBox *boxShowAxis;
119 
120  QTextEdit *boxFormula, *boxTitle;
122  QPushButton* btnAxesFont;
126  QGroupBox *boxFramed;
131  QGroupBox *labelBox;
132  QPushButton * buttonLabelFont;
134 
135 public slots:
136  void setAxisType(int axis);
137  void updateTitleBox(int axis);
138  bool updatePlot();
139  void updateScale();
140  void stepEnabled();
141  void stepDisabled();
142  void majorGridEnabled(bool on);
143  void minorGridEnabled(bool on);
144  void showGridOptions(int axis);
145  void accept();
146  void customAxisFont();
147  void showAxis();
148  void updateShowBox(int axis);
149  void drawFrame(bool framed);
150 
151  void pickAxisColor();
152  void pickAxisNumColor();
153  void updateAxisColor(int);
154  int mapToQwtAxisId();
155  void updateTickLabelsList(bool);
156  void updateMinorTicksList(int scaleType);
157  void setTicksType(int);
158  void setCurrentScale(int axisPos);
159 
160  void updateMajTicksType(int);
161  void updateMinTicksType(int);
162  void updateGrid();
163  void updateFrame(int);
164  void setLabelsNumericFormat(int);
165  void updateLabelsFormat(int);
166  void insertColList(const QStringList& cols);
167  void showAxisFormatOptions(int format);
168  void setBaselineDist(int);
169  void changeBaselineDist(int baseline);
170  void changeMinorTicksLength (int minLength);
171  void changeMajorTicksLength (int majLength);
172  void pickCanvasFrameColor();
173  void changeAxesLinewidth (int);
174  void drawAxesBackbones (bool);
175  void showGeneralPage();
176  void showAxesPage();
177  void showGridPage();
178  void showFormulaBox();
179  void showAxisFormula(int axis);
180 
181  void customAxisLabelFont();
182 
184 
188  int exec();
189 
190 private slots:
191  void pageChanged ( QWidget *page);
192 
193 protected:
194  void showAxis(int, int, const QString&, bool, int, int, bool,
195  const QColor&, int, int, int, int, const QString&, const QColor&);
196 
197  QStringList tickLabelsOn, formatInfo;
198  QStringList tablesList;
203 
206  QWidget* lastPage;
207 };
208 
209 #endif