QtiPlot 0.9.8.2
AxesDialog.h
Go to the documentation of this file.
00001 /***************************************************************************
00002     File                 : AxesDialog.h
00003     Project              : QtiPlot
00004     --------------------------------------------------------------------
00005     Copyright            : (C) 2004 - 2011 by Ion Vasilief
00006                            (C) 2006 Tilman Hoener zu Siederdissen
00007     Email (use @ for *)  : ion_vasilief*yahoo.fr
00008     Description          : Axes preferences dialog
00009 
00010  ***************************************************************************/
00011 
00012 /***************************************************************************
00013  *                                                                         *
00014  *  This program is free software; you can redistribute it and/or modify   *
00015  *  it under the terms of the GNU General Public License as published by   *
00016  *  the Free Software Foundation; either version 2 of the License, or      *
00017  *  (at your option) any later version.                                    *
00018  *                                                                         *
00019  *  This program is distributed in the hope that it will be useful,        *
00020  *  but WITHOUT ANY WARRANTY; without even the implied warranty of         *
00021  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
00022  *  GNU General Public License for more details.                           *
00023  *                                                                         *
00024  *   You should have received a copy of the GNU General Public License     *
00025  *   along with this program; if not, write to the Free Software           *
00026  *   Foundation, Inc., 51 Franklin Street, Fifth Floor,                    *
00027  *   Boston, MA  02110-1301  USA                                           *
00028  *                                                                         *
00029  ***************************************************************************/
00030 #ifndef AXESDIALOG_H
00031 #define AXESDIALOG_H
00032 
00033 #include <QDialog>
00034 #include <QLabel>
00035 #include <QList>
00036 #include <QTextEdit>
00037 
00038 class QLineEdit;
00039 class QTimeEdit;
00040 class QDateTimeEdit;
00041 class QListWidget;
00042 class QListWidgetItem;
00043 class QCheckBox;
00044 class QGroupBox;
00045 class QComboBox;
00046 class QLabel;
00047 class QPushButton;
00048 class QRadioButton;
00049 class QSpinBox;
00050 class QTabWidget;
00051 class QWidget;
00052 class QStringList;
00053 class ColorButton;
00054 class Graph;
00055 class TextFormatButtons;
00056 class DoubleSpinBox;
00057 class Grid;
00058 class PenStyleBox;
00059 
00061 
00064 class AxesDialog : public QDialog
00065 {
00066     Q_OBJECT
00067 
00068 public:
00070 
00074     AxesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
00075 
00076     void setGraph(Graph *g);
00077 
00078 public slots:
00079     void setCurrentScale(int axisPos);
00080     void showGeneralPage();
00081     void showAxesPage();
00082     void showGridPage();
00083     void showFormulaBox();
00084 
00086 
00090     int exec();
00091 
00092 private slots:
00093     void showAxisFormula(int axis);
00094     void customAxisLabelFont();
00095     void pickAxisLabelColor();
00096     void setAxisType(int axis);
00097     void updateAxisType(int axis);
00098     void updateTitleBox(int axis);
00099     bool updatePlot(QWidget *page = NULL);
00100     void updateScale();
00101     void stepEnabled();
00102     void stepDisabled();
00103     void majorGridEnabled(bool on);
00104     void minorGridEnabled(bool on);
00105     void showGridOptions(int axis);
00106     void accept();
00107     void customAxisFont();
00108     void showAxis();
00109     void updateShowBox(int axis);
00110     void updateAxisColor(int);
00111     int mapToQwtAxis(int axis);
00112     int mapToQwtAxisId();
00113     void updateTickLabelsList(bool);
00114     void updateMinorTicksList(int scaleType);
00115     void setTicksType(int);
00116     void updateGrid();
00117     void setLabelsNumericFormat(int);
00118     void updateLabelsFormat(int);
00119     void showAxisFormatOptions(int format);
00120     void setBaselineDist(int);
00121     void changeMinorTicksLength (int minLength);
00122     void changeMajorTicksLength (int majLength);
00123     void pageChanged ( QWidget *page);
00124     void showAxis(int, int, const QString&, bool, int, int, bool, const QColor&, int, int, int, int, const QString&, const QColor&, int, bool, int);
00125     void applyCanvasFormat();
00126     void setFrameDefaultValues();
00127     void applyAxisFormat();
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     QComboBox *canvasFrameApplyToBox;
00205     QPushButton *frameDefaultBtn;
00206     QSpinBox *boxLabelsDistance;
00207     QGroupBox *axisFormatBox;
00208     QComboBox *axisFormatApplyToBox;
00209     QCheckBox *invertTitleBox;
00210     QCheckBox* boxAxisBackbone;
00211     QSpinBox *boxTickLabelDistance;
00212     QLineEdit *boxPrefix, *boxSuffix;
00213 
00214     QComboBox *showTicksPolicyBox;
00215     ColorButton *axisLabelColorButton;
00216 };
00217 
00218 #endif