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 <QVector>
00036 #include <QTextEdit>
00037
00038 class QListWidget;
00039 class QListWidgetItem;
00040 class QCheckBox;
00041 class QGroupBox;
00042 class QComboBox;
00043 class QLabel;
00044 class QLineEdit;
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
00057 typedef struct{
00058 int majorOnX;
00059 int minorOnX;
00060 int majorOnY;
00061 int minorOnY;
00062 int majorStyle;
00063 int majorCol;
00064 int majorWidth;
00065 int minorStyle;
00066 int minorCol;
00067 int minorWidth;
00068 int xZeroOn;
00069 int yZeroOn;
00070 int xAxis;
00071 int yAxis;
00072 } GridOptions;
00073
00075
00078 class AxesDialog : public QDialog
00079 {
00080 Q_OBJECT
00081
00082 public:
00084
00088 AxesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
00090 ~AxesDialog(){};
00091
00092 void setGraph(Graph *g);
00093
00094 protected:
00096 void initAxesPage();
00098 void initScalesPage();
00100 void initGridPage();
00102 void initFramePage();
00103
00104 QPushButton* buttonApply;
00105 QPushButton* buttonOk;
00106 QPushButton* buttonCancel;
00107 QTabWidget* generalDialog;
00108 QWidget* scalesPage;
00109 QLineEdit* boxEnd;
00110 QLineEdit* boxStart;
00111 QComboBox* boxScaleType;
00112 QComboBox* boxMinorValue;
00113 QLineEdit* boxStep;
00114 QCheckBox* btnStep, *btnInvert;
00115 QSpinBox* boxMajorValue;
00116 QCheckBox* btnMajor;
00117 QListWidget* axesList;
00118 QWidget* gridPage;
00119 QCheckBox* boxMajorGrid;
00120 QCheckBox* boxMinorGrid;
00121 QComboBox* boxTypeMajor;
00122 ColorBox* boxColorMinor;
00123 ColorBox* boxColorMajor;
00124 ColorButton *boxCanvasColor;
00125 QSpinBox* boxWidthMajor;
00126 QComboBox* boxTypeMinor;
00127 QSpinBox* boxWidthMinor;
00128 QCheckBox* boxXLine;
00129 QCheckBox* boxYLine;
00130 QListWidget* axesGridList;
00131 QWidget* axesPage, *frame;
00132 QListWidget* axesTitlesList;
00133 QGroupBox *boxShowLabels;
00134 QCheckBox *boxShowAxis;
00135
00136 QTextEdit *boxFormula, *boxTitle;
00137 QSpinBox *boxFrameWidth, *boxPrecision, *boxAngle, *boxBaseline, *boxAxesLinewidth;
00138 QPushButton* btnAxesFont;
00139 QCheckBox *boxBackbones, *boxShowFormula;
00140 ColorButton* boxAxisColor;
00141 QComboBox *boxMajorTicksType, *boxMinorTicksType, *boxFormat, *boxAxisType, *boxColName;
00142 QGroupBox *boxFramed;
00143 QLabel *label1, *label2, *label3, *boxScaleTypeLabel, *minorBoxLabel, *labelTable;
00144 QSpinBox *boxMajorTicksLength, *boxMinorTicksLength, *boxBorderWidth;
00145 QComboBox *boxUnit, *boxTableName, *boxGridXAxis, *boxGridYAxis;
00146 ColorButton *boxFrameColor, *boxAxisNumColor;
00147 QGroupBox *labelBox;
00148 QPushButton * buttonLabelFont;
00149 TextFormatButtons *formatButtons;
00150
00151 public slots:
00152 void setAxesType(const QList<int>& list);
00153 void setAxisType(int axis);
00154 void updateAxisType(int axis);
00155 void setAxisTitles(QStringList t);
00156 void updateTitleBox(int axis);
00157 bool updatePlot();
00158 void updateScale();
00159 void stepEnabled();
00160 void stepDisabled();
00161 void majorGridEnabled(bool on);
00162 void minorGridEnabled(bool on);
00163 GridOptions getGridOptions();
00164 void putGridOptions(GridOptions gr);
00165 void setGridOptions();
00166 void accept();
00167 void customAxisFont();
00168 void showAxis();
00169 void updateShowBox(int axis);
00170 void setEnabledAxes(QVector<bool> ok);
00171 void drawFrame(bool framed);
00172
00173 void pickAxisColor();
00174 void pickAxisNumColor();
00175 void updateAxisColor(int);
00176 int mapToQwtAxis(int axis);
00177 int mapToQwtAxisId();
00178 void setEnabledTickLabels(const QStringList& labelsOn);
00179 void updateTickLabelsList(bool);
00180 void updateMinorTicksList(int scaleType);
00181 void setTicksType(const QList<int>& majLst, const QList<int>& minLst);
00182 void setTicksType(int);
00183 void setCurrentScale(int axisPos);
00184 void initAxisFonts(const QFont& xB, const QFont& yL, const QFont& xT, const QFont& yR );
00185
00186 void updateMajTicksType(int);
00187 void updateMinTicksType(int);
00188 void updateGrid(int);
00189 void updateFrame(int);
00190 void setLabelsNumericFormat(int);
00191 void updateLabelsFormat(int);
00192 void initLabelsRotation(int xAngle, int yAngle);
00193 void insertColList(const QStringList& cols);
00194 void insertTablesList(const QStringList& l);
00195 void setAxesLabelsFormatInfo(const QStringList& lst);
00196 void showAxisFormatOptions(int format);
00197 void setBaselineDist(int);
00198 void changeBaselineDist(int baseline);
00199 void setAxesBaseline(const QList<int>& lst);
00200 void changeMinorTicksLength (int minLength);
00201 void changeMajorTicksLength (int majLength);
00202 void pickCanvasFrameColor();
00203 void changeAxesLinewidth (int);
00204 void drawAxesBackbones (bool);
00205 void showGeneralPage();
00206 void showAxesPage();
00207 void showGridPage();
00208 void showFormulaBox();
00209 void showAxisFormula(int axis);
00210
00211 void customAxisLabelFont();
00212
00214
00218 int exec();
00219
00220 private slots:
00221 void pageChanged ( QWidget *page);
00222
00223 signals:
00224 void updateAxisTitle(int,const QString&);
00225 void changeAxisFont(int, const QFont &);
00226 void showAxis(int, int, const QString&, bool, int, int, bool,
00227 const QColor&, int, int, int, int, const QString&, const QColor&);
00228
00229 protected:
00230 QStringList titles, tickLabelsOn, formatInfo;
00231 QStringList tablesList;
00232 QList<int> majTicks, minTicks, axesType, axesBaseline;
00233 QFont xBottomFont, yLeftFont, xTopFont, yRightFont;
00234 GridOptions grid;
00235 bool xAxisOn,yAxisOn,topAxisOn,rightAxisOn;
00236 int xBottomLabelsRotation, xTopLabelsRotation;
00237
00238 Graph* d_graph;
00240 QWidget* lastPage;
00241 };
00242
00243 #endif