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 QTimeEdit;
00038 class QDateTimeEdit;
00039 class QListWidget;
00040 class QListWidgetItem;
00041 class QCheckBox;
00042 class QGroupBox;
00043 class QComboBox;
00044 class QLabel;
00045 class QPushButton;
00046 class QRadioButton;
00047 class QSpinBox;
00048 class QTabWidget;
00049 class QWidget;
00050 class QStringList;
00051 class ColorBox;
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();
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 pickAxisColor();
00109 void pickAxisNumColor();
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 updateMajTicksType(int);
00117 void updateMinTicksType(int);
00118 void updateGrid();
00119 void setLabelsNumericFormat(int);
00120 void updateLabelsFormat(int);
00121 void showAxisFormatOptions(int format);
00122 void setBaselineDist(int);
00123 void changeBaselineDist(int baseline);
00124 void changeMinorTicksLength (int minLength);
00125 void changeMajorTicksLength (int majLength);
00126 void pageChanged ( QWidget *page);
00127 void showAxis(int, int, const QString&, bool, int, int, bool,
00128 const QColor&, int, int, int, int, const QString&, const QColor&);
00129 void applyCanvasFormat();
00130 void setFrameDefaultValues();
00131
00132 protected:
00133 void applyCanvasFormatTo(Graph *g);
00135 void initAxesPage();
00137 void initScalesPage();
00139 void initGridPage();
00141 void initFramePage();
00143 void applyChangesToGrid(Grid *grid);
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 QCheckBox* btnStep, *btnInvert;
00156 QSpinBox* boxMajorValue;
00157 QCheckBox* btnMajor;
00158 QListWidget* axesList;
00159 QWidget* gridPage;
00160 QCheckBox* boxMajorGrid;
00161 QCheckBox* boxMinorGrid;
00162 PenStyleBox* boxTypeMajor;
00163 ColorBox* boxColorMinor;
00164 ColorBox* 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 QFont xBottomFont, yLeftFont, xTopFont, yRightFont;
00195 bool xAxisOn, yAxisOn, topAxisOn, rightAxisOn;
00196 int xBottomLabelsRotation, xTopLabelsRotation;
00197
00198 QGroupBox *boxAxesBreaks;
00199 DoubleSpinBox *boxBreakStart, *boxBreakEnd, *boxStepBeforeBreak, *boxStepAfterBreak;
00200 QSpinBox *boxBreakPosition, *boxBreakWidth;
00201 QComboBox *boxMinorTicksBeforeBreak, *boxMinorTicksAfterBreak;
00202 QCheckBox *boxLog10AfterBreak, *boxBreakDecoration, *boxAntialiseGrid;
00203 QComboBox *boxApplyGridFormat;
00204 Graph* d_graph;
00206 QWidget* lastPage;
00207 QDateTimeEdit *boxStartDateTime, *boxEndDateTime;
00208 QTimeEdit *boxStartTime, *boxEndTime;
00209 QComboBox *canvasFrameApplyToBox;
00210 QPushButton *frameDefaultBtn;
00211 };
00212
00213 #endif