00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
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 setAxisType(int axis);
00095 void updateAxisType(int axis);
00096 void updateTitleBox(int axis);
00097 bool updatePlot(QWidget *page = NULL);
00098 void updateScale();
00099 void stepEnabled();
00100 void stepDisabled();
00101 void majorGridEnabled(bool on);
00102 void minorGridEnabled(bool on);
00103 void showGridOptions(int axis);
00104 void accept();
00105 void customAxisFont();
00106 void showAxis();
00107 void updateShowBox(int axis);
00108 void updateAxisColor(int);
00109 int mapToQwtAxis(int axis);
00110 int mapToQwtAxisId();
00111 void updateTickLabelsList(bool);
00112 void updateMinorTicksList(int scaleType);
00113 void setTicksType(int);
00114 void updateGrid();
00115 void setLabelsNumericFormat(int);
00116 void updateLabelsFormat(int);
00117 void showAxisFormatOptions(int format);
00118 void setBaselineDist(int);
00119 void changeMinorTicksLength (int minLength);
00120 void changeMajorTicksLength (int majLength);
00121 void pageChanged ( QWidget *page);
00122 void showAxis(int, int, const QString&, bool, int, int, bool, const QColor&, int, int, int, int, const QString&, const QColor&, int, bool, int);
00123 void applyCanvasFormat();
00124 void setFrameDefaultValues();
00125 void applyAxisFormat();
00126 void setDisplayDateTimeFormat( const QString &);
00127 void updateCurrentAxis();
00128
00129 protected:
00130 void applyCanvasFormatTo(Graph *g);
00132 void initAxesPage();
00134 void initScalesPage();
00136 void initGridPage();
00138 void initFramePage();
00140 void applyChangesToGrid(Grid *grid);
00142 void applyAxisFormatToLayer(Graph *g);
00143
00144 QPushButton* buttonApply;
00145 QPushButton* buttonOk;
00146 QPushButton* buttonCancel;
00147 QTabWidget* generalDialog;
00148 QWidget* scalesPage;
00149 DoubleSpinBox* boxEnd;
00150 DoubleSpinBox* boxStart;
00151 QComboBox* boxScaleType;
00152 QComboBox* boxMinorValue;
00153 DoubleSpinBox* boxStep;
00154 QRadioButton* btnStep;
00155 QCheckBox *btnInvert;
00156 QSpinBox* boxMajorValue;
00157 QRadioButton* btnMajor;
00158 QListWidget* axesList;
00159 QWidget* gridPage;
00160 QCheckBox* boxMajorGrid;
00161 QCheckBox* boxMinorGrid;
00162 PenStyleBox* boxTypeMajor;
00163 ColorButton* boxColorMinor;
00164 ColorButton* boxColorMajor;
00165 ColorButton *boxCanvasColor;
00166 DoubleSpinBox* boxWidthMajor;
00167 PenStyleBox* boxTypeMinor;
00168 DoubleSpinBox* boxWidthMinor;
00169 QCheckBox* boxXLine;
00170 QCheckBox* boxYLine;
00171 QListWidget* axesGridList;
00172 QWidget* axesPage, *frame;
00173 QListWidget* axesTitlesList;
00174 QGroupBox *boxShowLabels;
00175 QCheckBox *boxShowAxis;
00176
00177 QTextEdit *boxFormula, *boxTitle;
00178 QSpinBox *boxFrameWidth, *boxPrecision, *boxAngle, *boxBaseline, *boxAxesLinewidth;
00179 QPushButton* btnAxesFont;
00180 QCheckBox *boxBackbones, *boxShowFormula;
00181 ColorButton* boxAxisColor;
00182 QComboBox *boxMajorTicksType, *boxMinorTicksType, *boxFormat, *boxAxisType, *boxColName;
00183 QGroupBox *boxFramed;
00184 QLabel *label1, *label2, *label3, *boxScaleTypeLabel, *minorBoxLabel, *labelTable;
00185 QSpinBox *boxMajorTicksLength, *boxMinorTicksLength, *boxBorderWidth;
00186 QComboBox *boxUnit, *boxTableName, *boxGridXAxis, *boxGridYAxis;
00187 ColorButton *boxFrameColor, *boxAxisNumColor;
00188 QGroupBox *labelBox;
00189 QPushButton * buttonLabelFont;
00190 TextFormatButtons *formatButtons;
00191
00192 QStringList tickLabelsOn, tablesList;
00193 QList<int> majTicks, minTicks, axesBaseline;
00194 bool xAxisOn, yAxisOn, topAxisOn, rightAxisOn;
00195 int xBottomLabelsRotation, xTopLabelsRotation;
00196
00197 QGroupBox *boxAxesBreaks;
00198 DoubleSpinBox *boxBreakStart, *boxBreakEnd, *boxStepBeforeBreak, *boxStepAfterBreak;
00199 QSpinBox *boxBreakPosition, *boxBreakWidth;
00200 QComboBox *boxMinorTicksBeforeBreak, *boxMinorTicksAfterBreak;
00201 QCheckBox *boxLog10AfterBreak, *boxBreakDecoration, *boxAntialiseGrid;
00202 QComboBox *boxApplyGridFormat;
00203 Graph* d_graph;
00205 QWidget* lastPage;
00206 QDateTimeEdit *boxStartDateTime, *boxEndDateTime;
00207 QTimeEdit *boxStartTime, *boxEndTime;
00208 QComboBox *canvasFrameApplyToBox;
00209 QPushButton *frameDefaultBtn;
00210 QSpinBox *boxLabelsDistance;
00211 QGroupBox *axisFormatBox;
00212 QComboBox *axisFormatApplyToBox;
00213 QDateTimeEdit *originDateTimeBox;
00214 QCheckBox *invertTitleBox;
00215 QCheckBox* boxAxisBackbone;
00216 QSpinBox *boxTickLabelDistance;
00217 QLineEdit *boxPrefix, *boxSuffix;
00218
00219 QComboBox *showTicksPolicyBox;
00220 };
00221
00222 #endif