AxesDialog.h
Go to the documentation of this file.
/***************************************************************************
File : AxesDialog.h
Project : QtiPlot
--------------------------------------------------------------------
Copyright : (C) 2004 - 2011 by Ion Vasilief
(C) 2006 Tilman Hoener zu Siederdissen
Email (use @ for *) : ion_vasilief*yahoo.fr
Description : Axes preferences dialog
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the Free Software *
* Foundation, Inc., 51 Franklin Street, Fifth Floor, *
* Boston, MA 02110-1301 USA *
* *
***************************************************************************/
#ifndef AXESDIALOG_H
#define AXESDIALOG_H
#include <QDialog>
#include <QLabel>
#include <QList>
#include <QTextEdit>
class QLineEdit;
class QTimeEdit;
class QDateTimeEdit;
class QListWidget;
class QListWidgetItem;
class QCheckBox;
class QGroupBox;
class QComboBox;
class QLabel;
class QPushButton;
class QRadioButton;
class QSpinBox;
class QTabWidget;
class QWidget;
class QStringList;
class ColorButton;
class Graph;
class TextFormatButtons;
class DoubleSpinBox;
class Grid;
class PenStyleBox;
class AxesDialog : public QDialog
{
Q_OBJECT
public:
AxesDialog( QWidget* parent = 0, Qt::WFlags fl = 0 );
void setGraph(Graph *g);
public slots:
void setCurrentScale(int axisPos);
void showGeneralPage();
void showAxesPage();
void showGridPage();
void showFormulaBox();
int exec();
private slots:
void showAxisFormula(int axis);
void customAxisLabelFont();
void pickAxisLabelColor();
void setAxisType(int axis);
void updateAxisType(int axis);
void updateTitleBox(int axis);
bool updatePlot(QWidget *page = NULL);
void updateScale();
void stepEnabled();
void stepDisabled();
void majorGridEnabled(bool on);
void minorGridEnabled(bool on);
void showGridOptions(int axis);
void accept();
void customAxisFont();
void showAxis();
void updateShowBox(int axis);
void updateAxisColor(int);
int mapToQwtAxis(int axis);
int mapToQwtAxisId();
void updateTickLabelsList(bool);
void updateMinorTicksList(int scaleType);
void setTicksType(int);
void updateGrid();
void setLabelsNumericFormat(int);
void updateLabelsFormat(int);
void showAxisFormatOptions(int format);
void setBaselineDist(int);
void changeMinorTicksLength (int minLength);
void changeMajorTicksLength (int majLength);
void pageChanged ( QWidget *page);
void showAxis(int, int, const QString&, bool, int, int, bool, const QColor&, int, int, int, int, const QString&, const QColor&, int, bool, int);
void applyCanvasFormat();
void setFrameDefaultValues();
void applyAxisFormat();
void updateCurrentAxis();
protected:
void applyCanvasFormatTo(Graph *g);
void initAxesPage();
void initScalesPage();
void initGridPage();
void initFramePage();
void applyChangesToGrid(Grid *grid);
void applyAxisFormatToLayer(Graph *g);
QPushButton* buttonApply;
QPushButton* buttonOk;
QPushButton* buttonCancel;
QTabWidget* generalDialog;
QWidget* scalesPage;
DoubleSpinBox* boxEnd;
DoubleSpinBox* boxStart;
QComboBox* boxScaleType;
QComboBox* boxMinorValue;
DoubleSpinBox* boxStep;
QRadioButton* btnStep;
QCheckBox *btnInvert;
QSpinBox* boxMajorValue;
QRadioButton* btnMajor;
QListWidget* axesList;
QWidget* gridPage;
QCheckBox* boxMajorGrid;
QCheckBox* boxMinorGrid;
PenStyleBox* boxTypeMajor;
ColorButton* boxColorMinor;
ColorButton* boxColorMajor;
ColorButton *boxCanvasColor;
DoubleSpinBox* boxWidthMajor;
PenStyleBox* boxTypeMinor;
DoubleSpinBox* boxWidthMinor;
QCheckBox* boxXLine;
QCheckBox* boxYLine;
QListWidget* axesGridList;
QWidget* axesPage, *frame;
QListWidget* axesTitlesList;
QGroupBox *boxShowLabels;
QCheckBox *boxShowAxis;
QTextEdit *boxFormula, *boxTitle;
QSpinBox *boxFrameWidth, *boxPrecision, *boxAngle, *boxBaseline, *boxAxesLinewidth;
QPushButton* btnAxesFont;
QCheckBox *boxBackbones, *boxShowFormula;
ColorButton* boxAxisColor;
QComboBox *boxMajorTicksType, *boxMinorTicksType, *boxFormat, *boxAxisType, *boxColName;
QGroupBox *boxFramed;
QLabel *label1, *label2, *label3, *boxScaleTypeLabel, *minorBoxLabel, *labelTable;
QSpinBox *boxMajorTicksLength, *boxMinorTicksLength, *boxBorderWidth;
QComboBox *boxUnit, *boxTableName, *boxGridXAxis, *boxGridYAxis;
ColorButton *boxFrameColor, *boxAxisNumColor;
QGroupBox *labelBox;
QPushButton * buttonLabelFont;
TextFormatButtons *formatButtons;
QStringList tickLabelsOn;
QGroupBox *boxAxesBreaks;
DoubleSpinBox *boxBreakStart, *boxBreakEnd, *boxStepBeforeBreak, *boxStepAfterBreak;
QSpinBox *boxBreakPosition, *boxBreakWidth;
QComboBox *boxMinorTicksBeforeBreak, *boxMinorTicksAfterBreak;
QCheckBox *boxLog10AfterBreak, *boxBreakDecoration, *boxAntialiseGrid;
QComboBox *boxApplyGridFormat;
Graph* d_graph;
QWidget* lastPage;
QDateTimeEdit *boxStartDateTime, *boxEndDateTime;
QComboBox *canvasFrameApplyToBox;
QPushButton *frameDefaultBtn;
QSpinBox *boxLabelsDistance;
QGroupBox *axisFormatBox;
QComboBox *axisFormatApplyToBox;
QCheckBox *invertTitleBox;
QCheckBox* boxAxisBackbone;
QSpinBox *boxTickLabelDistance;
QLineEdit *boxPrefix, *boxSuffix;
QComboBox *showTicksPolicyBox;
ColorButton *axisLabelColorButton;
};
#endif
AxesDialog::axisLabelColorButton
ColorButton * axisLabelColorButton
Definition: AxesDialog.h:215
AxesDialog::boxPrefix
QLineEdit * boxPrefix
Definition: AxesDialog.h:212
AxesDialog::boxAntialiseGrid
QCheckBox * boxAntialiseGrid
Definition: AxesDialog.h:198
AxesDialog::axisFormatApplyToBox
QComboBox * axisFormatApplyToBox
Definition: AxesDialog.h:208
AxesDialog::boxFramed
QGroupBox * boxFramed
Definition: AxesDialog.h:184
AxesDialog::boxColName
QComboBox * boxColName
Definition: AxesDialog.h:183
AxesDialog::boxShowFormula
QCheckBox * boxShowFormula
Definition: AxesDialog.h:181
AxesDialog::boxLabelsDistance
QSpinBox * boxLabelsDistance
Definition: AxesDialog.h:206
AxesDialog::labelTable
QLabel * labelTable
Definition: AxesDialog.h:185
AxesDialog::changeMinorTicksLength
void changeMinorTicksLength(int minLength)
Definition: AxesDialog.cpp:776
AxesDialog::frameDefaultBtn
QPushButton * frameDefaultBtn
Definition: AxesDialog.h:205
AxesDialog::updateCurrentAxis
void updateCurrentAxis()
Definition: AxesDialog.cpp:1643
AxesDialog::boxBreakPosition
QSpinBox * boxBreakPosition
Definition: AxesDialog.h:196
AxesDialog::applyAxisFormatToLayer
void applyAxisFormatToLayer(Graph *g)
Customizes graph axes.
Definition: AxesDialog.cpp:1994
AxesDialog::applyChangesToGrid
void applyChangesToGrid(Grid *grid)
Modifies the grid.
Definition: AxesDialog.cpp:1089
AxesDialog::boxBreakWidth
QSpinBox * boxBreakWidth
Definition: AxesDialog.h:196
AxesDialog::boxSuffix
QLineEdit * boxSuffix
Definition: AxesDialog.h:212
AxesDialog::pickAxisLabelColor
void pickAxisLabelColor()
Definition: AxesDialog.cpp:1823
AxesDialog::canvasFrameApplyToBox
QComboBox * canvasFrameApplyToBox
Definition: AxesDialog.h:204
AxesDialog::boxColorMajor
ColorButton * boxColorMajor
Definition: AxesDialog.h:165
AxesDialog::boxMajorGrid
QCheckBox * boxMajorGrid
Definition: AxesDialog.h:161
AxesDialog::axesGridList
QListWidget * axesGridList
Definition: AxesDialog.h:172
AxesDialog::boxTypeMinor
PenStyleBox * boxTypeMinor
Definition: AxesDialog.h:168
AxesDialog::boxFrameWidth
QSpinBox * boxFrameWidth
Definition: AxesDialog.h:179
AxesDialog::initGridPage
void initGridPage()
generate UI for the grid page
Definition: AxesDialog.cpp:310
Graph
A 2D-plotting widget.
Definition: Graph.h:123
AxesDialog::boxXLine
QCheckBox * boxXLine
Definition: AxesDialog.h:170
AxesDialog::btnInvert
QCheckBox * btnInvert
Definition: AxesDialog.h:156
AxesDialog::boxAxesLinewidth
QSpinBox * boxAxesLinewidth
Definition: AxesDialog.h:179
AxesDialog::boxAxisColor
ColorButton * boxAxisColor
Definition: AxesDialog.h:182
ColorButton
A customized QtColorPicker used for color selection.
Definition: ColorButton.h:39
AxesDialog::boxAxisNumColor
ColorButton * boxAxisNumColor
Definition: AxesDialog.h:188
AxesDialog::boxWidthMinor
DoubleSpinBox * boxWidthMinor
Definition: AxesDialog.h:169
AxesDialog::customAxisFont
void customAxisFont()
Definition: AxesDialog.cpp:998
AxesDialog::boxBreakStart
DoubleSpinBox * boxBreakStart
Definition: AxesDialog.h:195
AxesDialog::updateAxisType
void updateAxisType(int axis)
Definition: AxesDialog.cpp:929
AxesDialog::boxStep
DoubleSpinBox * boxStep
Definition: AxesDialog.h:154
AxesDialog::showAxis
void showAxis()
Definition: AxesDialog.cpp:934
AxesDialog::label2
QLabel * label2
Definition: AxesDialog.h:185
AxesDialog::setAxisType
void setAxisType(int axis)
Definition: AxesDialog.cpp:1623
AxesDialog::changeMajorTicksLength
void changeMajorTicksLength(int majLength)
Definition: AxesDialog.cpp:782
Grid
Definition: Grid.h:36
AxesDialog::boxFrameColor
ColorButton * boxFrameColor
Definition: AxesDialog.h:188
AxesDialog::updateTickLabelsList
void updateTickLabelsList(bool)
Definition: AxesDialog.cpp:1671
AxesDialog::updateGrid
void updateGrid()
Definition: AxesDialog.cpp:1033
AxesDialog::boxShowLabels
QGroupBox * boxShowLabels
Definition: AxesDialog.h:175
AxesDialog::showTicksPolicyBox
QComboBox * showTicksPolicyBox
Definition: AxesDialog.h:214
AxesDialog::labelBox
QGroupBox * labelBox
Definition: AxesDialog.h:189
AxesDialog::btnAxesFont
QPushButton * btnAxesFont
Definition: AxesDialog.h:180
AxesDialog::stepDisabled
void stepDisabled()
Definition: AxesDialog.cpp:1207
AxesDialog::buttonApply
QPushButton * buttonApply
Definition: AxesDialog.h:145
AxesDialog::boxStartDateTime
QDateTimeEdit * boxStartDateTime
Definition: AxesDialog.h:203
AxesDialog::AxesDialog
AxesDialog(QWidget *parent=0, Qt::WFlags fl=0)
Constructor.
Definition: AxesDialog.cpp:70
AxesDialog::updateLabelsFormat
void updateLabelsFormat(int)
Definition: AxesDialog.cpp:1784
AxesDialog::boxBorderWidth
QSpinBox * boxBorderWidth
Definition: AxesDialog.h:186
AxesDialog::pageChanged
void pageChanged(QWidget *page)
Definition: AxesDialog.cpp:1839
AxesDialog::gridPage
QWidget * gridPage
Definition: AxesDialog.h:160
AxesDialog::buttonCancel
QPushButton * buttonCancel
Definition: AxesDialog.h:147
AxesDialog::boxGridXAxis
QComboBox * boxGridXAxis
Definition: AxesDialog.h:187
AxesDialog::boxLog10AfterBreak
QCheckBox * boxLog10AfterBreak
Definition: AxesDialog.h:198
AxesDialog::boxApplyGridFormat
QComboBox * boxApplyGridFormat
Definition: AxesDialog.h:199
AxesDialog::boxAxisType
QComboBox * boxAxisType
Definition: AxesDialog.h:183
AxesDialog::boxShowAxis
QCheckBox * boxShowAxis
Definition: AxesDialog.h:176
AxesDialog::minorBoxLabel
QLabel * minorBoxLabel
Definition: AxesDialog.h:185
AxesDialog::boxBackbones
QCheckBox * boxBackbones
Definition: AxesDialog.h:181
AxesDialog::exec
int exec()
Shows the dialog as a modal dialog.
Definition: AxesDialog.cpp:1856
AxesDialog::boxStart
DoubleSpinBox * boxStart
Definition: AxesDialog.h:151
AxesDialog::boxScaleTypeLabel
QLabel * boxScaleTypeLabel
Definition: AxesDialog.h:185
AxesDialog::boxMajorTicksType
QComboBox * boxMajorTicksType
Definition: AxesDialog.h:183
AxesDialog::boxGridYAxis
QComboBox * boxGridYAxis
Definition: AxesDialog.h:187
AxesDialog::boxMajorTicksLength
QSpinBox * boxMajorTicksLength
Definition: AxesDialog.h:186
AxesDialog::initAxesPage
void initAxesPage()
generate UI for the axes page
Definition: AxesDialog.cpp:438
DoubleSpinBox
A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.
Definition: DoubleSpinBox.h:39
AxesDialog::boxAngle
QSpinBox * boxAngle
Definition: AxesDialog.h:179
AxesDialog::invertTitleBox
QCheckBox * invertTitleBox
Definition: AxesDialog.h:209
AxesDialog::initScalesPage
void initScalesPage()
generate UI for the scales page
Definition: AxesDialog.cpp:110
AxesDialog::updateAxisColor
void updateAxisColor(int)
Definition: AxesDialog.cpp:1215
AxesDialog::boxMinorTicksType
QComboBox * boxMinorTicksType
Definition: AxesDialog.h:183
AxesDialog::boxMinorTicksLength
QSpinBox * boxMinorTicksLength
Definition: AxesDialog.h:186
AxesDialog::updateMinorTicksList
void updateMinorTicksList(int scaleType)
Definition: AxesDialog.cpp:1867
AxesDialog::axesTitlesList
QListWidget * axesTitlesList
Definition: AxesDialog.h:174
AxesDialog::generalDialog
QTabWidget * generalDialog
Definition: AxesDialog.h:148
AxesDialog::boxMinorValue
QComboBox * boxMinorValue
Definition: AxesDialog.h:153
AxesDialog::initFramePage
void initFramePage()
generate UI for the general page
Definition: AxesDialog.cpp:700
AxesDialog::label1
QLabel * label1
Definition: AxesDialog.h:185
AxesDialog::applyAxisFormat
void applyAxisFormat()
Definition: AxesDialog.cpp:2030
AxesDialog::boxFormula
QTextEdit * boxFormula
Definition: AxesDialog.h:178
AxesDialog::boxTableName
QComboBox * boxTableName
Definition: AxesDialog.h:187
AxesDialog::stepEnabled
void stepEnabled()
Definition: AxesDialog.cpp:1199
AxesDialog::boxScaleType
QComboBox * boxScaleType
Definition: AxesDialog.h:152
AxesDialog::boxEnd
DoubleSpinBox * boxEnd
Definition: AxesDialog.h:150
AxesDialog::updateShowBox
void updateShowBox(int axis)
Definition: AxesDialog.cpp:980
AxesDialog::showAxesPage
void showAxesPage()
Definition: AxesDialog.cpp:1727
AxesDialog::showAxisFormatOptions
void showAxisFormatOptions(int format)
Definition: AxesDialog.cpp:788
AxesDialog::boxColorMinor
ColorButton * boxColorMinor
Definition: AxesDialog.h:164
AxesDialog::mapToQwtAxisId
int mapToQwtAxisId()
Definition: AxesDialog.cpp:1411
AxesDialog::scalesPage
QWidget * scalesPage
Definition: AxesDialog.h:149
AxesDialog::showGridOptions
void showGridOptions(int axis)
Definition: AxesDialog.cpp:1114
AxesDialog::boxFormat
QComboBox * boxFormat
Definition: AxesDialog.h:183
AxesDialog::applyCanvasFormat
void applyCanvasFormat()
Definition: AxesDialog.cpp:1934
AxesDialog::buttonLabelFont
QPushButton * buttonLabelFont
Definition: AxesDialog.h:190
AxesDialog::majorGridEnabled
void majorGridEnabled(bool on)
Definition: AxesDialog.cpp:1015
AxesDialog::mapToQwtAxis
int mapToQwtAxis(int axis)
Definition: AxesDialog.cpp:1416
AxesDialog::frame
QWidget * frame
Definition: AxesDialog.h:173
AxesDialog::boxBaseline
QSpinBox * boxBaseline
Definition: AxesDialog.h:179
AxesDialog::boxUnit
QComboBox * boxUnit
Definition: AxesDialog.h:187
AxesDialog::setLabelsNumericFormat
void setLabelsNumericFormat(int)
Definition: AxesDialog.cpp:1739
AxesDialog::boxPrecision
QSpinBox * boxPrecision
Definition: AxesDialog.h:179
AxesDialog::setCurrentScale
void setCurrentScale(int axisPos)
Definition: AxesDialog.cpp:1703
AxesDialog::boxAxisBackbone
QCheckBox * boxAxisBackbone
Definition: AxesDialog.h:210
AxesDialog::buttonOk
QPushButton * buttonOk
Definition: AxesDialog.h:146
AxesDialog::axesPage
QWidget * axesPage
Definition: AxesDialog.h:173
AxesDialog::setBaselineDist
void setBaselineDist(int)
Definition: AxesDialog.cpp:1634
AxesDialog::showAxisFormula
void showAxisFormula(int axis)
Definition: AxesDialog.cpp:1770
AxesDialog::boxEndDateTime
QDateTimeEdit * boxEndDateTime
Definition: AxesDialog.h:203
AxesDialog::showGeneralPage
void showGeneralPage()
Definition: AxesDialog.cpp:1810
AxesDialog::tickLabelsOn
QStringList tickLabelsOn
Definition: AxesDialog.h:193
TextFormatButtons
Widget with text format buttons (connected to a QTextEdit)
Definition: TextFormatButtons.h:38
AxesDialog::boxMinorTicksAfterBreak
QComboBox * boxMinorTicksAfterBreak
Definition: AxesDialog.h:197
AxesDialog::btnMajor
QRadioButton * btnMajor
Definition: AxesDialog.h:158
AxesDialog::axesList
QListWidget * axesList
Definition: AxesDialog.h:159
AxesDialog::showGridPage
void showGridPage()
Definition: AxesDialog.cpp:1733
AxesDialog::lastPage
QWidget * lastPage
Last selected tab.
Definition: AxesDialog.h:202
AxesDialog::boxStepAfterBreak
DoubleSpinBox * boxStepAfterBreak
Definition: AxesDialog.h:195
AxesDialog::btnStep
QRadioButton * btnStep
Definition: AxesDialog.h:155
AxesDialog::boxCanvasColor
ColorButton * boxCanvasColor
Definition: AxesDialog.h:166
AxesDialog::label3
QLabel * label3
Definition: AxesDialog.h:185
AxesDialog::minorGridEnabled
void minorGridEnabled(bool on)
Definition: AxesDialog.cpp:1024
AxesDialog::setFrameDefaultValues
void setFrameDefaultValues()
Definition: AxesDialog.cpp:1974
AxesDialog::boxMinorGrid
QCheckBox * boxMinorGrid
Definition: AxesDialog.h:162
AxesDialog::boxYLine
QCheckBox * boxYLine
Definition: AxesDialog.h:171
AxesDialog
General plot options dialog.
Definition: AxesDialog.h:64
AxesDialog::boxBreakEnd
DoubleSpinBox * boxBreakEnd
Definition: AxesDialog.h:195
AxesDialog::boxTitle
QTextEdit * boxTitle
Definition: AxesDialog.h:178
AxesDialog::boxMinorTicksBeforeBreak
QComboBox * boxMinorTicksBeforeBreak
Definition: AxesDialog.h:197
AxesDialog::showFormulaBox
void showFormulaBox()
Definition: AxesDialog.cpp:1815
AxesDialog::setGraph
void setGraph(Graph *g)
Definition: AxesDialog.cpp:1375
AxesDialog::boxTickLabelDistance
QSpinBox * boxTickLabelDistance
Definition: AxesDialog.h:211
AxesDialog::updatePlot
bool updatePlot(QWidget *page=NULL)
Definition: AxesDialog.cpp:1231
AxesDialog::accept
void accept()
Definition: AxesDialog.cpp:1009
AxesDialog::axisFormatBox
QGroupBox * axisFormatBox
Definition: AxesDialog.h:207
AxesDialog::updateTitleBox
void updateTitleBox(int axis)
Definition: AxesDialog.cpp:1604
PenStyleBox
A modified QComboBox allowing to choose a Qt::PenStyle.
Definition: PenStyleBox.h:38
AxesDialog::formatButtons
TextFormatButtons * formatButtons
Definition: AxesDialog.h:191
AxesDialog::customAxisLabelFont
void customAxisLabelFont()
Definition: AxesDialog.cpp:1829
AxesDialog::boxMajorValue
QSpinBox * boxMajorValue
Definition: AxesDialog.h:157
AxesDialog::boxAxesBreaks
QGroupBox * boxAxesBreaks
Definition: AxesDialog.h:194
AxesDialog::boxTypeMajor
PenStyleBox * boxTypeMajor
Definition: AxesDialog.h:163
AxesDialog::boxWidthMajor
DoubleSpinBox * boxWidthMajor
Definition: AxesDialog.h:167
AxesDialog::boxBreakDecoration
QCheckBox * boxBreakDecoration
Definition: AxesDialog.h:198
AxesDialog::applyCanvasFormatTo
void applyCanvasFormatTo(Graph *g)
Definition: AxesDialog.cpp:1919
AxesDialog::d_graph
Graph * d_graph
Definition: AxesDialog.h:200
AxesDialog::setTicksType
void setTicksType(int)
Definition: AxesDialog.cpp:1664
AxesDialog::boxStepBeforeBreak
DoubleSpinBox * boxStepBeforeBreak
Definition: AxesDialog.h:195
AxesDialog::updateScale
void updateScale()
Definition: AxesDialog.cpp:1437