QtiPlot 0.9.8.2
|
00001 /*************************************************************************** 00002 File : AxesDialog.h 00003 Project : QtiPlot 00004 -------------------------------------------------------------------- 00005 Copyright : (C) 2006 by Ion Vasilief, Tilman Hoener zu Siederdissen 00006 Email (use @ for *) : ion_vasilief*yahoo.fr 00007 Description : Axes preferences 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 AXESDIALOG_H 00030 #define AXESDIALOG_H 00031 00032 #include <QDialog> 00033 #include <QLabel> 00034 #include <QList> 00035 #include <QTextEdit> 00036 00037 class QLineEdit; 00038 class QTimeEdit; 00039 class QDateTimeEdit; 00040 class QListWidget; 00041 class QListWidgetItem; 00042 class QCheckBox; 00043 class QGroupBox; 00044 class QComboBox; 00045 class QLabel; 00046 class QPushButton; 00047 class QRadioButton; 00048 class QSpinBox; 00049 class QTabWidget; 00050 class QWidget; 00051 class QStringList; 00052 class ColorButton; 00053 class Graph; 00054 class TextFormatButtons; 00055 class DoubleSpinBox; 00056 class Grid; 00057 class PenStyleBox; 00058 00060 00063 class AxesDialog : public QDialog 00064 { 00065 Q_OBJECT 00066 00067 public: 00069 00073 AxesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 ); 00074 00075 void setGraph(Graph *g); 00076 00077 public slots: 00078 void setCurrentScale(int axisPos); 00079 void showGeneralPage(); 00080 void showAxesPage(); 00081 void showGridPage(); 00082 void showFormulaBox(); 00083 00085 00089 int exec(); 00090 00091 private slots: 00092 void showAxisFormula(int axis); 00093 void customAxisLabelFont(); 00094 void pickAxisLabelColor(); 00095 void setAxisType(int axis); 00096 void updateAxisType(int axis); 00097 void updateTitleBox(int axis); 00098 bool updatePlot(QWidget *page = NULL); 00099 void updateScale(); 00100 void stepEnabled(); 00101 void stepDisabled(); 00102 void majorGridEnabled(bool on); 00103 void minorGridEnabled(bool on); 00104 void showGridOptions(int axis); 00105 void accept(); 00106 void customAxisFont(); 00107 void showAxis(); 00108 void updateShowBox(int axis); 00109 void updateAxisColor(int); 00110 int mapToQwtAxis(int axis); 00111 int mapToQwtAxisId(); 00112 void updateTickLabelsList(bool); 00113 void updateMinorTicksList(int scaleType); 00114 void setTicksType(int); 00115 void updateGrid(); 00116 void setLabelsNumericFormat(int); 00117 void updateLabelsFormat(int); 00118 void showAxisFormatOptions(int format); 00119 void setBaselineDist(int); 00120 void changeMinorTicksLength (int minLength); 00121 void changeMajorTicksLength (int majLength); 00122 void pageChanged ( QWidget *page); 00123 void showAxis(int, int, const QString&, bool, int, int, bool, const QColor&, int, int, int, int, const QString&, const QColor&, int, bool, int); 00124 void applyCanvasFormat(); 00125 void setFrameDefaultValues(); 00126 void applyAxisFormat(); 00127 void setDisplayDateTimeFormat( const QString &); 00128 void updateCurrentAxis(); 00129 00130 protected: 00131 void applyCanvasFormatTo(Graph *g); 00133 void initAxesPage(); 00135 void initScalesPage(); 00137 void initGridPage(); 00139 void initFramePage(); 00141 void applyChangesToGrid(Grid *grid); 00143 void applyAxisFormatToLayer(Graph *g); 00144 00145 QPushButton* buttonApply; 00146 QPushButton* buttonOk; 00147 QPushButton* buttonCancel; 00148 QTabWidget* generalDialog; 00149 QWidget* scalesPage; 00150 DoubleSpinBox* boxEnd; 00151 DoubleSpinBox* boxStart; 00152 QComboBox* boxScaleType; 00153 QComboBox* boxMinorValue; 00154 DoubleSpinBox* boxStep; 00155 QRadioButton* btnStep; 00156 QCheckBox *btnInvert; 00157 QSpinBox* boxMajorValue; 00158 QRadioButton* btnMajor; 00159 QListWidget* axesList; 00160 QWidget* gridPage; 00161 QCheckBox* boxMajorGrid; 00162 QCheckBox* boxMinorGrid; 00163 PenStyleBox* boxTypeMajor; 00164 ColorButton* boxColorMinor; 00165 ColorButton* boxColorMajor; 00166 ColorButton *boxCanvasColor; 00167 DoubleSpinBox* boxWidthMajor; 00168 PenStyleBox* boxTypeMinor; 00169 DoubleSpinBox* boxWidthMinor; 00170 QCheckBox* boxXLine; 00171 QCheckBox* boxYLine; 00172 QListWidget* axesGridList; 00173 QWidget* axesPage, *frame; 00174 QListWidget* axesTitlesList; 00175 QGroupBox *boxShowLabels; 00176 QCheckBox *boxShowAxis; 00177 00178 QTextEdit *boxFormula, *boxTitle; 00179 QSpinBox *boxFrameWidth, *boxPrecision, *boxAngle, *boxBaseline, *boxAxesLinewidth; 00180 QPushButton* btnAxesFont; 00181 QCheckBox *boxBackbones, *boxShowFormula; 00182 ColorButton* boxAxisColor; 00183 QComboBox *boxMajorTicksType, *boxMinorTicksType, *boxFormat, *boxAxisType, *boxColName; 00184 QGroupBox *boxFramed; 00185 QLabel *label1, *label2, *label3, *boxScaleTypeLabel, *minorBoxLabel, *labelTable; 00186 QSpinBox *boxMajorTicksLength, *boxMinorTicksLength, *boxBorderWidth; 00187 QComboBox *boxUnit, *boxTableName, *boxGridXAxis, *boxGridYAxis; 00188 ColorButton *boxFrameColor, *boxAxisNumColor; 00189 QGroupBox *labelBox; 00190 QPushButton * buttonLabelFont; 00191 TextFormatButtons *formatButtons; 00192 00193 QStringList tickLabelsOn; 00194 QGroupBox *boxAxesBreaks; 00195 DoubleSpinBox *boxBreakStart, *boxBreakEnd, *boxStepBeforeBreak, *boxStepAfterBreak; 00196 QSpinBox *boxBreakPosition, *boxBreakWidth; 00197 QComboBox *boxMinorTicksBeforeBreak, *boxMinorTicksAfterBreak; 00198 QCheckBox *boxLog10AfterBreak, *boxBreakDecoration, *boxAntialiseGrid; 00199 QComboBox *boxApplyGridFormat; 00200 Graph* d_graph; 00202 QWidget* lastPage; 00203 QDateTimeEdit *boxStartDateTime, *boxEndDateTime; 00204 QTimeEdit *boxStartTime, *boxEndTime; 00205 QComboBox *canvasFrameApplyToBox; 00206 QPushButton *frameDefaultBtn; 00207 QSpinBox *boxLabelsDistance; 00208 QGroupBox *axisFormatBox; 00209 QComboBox *axisFormatApplyToBox; 00210 QDateTimeEdit *originDateTimeBox; 00211 QCheckBox *invertTitleBox; 00212 QCheckBox* boxAxisBackbone; 00213 QSpinBox *boxTickLabelDistance; 00214 QLineEdit *boxPrefix, *boxSuffix; 00215 00216 QComboBox *showTicksPolicyBox; 00217 ColorButton *axisLabelColorButton; 00218 }; 00219 00220 #endif