QtiPlot  0.9.8.2
LayerDialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : LayerDialog.h
3  Project : QtiPlot
4  --------------------------------------------------------------------
5  Copyright : (C) 2004-2010 by Ion Vasilief
6  Email (use @ for *) : ion_vasilief*yahoo.fr
7  Description : Arrange layers dialog
8 
9  ***************************************************************************/
10 
11 /***************************************************************************
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * *
18  * This program is distributed in the hope that it will be useful, *
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21  * GNU General Public License for more details. *
22  * *
23  * You should have received a copy of the GNU General Public License *
24  * along with this program; if not, write to the Free Software *
25  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
26  * Boston, MA 02110-1301 USA *
27  * *
28  ***************************************************************************/
29 #ifndef LAYERDIALOG_H
30 #define LAYERDIALOG_H
31 
32 #include <MultiLayer.h>
33 
34 #include <QDialog>
35 
36 class DoubleSpinBox;
37 class QGroupBox;
38 class QPushButton;
39 class QSpinBox;
40 class QCheckBox;
41 class QComboBox;
42 
44 class LayerDialog : public QDialog
45 {
46  Q_OBJECT
47 
48 public:
49  LayerDialog(QWidget* parent, bool okMode = false, Qt::WFlags fl = 0);
50  void setMultiLayer(MultiLayer *g);
51  void setLayers(int layers);
52  void setLayerCanvasSize(int w, int h, int unit);
53  void setMargins(int, int, int, int);
54  void setRows(int);
55  void setColumns(int);
56  void setSharedAxes(bool = true);
57 
58 protected slots:
59  void accept();
60  void update();
61  void enableLayoutOptions(bool ok);
62  void swapLayers();
63  void updateSizes(int unit);
64  void adjustCanvasHeight(double width);
65  void adjustCanvasWidth(double height);
66  void showCommonAxesBox();
67 
68 private:
69  void closeEvent(QCloseEvent*);
70  int convertToPixels(double w, FrameWidget::Unit unit, int dimension);
71  double convertFromPixels(int w, FrameWidget::Unit unit, int dimension);
72 
74 
75  QPushButton* buttonOk;
76  QPushButton* buttonCancel;
77  QPushButton* buttonApply;
78  QPushButton* buttonSwapLayers;
79  QGroupBox *GroupCanvasSize, *GroupGrid;
80  QSpinBox *boxX, *boxY, *boxColsGap, *boxRowsGap;
83  QSpinBox *layersBox;
85  QCheckBox *fitBox;
86  QComboBox *alignHorBox, *alignVertBox;
87  QComboBox *unitBox;
88  QCheckBox *keepRatioBox;
89  QComboBox *alignPolicyBox;
90  QCheckBox *commonAxesBox;
91  QCheckBox *fixedSizeBox;
92  QCheckBox *linkXAxesBox;
93 
94  double aspect_ratio;
95 };
96 
97 #endif
QGroupBox * GroupGrid
Definition: LayerDialog.h:79
An MDI window (MdiSubWindow) managing one or more Graph objects.
Definition: MultiLayer.h:64
void adjustCanvasWidth(double height)
Definition: LayerDialog.cpp:508
void setLayers(int layers)
Definition: LayerDialog.cpp:524
QSpinBox * boxRowsGap
Definition: LayerDialog.h:80
QSpinBox * boxLayerSrc
Definition: LayerDialog.h:84
QSpinBox * boxColsGap
Definition: LayerDialog.h:80
void updateSizes(int unit)
Definition: LayerDialog.cpp:473
Arrange layers dialog.
Definition: LayerDialog.h:44
QCheckBox * fitBox
Definition: LayerDialog.h:85
QPushButton * buttonSwapLayers
Definition: LayerDialog.h:78
void setLayerCanvasSize(int w, int h, int unit)
Definition: LayerDialog.cpp:529
QSpinBox * boxBottomSpace
Definition: LayerDialog.h:81
QSpinBox * boxX
Definition: LayerDialog.h:80
QSpinBox * boxLayerDest
Definition: LayerDialog.h:84
void setMargins(int, int, int, int)
Definition: LayerDialog.cpp:554
int convertToPixels(double w, FrameWidget::Unit unit, int dimension)
Definition: LayerDialog.cpp:412
void setRows(int)
Definition: LayerDialog.cpp:544
A QDoubleSpinBox allowing to customize numbers display with respect to locale settings.
Definition: DoubleSpinBox.h:39
QComboBox * alignHorBox
Definition: LayerDialog.h:86
void closeEvent(QCloseEvent *)
Definition: LayerDialog.cpp:571
QCheckBox * fixedSizeBox
Definition: LayerDialog.h:91
void adjustCanvasHeight(double width)
Definition: LayerDialog.cpp:498
void setSharedAxes(bool=true)
Definition: LayerDialog.cpp:562
void enableLayoutOptions(bool ok)
Definition: LayerDialog.cpp:249
QSpinBox * boxLeftSpace
Definition: LayerDialog.h:81
QSpinBox * boxRightSpace
Definition: LayerDialog.h:81
Unit
Length units.
Definition: FrameWidget.h:44
QPushButton * buttonOk
Definition: LayerDialog.h:75
QGroupBox * GroupCanvasSize
Definition: LayerDialog.h:79
void update()
Definition: LayerDialog.cpp:298
QComboBox * alignPolicyBox
Definition: LayerDialog.h:89
QComboBox * unitBox
Definition: LayerDialog.h:87
void setColumns(int)
Definition: LayerDialog.cpp:549
QCheckBox * linkXAxesBox
Definition: LayerDialog.h:92
double convertFromPixels(int w, FrameWidget::Unit unit, int dimension)
Definition: LayerDialog.cpp:442
MultiLayer * multi_layer
Definition: LayerDialog.h:73
QCheckBox * commonAxesBox
Definition: LayerDialog.h:90
QSpinBox * layersBox
Definition: LayerDialog.h:83
QCheckBox * keepRatioBox
Definition: LayerDialog.h:88
DoubleSpinBox * boxCanvasWidth
Definition: LayerDialog.h:82
void swapLayers()
Definition: LayerDialog.cpp:401
QPushButton * buttonCancel
Definition: LayerDialog.h:76
QSpinBox * boxY
Definition: LayerDialog.h:80
QSpinBox * boxTopSpace
Definition: LayerDialog.h:81
QComboBox * alignVertBox
Definition: LayerDialog.h:86
void setMultiLayer(MultiLayer *g)
Definition: LayerDialog.cpp:255
void accept()
Definition: LayerDialog.cpp:395
double aspect_ratio
Definition: LayerDialog.h:94
LayerDialog(QWidget *parent, bool okMode=false, Qt::WFlags fl=0)
Definition: LayerDialog.cpp:44
QPushButton * buttonApply
Definition: LayerDialog.h:77
void showCommonAxesBox()
Definition: LayerDialog.cpp:518
DoubleSpinBox * boxCanvasHeight
Definition: LayerDialog.h:82