QtiPlot  0.9.8.2
AxesDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : AxesDialog.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2004 - 2011 by Ion Vasilief
6  (C) 2006 Tilman Hoener zu Siederdissen
7  Email (use @ for *) : ion_vasilief*yahoo.fr
8  Description : Axes preferences dialog
9 
10  ***************************************************************************/
11 
12 /***************************************************************************
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * *
19  * This program is distributed in the hope that it will be useful, *
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22  * GNU General Public License for more details. *
23  * *
24  * You should have received a copy of the GNU General Public License *
25  * along with this program; if not, write to the Free Software *
26  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
27  * Boston, MA 02110-1301 USA *
28  * *
29  ***************************************************************************/
30 #ifndef AXESDIALOG_H
31 #define AXESDIALOG_H
32 
33 #include <QDialog>
34 #include <QLabel>
35 #include <QList>
36 #include <QTextEdit>
37 
38 class QLineEdit;
39 class QTimeEdit;
40 class QDateTimeEdit;
41 class QListWidget;
42 class QListWidgetItem;
43 class QCheckBox;
44 class QGroupBox;
45 class QComboBox;
46 class QLabel;
47 class QPushButton;
48 class QRadioButton;
49 class QSpinBox;
50 class QTabWidget;
51 class QWidget;
52 class QStringList;
53 class ColorButton;
54 class Graph;
55 class TextFormatButtons;
56 class DoubleSpinBox;
57 class Grid;
58 class PenStyleBox;
59 
61 
64 class AxesDialog : public QDialog
65 {
66  Q_OBJECT
67 
68 public:
70 
74  AxesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
75 
76  void setGraph(Graph *g);
77 
78 public slots:
79  void setCurrentScale(int axisPos);
80  void showGeneralPage();
81  void showAxesPage();
82  void showGridPage();
83  void showFormulaBox();
84 
86 
90  int exec();
91 
92 private slots:
93  void showAxisFormula(int axis);
94  void customAxisLabelFont();
95  void pickAxisLabelColor();
96  void setAxisType(int axis);
97  void updateAxisType(int axis);
98  void updateTitleBox(int axis);
99  bool updatePlot(QWidget *page = NULL);
100  void updateScale();
101  void stepEnabled();
102  void stepDisabled();
103  void majorGridEnabled(bool on);
104  void minorGridEnabled(bool on);
105  void showGridOptions(int axis);
106  void accept();
107  void customAxisFont();
108  void showAxis();
109  void updateShowBox(int axis);
110  void updateAxisColor(int);
111  int mapToQwtAxis(int axis);
112  int mapToQwtAxisId();
113  void updateTickLabelsList(bool);
114  void updateMinorTicksList(int scaleType);
115  void setTicksType(int);
116  void updateGrid();
117  void setLabelsNumericFormat(int);
118  void updateLabelsFormat(int);
119  void showAxisFormatOptions(int format);
120  void setBaselineDist(int);
121  void changeMinorTicksLength (int minLength);
122  void changeMajorTicksLength (int majLength);
123  void pageChanged ( QWidget *page);
124  void showAxis(int, int, const QString&, bool, int, int, bool, const QColor&, int, int, int, int, const QString&, const QColor&, int, bool, int);
125  void applyCanvasFormat();
126  void setFrameDefaultValues();
127  void applyAxisFormat();
128  void updateCurrentAxis();
129 
130 protected:
131  void applyCanvasFormatTo(Graph *g);
133  void initAxesPage();
135  void initScalesPage();
137  void initGridPage();
139  void initFramePage();
141  void applyChangesToGrid(Grid *grid);
143  void applyAxisFormatToLayer(Graph *g);
144 
145  QPushButton* buttonApply;
146  QPushButton* buttonOk;
147  QPushButton* buttonCancel;
148  QTabWidget* generalDialog;
149  QWidget* scalesPage;
152  QComboBox* boxScaleType;
153  QComboBox* boxMinorValue;
155  QRadioButton* btnStep;
156  QCheckBox *btnInvert;
157  QSpinBox* boxMajorValue;
158  QRadioButton* btnMajor;
159  QListWidget* axesList;
160  QWidget* gridPage;
161  QCheckBox* boxMajorGrid;
162  QCheckBox* boxMinorGrid;
170  QCheckBox* boxXLine;
171  QCheckBox* boxYLine;
172  QListWidget* axesGridList;
173  QWidget* axesPage, *frame;
174  QListWidget* axesTitlesList;
175  QGroupBox *boxShowLabels;
176  QCheckBox *boxShowAxis;
177 
178  QTextEdit *boxFormula, *boxTitle;
180  QPushButton* btnAxesFont;
184  QGroupBox *boxFramed;
189  QGroupBox *labelBox;
190  QPushButton * buttonLabelFont;
192 
193  QStringList tickLabelsOn;
194  QGroupBox *boxAxesBreaks;
199  QComboBox *boxApplyGridFormat;
202  QWidget* lastPage;
205  QPushButton *frameDefaultBtn;
206  QSpinBox *boxLabelsDistance;
207  QGroupBox *axisFormatBox;
209  QCheckBox *invertTitleBox;
210  QCheckBox* boxAxisBackbone;
212  QLineEdit *boxPrefix, *boxSuffix;
213 
214  QComboBox *showTicksPolicyBox;
216 };
217 
218 #endif